From: Rudraksha Gupta <[email protected]> Some flash ICs use the same one-wire pulse-count protocol as the RT8515 but have only a single enable line for both flash and torch modes, plus an optional input voltage supply (e.g. a GPIO-controlled fixed regulator) that gates power to the chip.
Make ent-gpios optional and add a vin-supply property to support these variants. Add a oneOf constraint requiring exactly one of ent-gpios or vin-supply. Add a binding example showing the single-GPIO configuration with an input supply. Signed-off-by: Rudraksha Gupta <[email protected]> --- .../devicetree/bindings/leds/richtek,rt8515.yaml | 34 +++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/leds/richtek,rt8515.yaml b/Documentation/devicetree/bindings/leds/richtek,rt8515.yaml index 0356371a6b01..ab3c5139132c 100644 --- a/Documentation/devicetree/bindings/leds/richtek,rt8515.yaml +++ b/Documentation/devicetree/bindings/leds/richtek,rt8515.yaml @@ -15,6 +15,10 @@ description: | current for each mode is defined in hardware using two resistors RFS and RTS. + Some flash ICs use the same one-wire pulse-count protocol but have + only a single enable line for both flash and torch modes. For these + single-channel variants, only enf-gpios is needed. + properties: compatible: const: richtek,rt8515 @@ -26,6 +30,11 @@ properties: ent-gpios: maxItems: 1 description: A connection to the 'ENT' (enable torch) pin. + Not present on single-channel flash ICs that use only one enable + line for both flash and torch modes. + + vin-supply: + description: Optional input supply for the flash IC. richtek,rfs-ohms: minimum: 7680 @@ -81,10 +90,15 @@ properties: required: - compatible - - ent-gpios - enf-gpios - led +oneOf: + - required: + - ent-gpios + - required: + - vin-supply + additionalProperties: false examples: @@ -108,4 +122,22 @@ examples: }; }; + - | + /* Single-channel flash IC with input supply */ + #include <dt-bindings/gpio/gpio.h> + #include <dt-bindings/leds/common.h> + + led-controller { + compatible = "richtek,rt8515"; + enf-gpios = <&tlmm 3 GPIO_ACTIVE_HIGH>; + vin-supply = <&flash_reg>; + richtek,rfs-ohms = <16000>; + + led { + function = LED_FUNCTION_FLASH; + color = <LED_COLOR_ID_WHITE>; + flash-max-timeout-us = <250000>; + }; + }; + ... -- 2.53.0

