linux-loongson/Documentation/hwmon/ina238.rst
Jonas Rebmann 3e8e93cbb8 hwmon: (ina238) Report energy in microjoules
The hwmon sysfs interface specifies that energy values should be
reported in microjoules. This is also what tools such as lmsensors
expect, reporting wrong values otherwise.

Adjust the driver to scale the output accordingly and adjust ina238
driver documentation.

Fixes: 6daaf15a11 ("hwmon: (ina238) Add support for SQ52206")
Signed-off-by: Jonas Rebmann <jre@pengutronix.de>
Link: https://lore.kernel.org/r/20250715-hwmon-ina238-microjoules-v1-1-9df678568a41@pengutronix.de
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2025-07-18 09:50:51 -07:00

72 lines
2.0 KiB
ReStructuredText

.. SPDX-License-Identifier: GPL-2.0-only
Kernel driver ina238
====================
Supported chips:
* Texas Instruments INA238
Prefix: 'ina238'
Addresses: I2C 0x40 - 0x4f
Datasheet:
https://www.ti.com/lit/gpn/ina238
* Silergy SQ52206
Prefix: 'SQ52206'
Addresses: I2C 0x40 - 0x4f
Author: Nathan Rossi <nathan.rossi@digi.com>
Description
-----------
The INA238 is a current shunt, power and temperature monitor with an I2C
interface. It includes a number of programmable functions including alerts,
conversion rate, sample averaging and selectable shunt voltage accuracy.
The shunt value in micro-ohms can be set via platform data or device tree at
compile-time or via the shunt_resistor attribute in sysfs at run-time. Please
refer to the Documentation/devicetree/bindings/hwmon/ti,ina2xx.yaml for bindings
if the device tree is used.
Sysfs entries
-------------
======================= =======================================================
in0_input Shunt voltage (mV)
in0_min Minimum shunt voltage threshold (mV)
in0_min_alarm Minimum shunt voltage alarm
in0_max Maximum shunt voltage threshold (mV)
in0_max_alarm Maximum shunt voltage alarm
in1_input Bus voltage (mV)
in1_min Minimum bus voltage threshold (mV)
in1_min_alarm Minimum shunt voltage alarm
in1_max Maximum bus voltage threshold (mV)
in1_max_alarm Maximum shunt voltage alarm
power1_input Power measurement (uW)
power1_max Maximum power threshold (uW)
power1_max_alarm Maximum power alarm
curr1_input Current measurement (mA)
temp1_input Die temperature measurement (mC)
temp1_max Maximum die temperature threshold (mC)
temp1_max_alarm Maximum die temperature alarm
======================= =======================================================
Additional sysfs entries for sq52206
------------------------------------
======================= =======================================================
energy1_input Energy measurement (uJ)
power1_input_highest Peak Power (uW)
======================= =======================================================