Devicetree
 help / color / mirror / Atom feed
* [PATCH v3 0/2] power: supply: Correct AB8505 charger device tree
@ 2026-09-25  8:59 Linus Walleij
  2026-09-25  8:59 ` [PATCH v3 1/2] dt-bindings: power: supply: ab8500: Add AB8505 charger Linus Walleij
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Linus Walleij @ 2026-09-25  8:59 UTC (permalink / raw)
  To: Sebastian Reichel, Rob Herring, Krzysztof Kozlowski, Conor Dooley
  Cc: linux-pm, devicetree, Linus Walleij, Krzysztof Kozlowski

AB8505 retains the USB charger from AB8500 but omits the separate main
charger block. Its charger node consequently has nine valid interrupts,
not the fourteen interrupts used by AB8500.

Adjust the binding to describe the variant-specific interrupt sets and
remove the five nonexistent main-charger interrupts from the AB8505
device tree. The binding update also limits the autopower_cfg description
to AB8500, since the corresponding AB8505 register bit is reserved.

The power maintainer can apply patch 1/2, I will funnel patch 2/2.

Assisted-by: LLM
Signed-off-by: Linus Walleij <linusw@kernel.org>
---
Changes in v3:
- Move the conditional constraints below the top-level properties.
- Expecting Sebastian to apply patch 1/2.
- Link to v2: https://lore.kernel.org/r/20260918-ab8500-charger-dt-v2-0-5f17c332a2a7@kernel.org

Changes in v2:
- Add an AB8505-specific compatible with the AB8500 fallback.
- Tie interrupt counts and names to the charger compatible.
- Use the new compatible in the AB8505 DTSI.
- Link to v1: https://lore.kernel.org/r/20260915-ab8500-charger-dt-v1-0-10b7b387e6a6@kernel.org

---
Linus Walleij (2):
      dt-bindings: power: supply: ab8500: Add AB8505 charger
      ARM: dts: ux500: Use AB8505 charger compatible

 .../power/supply/stericsson,ab8500-charger.yaml    | 76 ++++++++++++++++------
 arch/arm/boot/dts/st/ste-ab8505.dtsi               | 17 ++---
 2 files changed, 60 insertions(+), 33 deletions(-)
---
base-commit: cee9395acd8043be0644b25c34bfa86623f2b935
change-id: 20260915-ab8500-charger-dt-99c2c4623a80

Best regards,
-- 
Linus Walleij <linusw@kernel.org>


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH v3 1/2] dt-bindings: power: supply: ab8500: Add AB8505 charger
  2026-09-25  8:59 [PATCH v3 0/2] power: supply: Correct AB8505 charger device tree Linus Walleij
@ 2026-09-25  8:59 ` Linus Walleij
  2026-09-25  9:09   ` sashiko-bot
  2026-09-25  8:59 ` [PATCH v3 2/2] ARM: dts: ux500: Use AB8505 charger compatible Linus Walleij
  2026-10-04 17:46 ` (subset) [PATCH v3 0/2] power: supply: Correct AB8505 charger device tree Sebastian Reichel
  2 siblings, 1 reply; 8+ messages in thread
From: Linus Walleij @ 2026-09-25  8:59 UTC (permalink / raw)
  To: Sebastian Reichel, Rob Herring, Krzysztof Kozlowski, Conor Dooley
  Cc: linux-pm, devicetree, Linus Walleij, Krzysztof Kozlowski

AB8500 and AB8505 expose different charger interrupt sets. Add a unique
AB8505 charger compatible with the AB8500 compatible as its fallback.
Use the variant-specific string to require the fourteen main and USB
charger interrupts on AB8500 and the nine USB charger interrupts on
AB8505.

Also clarify that autopower_cfg describes the AB8500 facility, since the
corresponding AB8505 register bit is reserved.

Fixes: eb917497734c ("dt-bindings: power: supply: ab8500: Convert to DT schema format")
Assisted-by: LLM
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Signed-off-by: Linus Walleij <linusw@kernel.org>
---
Sebastian: I think you can apply this now.
---
 .../power/supply/stericsson,ab8500-charger.yaml    | 76 ++++++++++++++++------
 1 file changed, 56 insertions(+), 20 deletions(-)

diff --git a/Documentation/devicetree/bindings/power/supply/stericsson,ab8500-charger.yaml b/Documentation/devicetree/bindings/power/supply/stericsson,ab8500-charger.yaml
index 4f19744844e9..dcffcecaea13 100644
--- a/Documentation/devicetree/bindings/power/supply/stericsson,ab8500-charger.yaml
+++ b/Documentation/devicetree/bindings/power/supply/stericsson,ab8500-charger.yaml
@@ -10,12 +10,13 @@ title: AB8500 Charger
 maintainers:
   - Sebastian Reichel <sre@kernel.org>
 
-allOf:
-  - $ref: power-supply.yaml#
-
 properties:
   compatible:
-    const: stericsson,ab8500-charger
+    oneOf:
+      - const: stericsson,ab8500-charger
+      - items:
+          - const: stericsson,ab8505-charger
+          - const: stericsson,ab8500-charger
 
   monitored-battery: true
 
@@ -28,27 +29,15 @@ properties:
 
   autopower_cfg:
     type: boolean
-    description: automatic poweron after powerloss
+    description: AB8500 automatic poweron after powerloss
 
   interrupts:
+    minItems: 9
     maxItems: 14
 
   interrupt-names:
-    items:
-      - const: MAIN_CH_UNPLUG_DET
-      - const: MAIN_CHARGE_PLUG_DET
-      - const: MAIN_EXT_CH_NOT_OK
-      - const: MAIN_CH_TH_PROT_R
-      - const: MAIN_CH_TH_PROT_F
-      - const: VBUS_DET_F
-      - const: VBUS_DET_R
-      - const: USB_LINK_STATUS
-      - const: USB_CH_TH_PROT_R
-      - const: USB_CH_TH_PROT_F
-      - const: USB_CHARGER_NOT_OKR
-      - const: VBUS_OVV
-      - const: CH_WD_EXP
-      - const: VBUS_CH_DROP_END
+    minItems: 9
+    maxItems: 14
 
   io-channels:
     minItems: 2
@@ -74,6 +63,53 @@ required:
   - io-channels
   - io-channel-names
 
+allOf:
+  - $ref: power-supply.yaml#
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: stericsson,ab8505-charger
+    then:
+      properties:
+        interrupts:
+          minItems: 9
+          maxItems: 9
+
+        interrupt-names:
+          items:
+            - const: VBUS_DET_F
+            - const: VBUS_DET_R
+            - const: USB_LINK_STATUS
+            - const: USB_CH_TH_PROT_R
+            - const: USB_CH_TH_PROT_F
+            - const: USB_CHARGER_NOT_OKR
+            - const: VBUS_OVV
+            - const: CH_WD_EXP
+            - const: VBUS_CH_DROP_END
+    else:
+      properties:
+        interrupts:
+          minItems: 14
+          maxItems: 14
+
+        interrupt-names:
+          items:
+            - const: MAIN_CH_UNPLUG_DET
+            - const: MAIN_CHARGE_PLUG_DET
+            - const: MAIN_EXT_CH_NOT_OK
+            - const: MAIN_CH_TH_PROT_R
+            - const: MAIN_CH_TH_PROT_F
+            - const: VBUS_DET_F
+            - const: VBUS_DET_R
+            - const: USB_LINK_STATUS
+            - const: USB_CH_TH_PROT_R
+            - const: USB_CH_TH_PROT_F
+            - const: USB_CHARGER_NOT_OKR
+            - const: VBUS_OVV
+            - const: CH_WD_EXP
+            - const: VBUS_CH_DROP_END
+
 additionalProperties: false
 
 examples:

-- 
2.55.0


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH v3 2/2] ARM: dts: ux500: Use AB8505 charger compatible
  2026-09-25  8:59 [PATCH v3 0/2] power: supply: Correct AB8505 charger device tree Linus Walleij
  2026-09-25  8:59 ` [PATCH v3 1/2] dt-bindings: power: supply: ab8500: Add AB8505 charger Linus Walleij
