Commit Graph

7 Commits

Author SHA1 Message Date
Lothar Felten
94516f10f3 hwmon: (ina2xx) fix sysfs shunt resistor read access
[ Upstream commit 3ad867001c ]

fix the sysfs shunt resistor read access: return the shunt resistor
value, not the calibration register contents.

update email address

Signed-off-by: Lothar Felten <lothar.felten@gmail.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-10-10 08:52:09 +02:00
Kevin Hilman
add513be1c hwmon: (ina2xx) Add ina231 compatible string
Add support for "ina231" as compatible string, and update
Documentation and Kconfig accordingly.

Tested with the Exynos5422-based odroid-xu3 board which has on-board
INA231 sensors.

Signed-off-by: Kevin Hilman <khilman@linaro.org>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2015-01-25 21:23:59 -08:00
Bartosz Golaszewski
72a87a47a8 hwmon: (ina2xx) implement update_interval attribute for ina226
This attribute allows to configure the update interval of ina226. Although
the bus and shunt voltage conversion times remain hardcoded to 1.1 ms, we can
now modify said interval by changing the averaging rate.

While we're at it - add an additional variable to ina2xx_data, which holds
the current configuration settings - this way we'll be able to restore the
configuration in case of an unexpected chip reset.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2015-01-25 21:23:59 -08:00
Bartosz Golaszewski
8a5fc79513 hwmon: (ina2xx) make shunt resistance configurable at run-time
The shunt resistance can only be set via platform_data or device tree. This
isn't suitable for devices in which the shunt resistance can change/isn't
known at boot-time.

Add a sysfs attribute that allows to read and set the shunt resistance.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2015-01-25 21:23:59 -08:00
Tang Yuantian
31e7ad74f6 hwmon: (ina2xx) Add device tree support to pass the shunt resistor
Adding another way that is device tree to pass the shunt resistor
value to driver except for platform data.

Signed-off-by: Tang Yuantian <Yuantian.Tang@freescale.com>
[Guenter Roeck: Added missing of.h include]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-06-27 10:31:42 -07:00
Guenter Roeck
dc92cd0c13 hwmon: (ina2xx) Add support for INA220 and INA230
INA220 is register compatible to INA219, and INA230 is register compatible to
INA226, so all we need to do is to add name aliases for those two chips.

Cc: Lothar Felten <l-felten@ti.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Jean Delvare <khali@linux-fr.org>
2012-09-23 21:08:35 -07:00
Felten, Lothar
f7c2fe386a hwmon: INA219 and INA226 support
Add support for the Texas Instruments INA219 and INA226 power monitors.

Signed-off-by: Lothar Felten <l-felten@ti.com>
[guenter.roeck@ericsson.com: formatting cleanup; check for smbus word data;
 select PGA=8 for INA219]
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2012-05-22 06:48:02 -07:00