mbox series

[0/4] power: supply: max17042: cleanup and more features

Message ID 20241109-b4-max17042-v1-0-9e2b07e54e76@gmail.com
Headers show
Series power: supply: max17042: cleanup and more features | expand

Message

Dzmitry Sankouski Nov. 9, 2024, 12:44 p.m. UTC
Maxim max17042 driver cleanup, and shared-irq feature.

Fuelgauge blocks often are incorporated in bigger chip,
which may use only 1 line for interrupts. Shared-irq
handles that case by requesting irq as shared.

Signed-off-by: Dzmitry Sankouski <dsankouski@gmail.com>
---
Dzmitry Sankouski (4):
      dt-bindings: power: supply: max17042: add share-irq node
      power: supply: max17042: implement dts shared-irq
      power: supply: max17042: use microvolts for voltage comparison
      power: supply: max17042: rename maxim,rsns-microohm property

 Documentation/devicetree/bindings/power/supply/maxim,max17042.yaml | 13 +++++++++----
 arch/arm/boot/dts/samsung/exynos4210-i9100.dts                     |  2 +-
 arch/arm/boot/dts/samsung/exynos4212-tab3.dtsi                     |  2 +-
 arch/arm/boot/dts/samsung/exynos4412-midas.dtsi                    |  2 +-
 arch/arm/boot/dts/samsung/exynos4412-p4note.dtsi                   |  4 ++--
 arch/arm64/boot/dts/freescale/imx8mq-librem5-r4.dts                |  2 +-
 arch/arm64/boot/dts/freescale/imx8mq-librem5.dtsi                  |  4 ++--
 arch/arm64/boot/dts/qcom/msm8916-motorola-harpia.dts               |  6 +++---
 arch/arm64/boot/dts/qcom/msm8916-motorola-osprey.dts               |  6 +++---
 arch/arm64/boot/dts/qcom/msm8916-motorola-surnia.dts               |  6 +++---
 arch/arm64/boot/dts/qcom/msm8916-samsung-gt5-common.dtsi           |  4 ++--
 drivers/power/supply/max17042_battery.c                            |  9 +++------
 include/linux/power/max17042_battery.h                             |  1 +
 13 files changed, 32 insertions(+), 29 deletions(-)
---
base-commit: 929beafbe7acce3267c06115e13e03ff6e50548a
change-id: 20241108-b4-max17042-9306fc75afae

Best regards,

Comments

Krzysztof Kozlowski Nov. 9, 2024, 1:48 p.m. UTC | #1
On 09/11/2024 13:44, Dzmitry Sankouski wrote:
> Do not convert VCELL register value from uV to mV to compare
> with vmin/vmax. Rather use uV for vim/vmax, since that's a
> standard measure unit in power supply drivers.
> 
> Convert "maxim,dead-volt" and "maxim,over-volt" to uV.
> 
> Signed-off-by: Dzmitry Sankouski <dsankouski@gmail.com>
> ---
>  Documentation/devicetree/bindings/power/supply/maxim,max17042.yaml | 2 +-
>  arch/arm/boot/dts/samsung/exynos4210-i9100.dts                     | 2 +-
>  arch/arm/boot/dts/samsung/exynos4212-tab3.dtsi                     | 2 +-
>  arch/arm/boot/dts/samsung/exynos4412-midas.dtsi                    | 2 +-
>  arch/arm/boot/dts/samsung/exynos4412-p4note.dtsi                   | 2 +-
>  arch/arm64/boot/dts/freescale/imx8mq-librem5.dtsi                  | 2 +-
>  arch/arm64/boot/dts/qcom/msm8916-motorola-harpia.dts               | 4 ++--
>  arch/arm64/boot/dts/qcom/msm8916-motorola-osprey.dts               | 4 ++--
>  arch/arm64/boot/dts/qcom/msm8916-motorola-surnia.dts               | 4 ++--
>  arch/arm64/boot/dts/qcom/msm8916-samsung-gt5-common.dtsi           | 2 +-
>  drivers/power/supply/max17042_battery.c                            | 4 ----
>  11 files changed, 13 insertions(+), 17 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/power/supply/maxim,max17042.yaml b/Documentation/devicetree/bindings/power/supply/maxim,max17042.yaml
> index e98ffdad1ec3..d1ad597e0837 100644
> --- a/Documentation/devicetree/bindings/power/supply/maxim,max17042.yaml
> +++ b/Documentation/devicetree/bindings/power/supply/maxim,max17042.yaml
> @@ -83,7 +83,7 @@ examples:
>          reg = <0x36>;
>          maxim,rsns-microohm = <10000>;
>          maxim,over-heat-temp = <600>;
> -        maxim,over-volt = <4300>;
> +        maxim,over-volt = <4300000>;
>          shared-irq;

Property says this is mV so 4300 V? That's just wrong.

Entire commit touching bindings, drivers and DTS in one patch is an ABI
break and just clear NAK.

Best regards,
Krzysztof
Krzysztof Kozlowski Nov. 9, 2024, 1:49 p.m. UTC | #2
On 09/11/2024 13:44, Dzmitry Sankouski wrote:
> If specified, driver should request irq as shared.
> 
> Signed-off-by: Dzmitry Sankouski <dsankouski@gmail.com>
> ---
>  Documentation/devicetree/bindings/power/supply/maxim,max17042.yaml | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/power/supply/maxim,max17042.yaml b/Documentation/devicetree/bindings/power/supply/maxim,max17042.yaml
> index 085e2504d0dc..e98ffdad1ec3 100644
> --- a/Documentation/devicetree/bindings/power/supply/maxim,max17042.yaml
> +++ b/Documentation/devicetree/bindings/power/supply/maxim,max17042.yaml
> @@ -59,6 +59,11 @@ properties:
>        Voltage threshold to report battery as over voltage (in mV).
>        Default is not to report over-voltage events.
>  
> +  shared-irq:
> +    description: |
> +      Request interrupt as shared.
> +      Set in case of other devices using same interrupt pin.

Why you cannot request shared interrupt always? It's not the property of
this device to know whether its interrupt is shared or not. What if we
add overlay sharing the interrupt? Nope, that's just describing OS behavior.

Best regards,
Krzysztof