hwmon: (ina238) Various improvements and added chip support
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest17 patches 2 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/17 | hwmon: (ina238) Drop platform data supportDocumentation/ drivers/ | +6 | 0 replies | |
| 2/17 | hwmon: (ina238) Update documentation and Kconfig entryDocumentation/ drivers/ | +35 | 0 replies | |
| 3/17 | hwmon: (ina238) Drop pointless power attribute check on attribute writesdrivers/ | +2 | 0 replies | |
| 4/17 | hwmon: (ina238) Rework and simplify temperature calculationsdrivers/ | +24 | 0 replies | |
| 5/17 | hwmon: (ina238) Pre-calculate current, power, and energy LSBdrivers/ | +27 | 0 replies | |
| 6/17 | hwmon: (ina238) Simplify voltage register accessesdrivers/ | +53 | 0 replies | |
| 7/17 | hwmon: (ina238) Improve current dynamic rangedrivers/ | +19 | 0 replies | |
| 8/17 | hwmon: (ina238) Stop using the shunt voltage registerdrivers/ | +1 | 0 replies | |
| 9/17 | hwmon: (ina238) Add support for current limitsDocumentation/ drivers/ | +87 | 0 replies | |
| 10/17 | hwmon: (ina238) Order chip information alphabeticallydrivers/ | +12 | 0 replies | |
| 11/17 | hwmon: Introduce 64-bit energy attribute supportDocumentation/ drivers/ include/ +1 more | +20 | 0 replies | |
| 12/17 | hwmon: (ina238) Use the energy64 attribute type to report the energydrivers/ | +15 | 0 replies | |
| 13/17 | hwmon: (ina238) Support active-high alert polaritydrivers/ | +6 | 0 replies | |
| 14/17 | hwmon: (ina238) Only configure calibration and shunt registers if neededdrivers/ | +42 | 0 replies | |
| 15/17 | hwmon: (ina238) Add support for INA780Documentation/ drivers/ drivers/ | +28 | 0 replies | |
| 16/17 | dt-bindings: hwmon: ti,ina2xx: Add INA700Documentation/ | +4 | 0 replies | |
| 17/17 | hwmon: (ina238) Add support for INA700Documentation/ drivers/ drivers/ | +26 | 0 replies |
Reviews trailers per patch
1 of 17 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.
| Patch | Krzysztof Kozlowski | Chris Packham |
|---|---|---|
| Series | R-b T-b | |
| 1/17 | ||
| 2/17 | ||
| 3/17 | ||
| 4/17 | ||
| 5/17 | ||
| 6/17 | ||
| 7/17 | ||
| 8/17 | ||
| 9/17 | ||
| 10/17 | ||
| 11/17 | ||
| 12/17 | ||
| 13/17 | ||
| 14/17 | ||
| 15/17 | ||
| 16/17 | R-b | |
| 17/17 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH 00/17] hwmon: (ina238) Various improvements and added chip support
Add support for INA700 and INA780 to the ina238 driver.
To prepare for this, implement various improvements.
- Update documention and Kconfig entry to list all supported chips.
- Drop platform data support. The driver supports device properties, and there are no in-tree platform data users.
- Stop checking the attribute value when writing the power_max attribute as unnecessary.
- Simplify temperature calculations. Instead of shift and lsb, only require the resulution and use it to calculate temperatures.
- Pre-calculate voltage, current, power and energy LSB. The values don't change during runtime and can therefore be pre-calculated. Also use the equations provided in the dataasheets to calculate power and energy LSB from the current LSB instead of calculating it from scratch.
- Use ROUND_CLOSEST operations instead of divide operations to reduce rounding errors.
- Improve current dynamic range by matching shunt voltage and current register values. With that, the dynamic range is always the full 16 bit provided by the ADC.
- Stop using the shunt voltage register. With shunt and current register values now always matching, it is unnecessary to read both.
- Provide current limits from shunt voltage limit registers. After all, there is no difference for the ADC, so the shunt voltage limits translate into current limits.
- Order chip information alphabetically. No functional change, it just simplifies adding support for new chips.
- Add 64-bit energy attribute support to the hwmon core.
- Use the hwmon core to report 64-bit energy values.
- Add support for active-high alert polarity
- Limit shunt and calibration register writes to chips requiring/supporting it.
- Add support for INA700 and INA780. Both chips have internal shunt resistors and do not explicitly report the shunt voltage.
This patch series was inspired by Chris Packham's initial patch set of a new INA780 driver, by his subsequent patch set adding support for that chip to the ina238 driver, and by Christian Kahr's submission of a new INA700 driver.
The series was tested with INA228, INA237, INA238, and INA780 evaluation boards as well as with unit test code.
----------------------------------------------------------------
Guenter Roeck (17):
hwmon: (ina238) Drop platform data support
hwmon: (ina238) Update documentation and Kconfig entry
hwmon: (ina238) Drop pointless power attribute check on attribute writes
hwmon: (ina238) Rework and simplify temperature calculations
hwmon: (ina238) Pre-calculate current, power, and energy LSB
hwmon: (ina238) Simplify voltage register accesses
hwmon: (ina238) Improve current dynamic range
hwmon: (ina238) Stop using the shunt voltage register
hwmon: (ina238) Add support for current limits
hwmon: (ina238) Order chip information alphabetically
hwmon: Introduce 64-bit energy attribute support
hwmon: (ina238) Use the energy64 attribute type to report the energy
hwmon: (ina238) Support active-high alert polarity
hwmon: (ina238) Only configure calibration and shunt registers if needed
hwmon: (ina238) Add support for INA780
dt-bindings: hwmon: ti,ina2xx: Add INA700
hwmon: (ina238) Add support for INA700
.../devicetree/bindings/hwmon/ti,ina2xx.yaml | 4 + Documentation/hwmon/hwmon-kernel-api.rst | 3 + Documentation/hwmon/ina238.rst | 64 ++- drivers/hwmon/Kconfig | 9 +- drivers/hwmon/hwmon.c | 16 +- drivers/hwmon/ina238.c | 583 +++++++++++---------- include/linux/hwmon.h | 1 + include/trace/events/hwmon.h | 10 +- 8 files changed, 382 insertions(+), 308 deletions(-)