@ 2026-09-25  8:59 ` Linus Walleij
  2026-09-25  9:08   ` sashiko-bot
  2026-10-04 17:46 ` (subset) [PATCH v3 0/2] power: supply: Correct AB8505 charger device tree Sebastian Reichel
  2 siblings, 1 reply; 8+ messages in thread
From: Linus Walleij @ 2026-09-25  8:59 UTC (permalink / raw)
  To: Sebastian Reichel, Rob Herring, Krzysztof Kozlowski, Conor Dooley
  Cc: linux-pm, devicetree, Linus Walleij

Identify the AB8505 charger using its variant-specific compatible and
retain the AB8500 compatible as a fallback for the existing driver. This
selects the AB8505 interrupt constraints from the binding.

The AB8505 interrupt table explicitly omits the five interrupt sources
belonging to the AB8500 main charger. Remove these nonexistent interrupts
from the AB8505 charger node, leaving its nine USB charger interrupts.

Fixes: bc324d447fba ("ARM: dts: ux500: Add interrupts to charger")
Assisted-by: LLM
Signed-off-by: Linus Walleij <linusw@kernel.org>
---
 arch/arm/boot/dts/st/ste-ab8505.dtsi | 17 ++++-------------
 1 file changed, 4 insertions(+), 13 deletions(-)

diff --git a/arch/arm/boot/dts/st/ste-ab8505.dtsi b/arch/arm/boot/dts/st/ste-ab8505.dtsi
index 131c82508e82..4c9a8418f225 100644
--- a/arch/arm/boot/dts/st/ste-ab8505.dtsi
+++ b/arch/arm/boot/dts/st/ste-ab8505.dtsi
@@ -137,13 +137,9 @@ ab8500_btemp {
 				};
 
 				ab8500_charger {
-					compatible = "stericsson,ab8500-charger";
-					interrupts = <10 IRQ_TYPE_LEVEL_HIGH>,
-						     <11 IRQ_TYPE_LEVEL_HIGH>,
-						     <0 IRQ_TYPE_LEVEL_HIGH>,
-						     <107 IRQ_TYPE_LEVEL_HIGH>,
-						     <106 IRQ_TYPE_LEVEL_HIGH>,
-						     <14 IRQ_TYPE_LEVEL_HIGH>,
+					compatible = "stericsson,ab8505-charger",
+						     "stericsson,ab8500-charger";
+					interrupts = <14 IRQ_TYPE_LEVEL_HIGH>,
 						     <15 IRQ_TYPE_LEVEL_HIGH>,
 						     <79 IRQ_TYPE_LEVEL_HIGH>,
 						     <105 IRQ_TYPE_LEVEL_HIGH>,
@@ -152,12 +148,7 @@ ab8500_charger {
 						     <22 IRQ_TYPE_LEVEL_HIGH>,
 						     <21 IRQ_TYPE_LEVEL_HIGH>,
 						     <16 IRQ_TYPE_LEVEL_HIGH>;
-					interrupt-names = "MAIN_CH_UNPLUG_DET",
-							  "MAIN_CHARGE_PLUG_DET",
-							  "MAIN_EXT_CH_NOT_OK",
-							  "MAIN_CH_TH_PROT_R",
-							  "MAIN_CH_TH_PROT_F",
-							  "VBUS_DET_F",
+					interrupt-names = "VBUS_DET_F",
 							  "VBUS_DET_R",
 							  "USB_LINK_STATUS",
 							  "USB_CH_TH_PROT_R",

-- 
2.55.0


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH v3 2/2] ARM: dts: ux500: Use AB8505 charger compatible
  2026-09-25  8:59 ` [PATCH v3 2/2] ARM: dts: ux500: Use AB8505 charger compatible Linus Walleij
