mbox series

[v5,0/2] hwmon:(ina238)Add support for SQ52206

Message ID 20250313075501.5435-1-wenliang202407@163.com (mailing list archive)
Headers show
Series hwmon:(ina238)Add support for SQ52206 | expand

Message

Wenliang Yan March 13, 2025, 7:54 a.m. UTC
Add support for Silergy i2c power monitor SQ52206 to the ina238
driver as those two are similar.

Signed-off-by: Wenliang Yan <wenliang202407@163.com>
---

Add new chip SQ52206, the datasheet depends on 
https://us1.silergy.com/cloud/index/uniqid/676b659b4a503
The password is fx6NEe.

Changes in v5:
- Add the description of change log in PATCH 0 and PATCH 2.
- Link to v4: https://lore.kernel.org/linux-hwmon/20250125030300.1230967-1-wenliang202407@163.com/

Changes in v4:
- Add 'Acked-by: Krzysztof Kozlowski' information to PATCH 1.

- Formatting adjustments have been made to ina2xx.c in PATCH 2.
Including:
1.Change 'sprintf()' in the 'energy1_input_show()' to 'sysfs_emit()'.
2.Move up the "enum ina238_ids chip" line in the 'ina238_probe()' to keep RCT style.
3.Remove the last comma when describing 'ina238_of_match[]' to keep the
format consistent with the 'i2c_device_id ina238_id[]' structure.
4.Change the '5bytes' in the description to '5 bytes'.

- Link to v3: https://lore.kernel.org/linux-hwmon/20250117082017.688212-1-wenliang202407@163.com/

Changes in v3:
- Add the description of the different features of SQ52206 in the ina2xx.yaml(PATCH 1).

- Change program logic errors in ina238.c(PATCH 2).
Including:
1.Change 'break' to 'return 0' after 'if (has_power_highest)'.
2.Add {} after 'if (chip == sq52206)' in 'ina238_probe(struct i2c_client *client)'.
3.Change 'data->config->has_energy ? NULL : ina238_groups' to 
'data->config->has_energy ? ina238_groups : NULL'

- Link to v2: https://lore.kernel.org/linux-hwmon/20250113035023.365697-1-wenliang202407@163.com/

Changes in v2:
- Explain why sq52206 compatibility has been added to ina2xx.yaml.

- addressed various review comments.

- Link to v1: https://lore.kernel.org/linux-hwmon/20241224063559.391061-1-wenliang202407@163.com/

Wenliang Yan (2):
  dt-bindings:Add SQ52206 to ina2xx devicetree bindings
  hwmon:(ina238)Add support for SQ52206

 .../devicetree/bindings/hwmon/ti,ina2xx.yaml  |   4 +
 Documentation/hwmon/ina238.rst                |  15 ++
 drivers/hwmon/ina238.c                        | 209 +++++++++++++++---
 3 files changed, 195 insertions(+), 33 deletions(-)