Update epm_adc_psoc_show_in() to fix potential
dereference to adc_code used to store the
PSOC code data.
Change-Id: I7b68f50f89fd38f0ac32f1793720e1af3ef43022
Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
Incorrect spi write transactions and incorrect readings
are seen. This is because of using incorrect SPI slave
address while initiating the SPI writes to the ADS ADC.
Also fix the incorrect scaling when converting the raw ADC
code to the appropriate physical result.
Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
(cherry picked from commit de90ed4d1f8285e4fe663a3ca52d3e377b590ef1)
Change-Id: I0280d7d014a9ba88e3b6eac02764feb8cdd55c66
Signed-off-by: Sudhir Sharma <sudsha@codeaurora.org>
Add support for communicating with the PSOC
using the supported protocol commands from
the PSOC.
The support includes communicating with the
controller to initiate and start the ADC
conversion for the selected channels. Start
and receive ADC conversion for single measurement,
buffered reads, averaging the samples and returning
the results over the set averaging period.
Other commands supported include setting/receiving
the timestamp, setting reference voltage, toggling
gpio to set triggers on set events.
Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
(cherry picked from commit efddea4639f2953375fb822524fcae756ae67dc0)
Change-Id: Id519a5b9033b85953f1d6229a144f9df78910900
Signed-off-by: Sudhir Sharma <sudsha@codeaurora.org>
The scaling function multiplies the ADC code with
a high scale factor to avoid rouding accuracy errors.
This results in a 32 bit integer not being sufficient
to store the result. Therefore use a 64 bit integer
type to process the result.
Signed-off-by: Yan He <yanhe@codeaurora.org>
(cherry picked from commit f6adab796cfd509c4c5beb9f0458e0d9fd8da6a6)
Change-Id: I94b26df3a3d0860c92fbb991e015ed0e3b185884
Signed-off-by: Sudhir Sharma <sudsha@codeaurora.org>
Devices attributes have lockdep keys and so they should exist in
the data section. Failure to do this results in lockdep turning
itself off and warnings such as:
BUG: key eeb0883c not in .data!
Fix this problem by statically allocating the devices attributes
and hardcoding the names instead of generating them dynamically.
Change-Id: I8db28768b3bdffab21db8c2ea2cfb21f0e4010c1
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>