mbox series

[v6,0/2] power: supply: add support for MAX1720x standalone fuel

Message ID 20240702090308.8848-1-dima.fedrau@gmail.com (mailing list archive)
Headers show
Series power: supply: add support for MAX1720x standalone fuel | expand

Message

Dimitri Fedrau July 2, 2024, 9:03 a.m. UTC
Changes to max1721x_battery.c:
  - reading manufacturer, model name and serial number is only possible
    when SBS functions of the IC are enabled.(nNVCfg0.enSBS) Factory
    default is off. Manufacturer is "Maxim Integrated" and the model name
    can be derived by register MAX172XX_DEV_NAME. Serial number is not
    available anymore.
  - According to the datasheet MAX172XX_BAT_PRESENT is at BIT(3) not
    BIT(4). Furthermore the naming is misleading, when BIT(3) is set the
    battery is not present.
  - Removed DeviceName, ManufacturerName and SerialNumber from struct
    max17211_device_info

Changes in V2:
  - Changed E-Mail in Patch (2/2) Signed-Off

Changes in V3:
  - Changed E-Mail in Patch (2/2) Author

Changes in V4:
  - add compatibles "maxim,max17201, "maxim,max17205" in bindings
  - use generic node name fuel-gauge@36 instead of max17201@36 in bindings
  - remove status in bindings
  - fix spelling mistakes in commit message
  - fix indentation in Kconfig
  - fix typos in max1720x_battery.c
  - Drop bat and bat_desc from info struct.
  - MAX172XX_DEV_NAME and MAX172XX_DESIGN_CAP aren't volatile, adjust regmap
  - constify max1720x_manufacturer, max17201_model, max17205_model
  - constify max1720x_battery_props
  - Remove braces around reg in max172xx_current_to_voltage
  - Skip initialization of reg_val in max1720x_battery_get_property
  - Remove braces around FIELD_GET() in max1720x_battery_get_property
  - In case POWER_SUPPLY_PROP_PRESENT there is an early return if ret < 0.
    Return 0 if regmap_read fails, device is not responding in case
    battery is not inserted
  - Implement multi-byte readings instead of i2c_smbus_read_word_data
  - Drop ancillary from info
  - Drop both calls to i2c_set_clientdata in max1720x_probe
  - Get rid of max1720x_remove
  - Remove comma after sentinel in max1720x_of_match
  - Fix alignment of max1720x_i2c_driver
  - Fix return value of dev_err_probe after max1720x_probe_sense_resistor
    to use ret instead of PTR_ERR(info->bat)

Changes in V5:
  - oneOf with list and fallback in bindings
  - unevaluatedProperties: false in bindings
  - switch back to i2c_smbus_read_word_data when reading from ancillary
  - add psy_cfg.fwnode = dev_fwnode(dev) in max1720x_probe
  - set max_register in max1720x_regmap_cfg to MAX172XX_ATAVCAP
  - fix typo in define: MAX1720X_NRSENSE instead of MAX1720_NRSENSE

Changes in V6:
  - s/1720x/17201/ in title and in the filename of the bindings
  - remove compatible "maxim,max17205" from max1720x_of_match
  - Added Reviewed-by: Sebastian Reichel <sre@kernel.org>, hope this is
    still okay due to changes in V5 and V6

Dimitri Fedrau (2):
  dt-bindings: power: supply: add support for MAX17201/MAX17205 fuel
    gauge
  power: supply: add support for MAX1720x standalone fuel gauge

 .../bindings/power/supply/maxim,max17201.yaml |  58 +++
 drivers/power/supply/Kconfig                  |  12 +
 drivers/power/supply/Makefile                 |   1 +
 drivers/power/supply/max1720x_battery.c       | 337 ++++++++++++++++++
 4 files changed, 408 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/power/supply/maxim,max17201.yaml
 create mode 100644 drivers/power/supply/max1720x_battery.c

Comments

Sebastian Reichel July 4, 2024, 8:43 a.m. UTC | #1
On Tue, 02 Jul 2024 11:03:06 +0200, Dimitri Fedrau wrote:
> Changes to max1721x_battery.c:
>   - reading manufacturer, model name and serial number is only possible
>     when SBS functions of the IC are enabled.(nNVCfg0.enSBS) Factory
>     default is off. Manufacturer is "Maxim Integrated" and the model name
>     can be derived by register MAX172XX_DEV_NAME. Serial number is not
>     available anymore.
>   - According to the datasheet MAX172XX_BAT_PRESENT is at BIT(3) not
>     BIT(4). Furthermore the naming is misleading, when BIT(3) is set the
>     battery is not present.
>   - Removed DeviceName, ManufacturerName and SerialNumber from struct
>     max17211_device_info
> 
> [...]

Applied, thanks!

[1/2] dt-bindings: power: supply: add support for MAX17201/MAX17205 fuel gauge
      commit: ad0aa2361c8c0d1f29db3d6da4a11be41813296d
[2/2] power: supply: add support for MAX1720x standalone fuel gauge
      commit: 479b6d04964b5abe66c9f5080fad3389b34e2a70

Best regards,