* [PATCH] dt-bindings: power: supply: sc27xx-fg: add low voltage alarm IRQ
@ 2024-08-15 10:01 Stanislav Jakubek
2024-08-15 14:46 ` Conor Dooley
2024-08-27 16:25 ` Sebastian Reichel
0 siblings, 2 replies; 5+ messages in thread
From: Stanislav Jakubek @ 2024-08-15 10:01 UTC (permalink / raw)
To: Sebastian Reichel, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Orson Zhai, Baolin Wang, Chunyan Zhang
Cc: linux-pm, devicetree, linux-kernel
The SC27XX fuel gauge supports a low voltage alarm IRQ, which is used
for more accurate battery capacity measurements with lower voltages.
This was unfortunately never documented in bindings, do so now.
Signed-off-by: Stanislav Jakubek <stano.jakubek@gmail.com>
---
Initial Linux driver submission adding this feature:
https://lore.kernel.org/lkml/ee1dd39f126bd03fb88381de9663d32df994d341.1542185618.git.baolin.wang@linaro.org/
The only in-tree user (sc2731.dtsi) has had interrupts specified since its
initial fuel-gauge submission:
https://lore.kernel.org/lkml/4f66af3b47ba241380f8092e08879aca6d7c35b3.1548052878.git.baolin.wang@linaro.org/
.../devicetree/bindings/power/supply/sc27xx-fg.yaml | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/Documentation/devicetree/bindings/power/supply/sc27xx-fg.yaml b/Documentation/devicetree/bindings/power/supply/sc27xx-fg.yaml
index de43e45a43b7..9108a2841caf 100644
--- a/Documentation/devicetree/bindings/power/supply/sc27xx-fg.yaml
+++ b/Documentation/devicetree/bindings/power/supply/sc27xx-fg.yaml
@@ -27,6 +27,9 @@ properties:
battery-detect-gpios:
maxItems: 1
+ interrupts:
+ maxItems: 1
+
io-channels:
items:
- description: Battery Temperature ADC
@@ -53,6 +56,7 @@ required:
- compatible
- reg
- battery-detect-gpios
+ - interrupts
- io-channels
- io-channel-names
- nvmem-cells
@@ -88,6 +92,8 @@ examples:
compatible = "sprd,sc2731-fgu";
reg = <0xa00>;
battery-detect-gpios = <&pmic_eic 9 GPIO_ACTIVE_HIGH>;
+ interrupt-parent = <&sc2731_pmic>;
+ interrupts = <4>;
io-channels = <&pmic_adc 5>, <&pmic_adc 14>;
io-channel-names = "bat-temp", "charge-vol";
nvmem-cells = <&fgu_calib>;
--
2.34.1
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH] dt-bindings: power: supply: sc27xx-fg: add low voltage alarm IRQ
2024-08-15 10:01 [PATCH] dt-bindings: power: supply: sc27xx-fg: add low voltage alarm IRQ Stanislav Jakubek
@ 2024-08-15 14:46 ` Conor Dooley
2024-08-16 6:58 ` Stanislav Jakubek
2024-08-27 16:25 ` Sebastian Reichel
1 sibling, 1 reply; 5+ messages in thread
From: Conor Dooley @ 2024-08-15 14:46 UTC (permalink / raw)
To: Stanislav Jakubek
Cc: Sebastian Reichel, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Orson Zhai, Baolin Wang, Chunyan Zhang, linux-pm, devicetree,
linux-kernel
[-- Attachment #1: Type: text/plain, Size: 2310 bytes --]
On Thu, Aug 15, 2024 at 12:01:36PM +0200, Stanislav Jakubek wrote:
> The SC27XX fuel gauge supports a low voltage alarm IRQ, which is used
> for more accurate battery capacity measurements with lower voltages.
>
> This was unfortunately never documented in bindings, do so now.
>
> Signed-off-by: Stanislav Jakubek <stano.jakubek@gmail.com>
> ---
> Initial Linux driver submission adding this feature:
> https://lore.kernel.org/lkml/ee1dd39f126bd03fb88381de9663d32df994d341.1542185618.git.baolin.wang@linaro.org/
>
> The only in-tree user (sc2731.dtsi) has had interrupts specified since its
> initial fuel-gauge submission:
> https://lore.kernel.org/lkml/4f66af3b47ba241380f8092e08879aca6d7c35b3.1548052878.git.baolin.wang@linaro.org/
This context could go into the commit message I think, as justification
for making the interrupt required.
Also, this binding is odd in that it has several compatibles in an enum,
but the driver (added at the same time) only has one compatible in it.
Are you using the sc2731 in your device?
>
> .../devicetree/bindings/power/supply/sc27xx-fg.yaml | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/power/supply/sc27xx-fg.yaml b/Documentation/devicetree/bindings/power/supply/sc27xx-fg.yaml
> index de43e45a43b7..9108a2841caf 100644
> --- a/Documentation/devicetree/bindings/power/supply/sc27xx-fg.yaml
> +++ b/Documentation/devicetree/bindings/power/supply/sc27xx-fg.yaml
> @@ -27,6 +27,9 @@ properties:
> battery-detect-gpios:
> maxItems: 1
>
> + interrupts:
> + maxItems: 1
> +
> io-channels:
> items:
> - description: Battery Temperature ADC
> @@ -53,6 +56,7 @@ required:
> - compatible
> - reg
> - battery-detect-gpios
> + - interrupts
> - io-channels
> - io-channel-names
> - nvmem-cells
> @@ -88,6 +92,8 @@ examples:
> compatible = "sprd,sc2731-fgu";
> reg = <0xa00>;
> battery-detect-gpios = <&pmic_eic 9 GPIO_ACTIVE_HIGH>;
> + interrupt-parent = <&sc2731_pmic>;
> + interrupts = <4>;
> io-channels = <&pmic_adc 5>, <&pmic_adc 14>;
> io-channel-names = "bat-temp", "charge-vol";
> nvmem-cells = <&fgu_calib>;
> --
> 2.34.1
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] dt-bindings: power: supply: sc27xx-fg: add low voltage alarm IRQ
2024-08-15 14:46 ` Conor Dooley
@ 2024-08-16 6:58 ` Stanislav Jakubek
2024-08-16 16:04 ` Conor Dooley
0 siblings, 1 reply; 5+ messages in thread
From: Stanislav Jakubek @ 2024-08-16 6:58 UTC (permalink / raw)
To: Conor Dooley
Cc: Sebastian Reichel, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Orson Zhai, Baolin Wang, Chunyan Zhang, linux-pm, devicetree,
linux-kernel
Hi Conor,
On Thu, Aug 15, 2024 at 03:46:18PM +0100, Conor Dooley wrote:
> On Thu, Aug 15, 2024 at 12:01:36PM +0200, Stanislav Jakubek wrote:
> > The SC27XX fuel gauge supports a low voltage alarm IRQ, which is used
> > for more accurate battery capacity measurements with lower voltages.
> >
> > This was unfortunately never documented in bindings, do so now.
> >
> > Signed-off-by: Stanislav Jakubek <stano.jakubek@gmail.com>
> > ---
> > Initial Linux driver submission adding this feature:
> > https://lore.kernel.org/lkml/ee1dd39f126bd03fb88381de9663d32df994d341.1542185618.git.baolin.wang@linaro.org/
> >
> > The only in-tree user (sc2731.dtsi) has had interrupts specified since its
> > initial fuel-gauge submission:
> > https://lore.kernel.org/lkml/4f66af3b47ba241380f8092e08879aca6d7c35b3.1548052878.git.baolin.wang@linaro.org/
>
> This context could go into the commit message I think, as justification
> for making the interrupt required.
TBH I'm not 100% sure that the interrupt is required, I just looked at
the Linux driver, and that it returns from probe if it doesn't get the IRQ.
>
> Also, this binding is odd in that it has several compatibles in an enum,
> but the driver (added at the same time) only has one compatible in it.
I think the intent was to document the entire sc27xx series of PMICs, as
they're supposedly very similar (this is just my guess), while initially
adding support only for sc2731.
> Are you using the sc2731 in your device?
No, I do not have any such device.
Regards,
Stanislav
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] dt-bindings: power: supply: sc27xx-fg: add low voltage alarm IRQ
2024-08-16 6:58 ` Stanislav Jakubek
@ 2024-08-16 16:04 ` Conor Dooley
0 siblings, 0 replies; 5+ messages in thread
From: Conor Dooley @ 2024-08-16 16:04 UTC (permalink / raw)
To: Stanislav Jakubek
Cc: Sebastian Reichel, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Orson Zhai, Baolin Wang, Chunyan Zhang, linux-pm, devicetree,
linux-kernel
[-- Attachment #1: Type: text/plain, Size: 1756 bytes --]
On Fri, Aug 16, 2024 at 08:58:43AM +0200, Stanislav Jakubek wrote:
> Hi Conor,
>
> On Thu, Aug 15, 2024 at 03:46:18PM +0100, Conor Dooley wrote:
> > On Thu, Aug 15, 2024 at 12:01:36PM +0200, Stanislav Jakubek wrote:
> > > The SC27XX fuel gauge supports a low voltage alarm IRQ, which is used
> > > for more accurate battery capacity measurements with lower voltages.
> > >
> > > This was unfortunately never documented in bindings, do so now.
> > >
> > > Signed-off-by: Stanislav Jakubek <stano.jakubek@gmail.com>
> > > ---
> > > Initial Linux driver submission adding this feature:
> > > https://lore.kernel.org/lkml/ee1dd39f126bd03fb88381de9663d32df994d341.1542185618.git.baolin.wang@linaro.org/
> > >
> > > The only in-tree user (sc2731.dtsi) has had interrupts specified since its
> > > initial fuel-gauge submission:
> > > https://lore.kernel.org/lkml/4f66af3b47ba241380f8092e08879aca6d7c35b3.1548052878.git.baolin.wang@linaro.org/
> >
> > This context could go into the commit message I think, as justification
> > for making the interrupt required.
>
> TBH I'm not 100% sure that the interrupt is required, I just looked at
> the Linux driver, and that it returns from probe if it doesn't get the IRQ.
>
> >
> > Also, this binding is odd in that it has several compatibles in an enum,
> > but the driver (added at the same time) only has one compatible in it.
>
> I think the intent was to document the entire sc27xx series of PMICs, as
> they're supposedly very similar (this is just my guess), while initially
> adding support only for sc2731.
>
> > Are you using the sc2731 in your device?
>
> No, I do not have any such device.
No worries.
Acked-by: Conor Dooley <conor.dooley@microchip.com>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] dt-bindings: power: supply: sc27xx-fg: add low voltage alarm IRQ
2024-08-15 10:01 [PATCH] dt-bindings: power: supply: sc27xx-fg: add low voltage alarm IRQ Stanislav Jakubek
2024-08-15 14:46 ` Conor Dooley
@ 2024-08-27 16:25 ` Sebastian Reichel
1 sibling, 0 replies; 5+ messages in thread
From: Sebastian Reichel @ 2024-08-27 16:25 UTC (permalink / raw)
To: Sebastian Reichel, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Orson Zhai, Baolin Wang, Chunyan Zhang, Stanislav Jakubek
Cc: linux-pm, devicetree, linux-kernel
On Thu, 15 Aug 2024 12:01:36 +0200, Stanislav Jakubek wrote:
> The SC27XX fuel gauge supports a low voltage alarm IRQ, which is used
> for more accurate battery capacity measurements with lower voltages.
>
> This was unfortunately never documented in bindings, do so now.
>
>
Applied, thanks!
[1/1] dt-bindings: power: supply: sc27xx-fg: add low voltage alarm IRQ
commit: 17656d2215c3978bbe2811a5e249cd07fe3de77f
Best regards,
--
Sebastian Reichel <sebastian.reichel@collabora.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2024-08-27 16:25 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-15 10:01 [PATCH] dt-bindings: power: supply: sc27xx-fg: add low voltage alarm IRQ Stanislav Jakubek
2024-08-15 14:46 ` Conor Dooley
2024-08-16 6:58 ` Stanislav Jakubek
2024-08-16 16:04 ` Conor Dooley
2024-08-27 16:25 ` Sebastian Reichel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox