Commit graph

8 commits

Author SHA1 Message Date
Siddartha Mohanadoss
be59a66ad1 hwmon: epm_adc: Fix potential dereference
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>
2016-10-29 23:12:34 +08:00
Iliyan Malchev
87b9b80852 hwmon: fix epm_adc.c compiler warning
Signed-off-by: Iliyan Malchev <malchev@google.com>
2013-04-18 16:08:08 -07:00
Duy Truong
04e554807c Update copyright to The Linux Foundation
Change-Id: Ibead64ce2e901dede2ddd1b86088b88f2350ce92
Signed-off-by: Duy Truong <dtruong@codeaurora.org>
2013-03-15 17:07:39 -07:00
Siddartha Mohanadoss
43e2e65b8c hwmon: epm_adc: Fix incorrect SPI writes
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>
2013-03-07 15:18:51 -08:00
Siddartha Mohanadoss
ec560a9c20 hwmon: epm_adc: Add EPM support using PSOC
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>
2013-03-07 15:18:51 -08:00
Yan He
219ae92960 hwmon: epm_adc: Update the physical result
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>
2013-03-07 15:18:50 -08:00
Stephen Boyd
7902ffe782 epm-adc: Fix lockdep warnings with key's not in .data
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>
2013-02-27 18:14:36 -08:00
Stephen Boyd
aaf081b365 hwmon: Add MSM's epm ADC driver
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
2013-02-25 11:29:52 -08:00