@ 2026-09-25  9:08   ` sashiko-bot
  2026-09-25 16:23     ` Linus Walleij
  0 siblings, 1 reply; 8+ messages in thread
From: sashiko-bot @ 2026-09-25  9:08 UTC (permalink / raw)
  To: Linus Walleij; +Cc: robh, conor+dt, devicetree

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] power: supply: ab8500_charger probe fails on AB8505 due to missing interrupts
--

commit 200a7cf6b0fcab2522c0b09962c1e5a2bbf1cd85
Author: Linus Walleij <linusw@kernel.org>

ARM: dts: ux500: Use AB8505 charger compatible

Identify the AB8505 charger using its variant-specific compatible and
retain the AB8500 compatible as a fallback. Remove the nonexistent AB8500
main charger interrupts from the AB8505 charger node.

> diff --git a/arch/arm/boot/dts/st/ste-ab8505.dtsi b/arch/arm/boot/dts/st/ste-ab8505.dtsi
> index 131c82508e820..4c9a8418f225a 100644
> --- a/arch/arm/boot/dts/st/ste-ab8505.dtsi
> +++ b/arch/arm/boot/dts/st/ste-ab8505.dtsi
> @@ -137,13 +137,9 @@ ab8500_btemp {
>  				};
>  
>  				ab8500_charger {
> -					compatible = "stericsson,ab8500-charger";
> -					interrupts = <10 IRQ_TYPE_LEVEL_HIGH>,
> -						     <11 IRQ_TYPE_LEVEL_HIGH>,
> -						     <0 IRQ_TYPE_LEVEL_HIGH>,
> -						     <107 IRQ_TYPE_LEVEL_HIGH>,
> -						     <106 IRQ_TYPE_LEVEL_HIGH>,
> -						     <14 IRQ_TYPE_LEVEL_HIGH>,
> +					compatible = "stericsson,ab8505-charger",
> +						     "stericsson,ab8500-charger";
> +					interrupts = <14 IRQ_TYPE_LEVEL_HIGH>,

[Severity: High]
Will this cause the probe function to fail on the AB8505 platform?

Looking at ab8500_charger_probe() in drivers/power/supply/ab8500_charger.c,
it unconditionally iterates over the statically sized 14-element
ab8500_charger_irq array:

	for (i = 0; i < ARRAY_SIZE(ab8500_charger_irq); i++) {
		irq = platform_get_irq_byname(pdev, ab8500_charger_irq[i].name);
		if (irq < 0)
			return irq;

Since this patch removes five of these expected interrupts (such as
MAIN_CH_UNPLUG_DET) from the device tree node, platform_get_irq_byname()
will return a negative error code and abort the probe.

[ ... ]

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260925-ab8500-charger-dt-v3-0-f80b8d295e2d@kernel.org?part=2

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v3 1/2] dt-bindings: power: supply: ab8500: Add AB8505 charger
  2026-09-25  8:59 ` [PATCH v3 1/2] dt-bindings: power: supply: ab8500: Add AB8505 charger Linus Walleij
@ 2026-09-25  9:09   ` sashiko-bot
  2026-09-25 16:22     ` Linus Walleij
  0 siblings, 1 reply; 8+ messages in thread
From: sashiko-bot @ 2026-09-25  9:09 UTC (permalink / raw)
  To: Linus Walleij; +Cc: robh, devicetree, conor+dt

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [High] dt-bindings: driver probe breakage due to 9 interrupt limit for AB8505
- [Medium] dt-bindings: missing schema constraint for autopower_cfg on AB8505
--

commit 56f862db85ac24639bf3e5234e563c4b067537a4
Author: Linus Walleij <linusw@kernel.org>

dt-bindings: power: supply: ab8500: Add AB8505 charger

This commit adds a unique AB8505 charger compatible string with the AB8500
compatible as its fallback. It requires 14 main and USB charger interrupts
on AB8500 and 9 USB charger interrupts on AB8505. It also notes that the
autopower_cfg describes the AB8500 facility, as the AB8505 register bit
is reserved.

> diff --git a/Documentation/devicetree/bindings/power/supply/stericsson,ab8500-charger.yaml b/Documentation/devicetree/bindings/power/supply/stericsson,ab8500-charger.yaml
> index 4f19744844e9c..dcffcecaea13b 100644
> --- a/Documentation/devicetree/bindings/power/supply/stericsson,ab8500-charger.yaml
> +++ b/Documentation/devicetree/bindings/power/supply/stericsson,ab8500-charger.yaml

[ ... ]

>  properties:
>    compatible:
> -    const: stericsson,ab8500-charger
> +    oneOf:
> +      - const: stericsson,ab8500-charger
> +      - items:
> +          - const: stericsson,ab8505-charger
> +          - const: stericsson,ab8500-charger

[ ... ]

> +allOf:
> +  - $ref: power-supply.yaml#
> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            const: stericsson,ab8505-charger
> +    then:
> +      properties:
> +        interrupts:
> +          minItems: 9
> +          maxItems: 9

[Severity: High]
Since stericsson,ab8505-charger uses stericsson,ab8500-charger as a fallback
above, does enforcing a strict limit of 9 interrupts here break driver probe?

Looking at drivers/power/supply/ab8500_charger.c:ab8500_charger_probe(), the
driver unconditionally requests all 14 interrupts:

	for (i = 0; i < ARRAY_SIZE(ab8500_charger_irq); i++) {
		irq = platform_get_irq_byname(pdev, ab8500_charger_irq[i].name);
		if (irq < 0)
			return irq;
	}

If the device tree strictly follows this schema and provides only 9
interrupts, platform_get_irq_byname() will return -ENXIO when requesting the
missing MAIN charger interrupts, aborting probe immediately.

[Severity: Medium]
Since the commit message notes that the corresponding AB8505 register bit
is reserved, should this conditional block explicitly disallow the
autopower_cfg property?

If a device tree includes autopower_cfg in an ab8505-charger node, the schema
will allow it. At runtime, the driver will act on it and invoke
ab8500_enable_disable_sw_fallback(), which unconditionally writes to the
reserved hardware register on AB8505 devices.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260925-ab8500-charger-dt-v3-0-f80b8d295e2d@kernel.org?part=1

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v3 1/2] dt-bindings: power: supply: ab8500: Add AB8505 charger
  2026-09-25  9:09   ` sashiko-bot
@ 2026-09-25 16:22     ` Linus Walleij
  0 siblings, 0 replies; 8+ messages in thread
From: Linus Walleij @ 2026-09-25 16:22 UTC (permalink / raw)
  To: sashiko-reviews; +Cc: robh, devicetree, conor+dt

Hi Sashiko,

On Fri, Sep 25, 2026 at 11:09 AM <sashiko-bot@kernel.org> wrote:

> [Severity: High]
> Since stericsson,ab8505-charger uses stericsson,ab8500-charger as a fallback
> above, does enforcing a strict limit of 9 interrupts here break driver probe?

Not your problem as I have said before.

Bindings and drivers are orthogonal.

> [Severity: Medium]
> Since the commit message notes that the corresponding AB8505 register bit
> is reserved, should this conditional block explicitly disallow the
> autopower_cfg property?

Maybe as a follow-up. We don't need to fix that right now.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v3 2/2] ARM: dts: ux500: Use AB8505 charger compatible
  2026-09-25  9:08   ` sashiko-bot
@ 2026-09-25 16:23     ` Linus Walleij
  0 siblings, 0 replies; 8+ messages in thread
From: Linus Walleij @ 2026-09-25 16:23 UTC (permalink / raw)
  To: sashiko-reviews; +Cc: robh, conor+dt, devicetree

On Fri, Sep 25, 2026 at 11:08 AM <sashiko-bot@kernel.org> wrote:

> [Severity: High]
> Will this cause the probe function to fail on the AB8505 platform?

Not your problem.

Bindings, DTS:es and drivers are orthogonal.

But there is a fix in a different patch series.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: (subset) [PATCH v3 0/2] power: supply: Correct AB8505 charger device tree
  2026-09-25  8:59 [PATCH v3 0/2] power: supply: Correct AB8505 charger device tree Linus Walleij
  2026-09-25  8:59 ` [PATCH v3 1/2] dt-bindings: power: supply: ab8500: Add AB8505 charger Linus Walleij
  2026-09-25  8:59 ` [PATCH v3 2/2] ARM: dts: ux500: Use AB8505 charger compatible Linus Walleij
@ 2026-10-04 17:46 ` Sebastian Reichel
  2 siblings, 0 replies; 8+ messages in thread
From: Sebastian Reichel @ 2026-10-04 17:46 UTC (permalink / raw)
  To: Sebastian Reichel, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Linus Walleij
  Cc: linux-pm, devicetree, Krzysztof Kozlowski


On Fri, 25 Sep 2026 10:59:23 +0200, Linus Walleij wrote:
> AB8505 retains the USB charger from AB8500 but omits the separate main
> charger block. Its charger node consequently has nine valid interrupts,
> not the fourteen interrupts used by AB8500.
> 
> Adjust the binding to describe the variant-specific interrupt sets and
> remove the five nonexistent main-charger interrupts from the AB8505
> device tree. The binding update also limits the autopower_cfg description
> to AB8500, since the corresponding AB8505 register bit is reserved.
> 
> [...]

Applied, thanks!

[1/2] dt-bindings: power: supply: ab8500: Add AB8505 charger
      commit: 80d28539c1f9baab72210501729d67e3d9daa4b8

Best regards,
-- 
Sebastian Reichel <sebastian.reichel@collabora.com>


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2026-10-04 17:46 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-25  8:59 [PATCH v3 0/2] power: supply: Correct AB8505 charger device tree Linus Walleij
2026-09-25  8:59 ` [PATCH v3 1/2] dt-bindings: power: supply: ab8500: Add AB8505 charger Linus Walleij
2026-09-25  9:09   ` sashiko-bot
2026-09-25 16:22     ` Linus Walleij
2026-09-25  8:59 ` [PATCH v3 2/2] ARM: dts: ux500: Use AB8505 charger compatible Linus Walleij
2026-09-25  9:08   ` sashiko-bot
2026-09-25 16:23     ` Linus Walleij
2026-10-04 17:46 ` (subset) [PATCH v3 0/2] power: supply: Correct AB8505 charger device tree Sebastian Reichel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox