* [PATCH 2/3] dt-bindings: leds: qcom,spmi-flash-led: document battery supply properties
@ 2026-12-01 12:04 Qianhui Xu
2026-12-01 12:52 ` Luca Weiss
0 siblings, 1 reply; 2+ messages in thread
From: Qianhui Xu @ 2026-12-01 12:04 UTC (permalink / raw)
To: lee, pavel
Cc: robh, krzk+dt, conor+dt, quic_fenglinw, linux-arm-msm,
linux-leds, devicetree, linux-kernel
The driver (drivers/leds/flash/leds-qcom-flash.c) already consumes three
DT properties that the binding does not declare:
- "power-supplies" (qcom_flash_get_battery(): fwnode reference used to
locate the battery power supply that backs flash operation),
- "qcom,battery-current-limit-microamp" (read at
leds-qcom-flash.c:248, clamped by FLASH_BATTERY_CURRENT_MAX_UA),
- "qcom,battery-voltage-min-microvolt" (read at
leds-qcom-flash.c:256).
DT nodes that wire these properties therefore fail dtbs_check with
"do not match any of the regexes". Document them, require the two
qcom,battery-* limits whenever "power-supplies" is present, and forbid
the limits on their own. No DT or driver change.
Found while auditing a board that enables qcom,pm8550-flash-led with a
battery-backed flash.
Signed-off-by: Qianhui Xu <xiaqinghuan@mail.ustc.edu.cn>
---
*** AI-assistance disclosure ***
This patch was prepared with the help of an LLM coding assistant. The
author reviewed every line, checked every quoted claim against the tree,
and ran the gates recorded in the send report; the design decisions and
any errors are the author's.
diff --git a/Documentation/devicetree/bindings/leds/qcom,spmi-flash-led.yaml b/Documentation/devicetree/bindings/leds/qcom,spmi-flash-led.yaml
index 3bfa24ff5..e65630d8d 100644
--- a/Documentation/devicetree/bindings/leds/qcom,spmi-flash-led.yaml
+++ b/Documentation/devicetree/bindings/leds/qcom,spmi-flash-led.yaml
@@ -36,6 +36,35 @@ properties:
reg:
maxItems: 1
+ power-supplies:
+ $ref: /schemas/types.yaml#/definitions/phandle
+ description:
+ Provider of the battery supplying the flash controller. If the provider
+ exposes multiple power supplies, exactly one must be of battery type.
+ The battery must supply open-circuit voltage, current and internal resistance.
+
+ qcom,battery-current-limit-microamp:
+ description: Maximum battery discharge current allowed during a flash.
+ minimum: 1
+ maximum: 4500000
+
+ qcom,battery-voltage-min-microvolt:
+ description: Minimum loaded battery voltage, including the required droop margin.
+ minimum: 1
+
+allOf:
+ - if:
+ required:
+ - power-supplies
+ then:
+ required:
+ - qcom,battery-current-limit-microamp
+ - qcom,battery-voltage-min-microvolt
+
+dependentRequired:
+ qcom,battery-current-limit-microamp: [power-supplies]
+ qcom,battery-voltage-min-microvolt: [power-supplies]
+
patternProperties:
"^led-[0-3]$":
type: object
--
2.43.0
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH 2/3] dt-bindings: leds: qcom,spmi-flash-led: document battery supply properties
2026-12-01 12:04 [PATCH 2/3] dt-bindings: leds: qcom,spmi-flash-led: document battery supply properties Qianhui Xu
@ 2026-12-01 12:52 ` Luca Weiss
0 siblings, 0 replies; 2+ messages in thread
From: Luca Weiss @ 2026-12-01 12:52 UTC (permalink / raw)
To: Qianhui Xu, lee, pavel
Cc: robh, krzk+dt, conor+dt, quic_fenglinw, linux-arm-msm,
linux-leds, devicetree, linux-kernel
On Tue Dec 1, 2026 at 1:04 PM CET, Qianhui Xu wrote:
> The driver (drivers/leds/flash/leds-qcom-flash.c) already consumes three
> DT properties that the binding does not declare:
>
> - "power-supplies" (qcom_flash_get_battery(): fwnode reference used to
> locate the battery power supply that backs flash operation),
> - "qcom,battery-current-limit-microamp" (read at
> leds-qcom-flash.c:248, clamped by FLASH_BATTERY_CURRENT_MAX_UA),
> - "qcom,battery-voltage-min-microvolt" (read at
> leds-qcom-flash.c:256).
All of these three claims are completely bogus. Either your LLM is very
badly hallucinating or you run this on a completely different source
tree.
Regards
Luca
> DT nodes that wire these properties therefore fail dtbs_check with
> "do not match any of the regexes". Document them, require the two
> qcom,battery-* limits whenever "power-supplies" is present, and forbid
> the limits on their own. No DT or driver change.
>
> Found while auditing a board that enables qcom,pm8550-flash-led with a
> battery-backed flash.
>
> Signed-off-by: Qianhui Xu <xiaqinghuan@mail.ustc.edu.cn>
> ---
> *** AI-assistance disclosure ***
> This patch was prepared with the help of an LLM coding assistant. The
> author reviewed every line, checked every quoted claim against the tree,
> and ran the gates recorded in the send report; the design decisions and
> any errors are the author's.
>
> diff --git a/Documentation/devicetree/bindings/leds/qcom,spmi-flash-led.yaml b/Documentation/devicetree/bindings/leds/qcom,spmi-flash-led.yaml
> index 3bfa24ff5..e65630d8d 100644
> --- a/Documentation/devicetree/bindings/leds/qcom,spmi-flash-led.yaml
> +++ b/Documentation/devicetree/bindings/leds/qcom,spmi-flash-led.yaml
> @@ -36,6 +36,35 @@ properties:
> reg:
> maxItems: 1
>
> + power-supplies:
> + $ref: /schemas/types.yaml#/definitions/phandle
> + description:
> + Provider of the battery supplying the flash controller. If the provider
> + exposes multiple power supplies, exactly one must be of battery type.
> + The battery must supply open-circuit voltage, current and internal resistance.
> +
> + qcom,battery-current-limit-microamp:
> + description: Maximum battery discharge current allowed during a flash.
> + minimum: 1
> + maximum: 4500000
> +
> + qcom,battery-voltage-min-microvolt:
> + description: Minimum loaded battery voltage, including the required droop margin.
> + minimum: 1
> +
> +allOf:
> + - if:
> + required:
> + - power-supplies
> + then:
> + required:
> + - qcom,battery-current-limit-microamp
> + - qcom,battery-voltage-min-microvolt
> +
> +dependentRequired:
> + qcom,battery-current-limit-microamp: [power-supplies]
> + qcom,battery-voltage-min-microvolt: [power-supplies]
> +
> patternProperties:
> "^led-[0-3]$":
> type: object
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-12-01 12:52 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-12-01 12:04 [PATCH 2/3] dt-bindings: leds: qcom,spmi-flash-led: document battery supply properties Qianhui Xu
2026-12-01 12:52 ` Luca Weiss
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®