[PATCH 2/3] dt-bindings: leds: qcom,spmi-flash-led: document battery supply properties

From: Qianhui Xu

Date: Tue Dec 01 2026 - 07:04:29 EST


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@xxxxxxxxxxxxxxxx>
---
*** 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