[PATCH v4 0/5] hwmon: ltc2945: Add binding and shunt resistor support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Added the ability to specify the value of the shunt resistor in the
device tree instead of assuming it is 1 milliOhm.

Would be good to backport as well

Changes since v3:
- Remove shunt-resistor-micro-ohms in binding commit message
- Simplify ltc2945_value_store fix
- Validate overflow
- ltc2945_value_store accept only 32-bit uint from user to avoid overflow
- Link to v3: https://lore.kernel.org/r/20230109233534.1932370-1-jcormier@xxxxxxxxxxxxxxxx
Changes since v2:
- Remove newline
- Combined overflow fix with "Allow setting shunt resistor" commit
- Add description to "Add devicetree match table"
- Add fix for unhandled error case in ltc2945_value_store
- Use imperative in descriptions
- Remove unneeded overflow check from ltc2945_reg_to_val
- Fix up DIV_ROUND_CLOSEST_ULL calls, per docs divisor should be 32-bit
- Split one DIV_ROUND_CLOSEST_ULL change into separate commit per
 Guenter Roeck's comment
Changes since v1:
- Add devicetree match table
- Add kerneldoc for the ltc2945_data struct
- Cleanup excesive comments about the shunt resistor
- Switch to device_property_read_u32()

Signed-off-by: Jonathan Cormier <jcormier@xxxxxxxxxxxxxxxx>
---
John Pruitt (1):
      hwmon: ltc2945: Allow setting shunt resistor

Jonathan Cormier (4):
      dt-bindings: hwmon: adi,ltc2945: Add binding
      hwmon: ltc2945: Add devicetree match table
      hwmon: ltc2945: Handle error case in ltc2945_value_store
      hwmon: ltc2945: Convert division to DIV_ROUND_CLOSEST_ULL

 .../devicetree/bindings/hwmon/adi,ltc2945.yaml     |  49 ++++++++
 drivers/hwmon/ltc2945.c                            | 132 ++++++++++++++-------
 2 files changed, 136 insertions(+), 45 deletions(-)
---
base-commit: 93f875a8526a291005e7f38478079526c843cbec
change-id: 20230126-b4-ltc2945_shunt_resistor-f64955044365

Best regards,
-- 
Jonathan Cormier <jcormier@xxxxxxxxxxxxxxxx>




[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux