Commit 2a5699b0 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull LED updates from Pavel Machek:
 "Most significant here is the driver for Qualcomm LPG. Apparently it
  drives backlight on some boards, so it is quite important for some
  people"

* tag 'leds-5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/pavel/linux-leds:
  leds: qcom-lpg: Require pattern to follow documentation
  leds: lp50xx: Remove duplicated error reporting in .remove()
  leds: qcom-lpg: add missing PWM dependency
  leds: ktd2692: Make aux-gpios optional
  dt-bindings: leds: convert ktd2692 bindings to yaml
  leds: ktd2692: Avoid duplicate error messages on probe deferral
  leds: is31fl32xx: Improve error reporting in .remove()
  leds: Move pwm-multicolor driver into rgb directory
  leds: Add PWM multicolor driver
  dt-bindings: leds: Add multicolor PWM LED bindings
  dt-bindings: leds: Optional multi-led unit address
  leds: regulator: Make probeable from device tree
  leds: regulator: Add dev helper variable
  dt-bindings: leds: Add regulator-led binding
  leds: pca9532: Make pca9532_destroy_devices() return void
  leds: Add pm8350c support to Qualcomm LPG driver
  dt-bindings: leds: Add pm8350c pmic support
  leds: Add driver for Qualcomm LPG
  dt-bindings: leds: Add Qualcomm Light Pulse Generator binding
parents f8a52af9 e98a860f
Loading
Loading
Loading
Loading
+87 −0
Original line number Diff line number Diff line
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/leds/kinetic,ktd2692.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: KTD2692 Flash LED Driver from Kinetic Technologies

maintainers:
  - Markuss Broks <markuss.broks@gmail.com>

description: |
  KTD2692 is the ideal power solution for high-power flash LEDs.
  It uses ExpressWire single-wire programming for maximum flexibility.

  The ExpressWire interface through CTRL pin can control LED on/off and
  enable/disable the IC, Movie(max 1/3 of Flash current) / Flash mode current,
  Flash timeout, LVP(low voltage protection).

  Also, When the AUX pin is pulled high while CTRL pin is high,
  LED current will be ramped up to the flash-mode current level.

properties:
  compatible:
    const: kinetic,ktd2692

  ctrl-gpios:
    maxItems: 1
    description: Specifier of the GPIO connected to CTRL pin.

  aux-gpios:
    maxItems: 1
    description: Specifier of the GPIO connected to CTRL pin.

  vin-supply:
    description: LED supply (2.7V to 5.5V).

  led:
    type: object
    $ref: common.yaml#
    description: Properties for the LED.
    properties:
      function: true
      color: true
      flash-max-timeout-us:
        description: Flash LED maximum timeout.

      led-max-microamp:
        maximum: 300000
        description: Minimum Threshold for Timer protection
          is defined internally (Maximum 300mA).

      flash-max-microamp:
        maximum: 300000
        description: Flash LED maximum current
          Formula - I(uA) = 15000000 / Rset.

    additionalProperties: false

required:
  - compatible
  - ctrl-gpios
  - led

additionalProperties: false

examples:
  - |
    #include <dt-bindings/gpio/gpio.h>
    #include <dt-bindings/leds/common.h>

    ktd2692 {
      compatible = "kinetic,ktd2692";
      ctrl-gpios = <&gpc0 1 0>;
      aux-gpios = <&gpc0 2 0>;
      vin-supply = <&vbat>;

      led {
        function = LED_FUNCTION_FLASH;
        color = <LED_COLOR_ID_WHITE>;
        flash-max-timeout-us = <250000>;
        flash-max-microamp = <150000>;
        led-max-microamp = <25000>;
      };
    };

...
+1 −1
Original line number Diff line number Diff line
@@ -20,7 +20,7 @@ description: |
  within this documentation directory.

patternProperties:
  "^multi-led@([0-9a-f])$":
  "^multi-led(@[0-9a-f])?$":
    type: object
    description: Represents the LEDs that are to be grouped.
    properties:
+0 −50
Original line number Diff line number Diff line
* Kinetic Technologies - KTD2692 Flash LED Driver

KTD2692 is the ideal power solution for high-power flash LEDs.
It uses ExpressWire single-wire programming for maximum flexibility.

The ExpressWire interface through CTRL pin can control LED on/off and
enable/disable the IC, Movie(max 1/3 of Flash current) / Flash mode current,
Flash timeout, LVP(low voltage protection).

Also, When the AUX pin is pulled high while CTRL pin is high,
LED current will be ramped up to the flash-mode current level.

Required properties:
- compatible : Should be "kinetic,ktd2692".
- ctrl-gpios : Specifier of the GPIO connected to CTRL pin.
- aux-gpios : Specifier of the GPIO connected to AUX pin.

Optional properties:
- vin-supply : "vin" LED supply (2.7V to 5.5V).
  See Documentation/devicetree/bindings/regulator/regulator.txt

A discrete LED element connected to the device must be represented by a child
node - See Documentation/devicetree/bindings/leds/common.txt

Required properties for flash LED child nodes:
  See Documentation/devicetree/bindings/leds/common.txt
- led-max-microamp : Minimum Threshold for Timer protection
  is defined internally (Maximum 300mA).
- flash-max-microamp : Flash LED maximum current
  Formula : I(mA) = 15000 / Rset.
- flash-max-timeout-us : Flash LED maximum timeout.

Optional properties for flash LED child nodes:
- label : See Documentation/devicetree/bindings/leds/common.txt

Example:

ktd2692 {
	compatible = "kinetic,ktd2692";
	ctrl-gpios = <&gpc0 1 0>;
	aux-gpios = <&gpc0 2 0>;
	vin-supply = <&vbat>;

	flash-led {
		label = "ktd2692-flash";
		led-max-microamp = <300000>;
		flash-max-microamp = <1500000>;
		flash-max-timeout-us = <1835000>;
	};
};
+79 −0
Original line number Diff line number Diff line
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/leds/leds-pwm-multicolor.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Multi-color LEDs connected to PWM

maintainers:
  - Sven Schwermer <sven.schwermer@disruptive-technologies.com>

description: |
  This driver combines several monochrome PWM LEDs into one multi-color
  LED using the multicolor LED class.

properties:
  compatible:
    const: pwm-leds-multicolor

  multi-led:
    type: object

    patternProperties:
      "^led-[0-9a-z]+$":
        type: object
        $ref: common.yaml#

        additionalProperties: false

        properties:
          pwms:
            maxItems: 1

          pwm-names: true

          color: true

        required:
          - pwms
          - color

required:
  - compatible

allOf:
  - $ref: leds-class-multicolor.yaml#

additionalProperties: false

examples:
  - |
    #include <dt-bindings/leds/common.h>

    led-controller {
        compatible = "pwm-leds-multicolor";

        multi-led {
          color = <LED_COLOR_ID_RGB>;
          function = LED_FUNCTION_INDICATOR;
          max-brightness = <65535>;

          led-red {
              pwms = <&pwm1 0 1000000>;
              color = <LED_COLOR_ID_RED>;
          };

          led-green {
              pwms = <&pwm2 0 1000000>;
              color = <LED_COLOR_ID_GREEN>;
          };

          led-blue {
              pwms = <&pwm3 0 1000000>;
              color = <LED_COLOR_ID_BLUE>;
          };
        };
    };

...
+174 −0
Original line number Diff line number Diff line
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/leds/leds-qcom-lpg.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Qualcomm Light Pulse Generator

maintainers:
  - Bjorn Andersson <bjorn.andersson@linaro.org>

description: >
  The Qualcomm Light Pulse Generator consists of three different hardware blocks;
  a ramp generator with lookup table, the light pulse generator and a three
  channel current sink. These blocks are found in a wide range of Qualcomm PMICs.

properties:
  compatible:
    enum:
      - qcom,pm8150b-lpg
      - qcom,pm8150l-lpg
      - qcom,pm8350c-pwm
      - qcom,pm8916-pwm
      - qcom,pm8941-lpg
      - qcom,pm8994-lpg
      - qcom,pmc8180c-lpg
      - qcom,pmi8994-lpg
      - qcom,pmi8998-lpg

  "#pwm-cells":
    const: 2

  "#address-cells":
    const: 1

  "#size-cells":
    const: 0

  qcom,power-source:
    $ref: /schemas/types.yaml#/definitions/uint32
    description:
      power-source used to drive the output, as defined in the datasheet.
      Should be specified if the TRILED block is present
    enum: [0, 1, 3]

  qcom,dtest:
    $ref: /schemas/types.yaml#/definitions/uint32-matrix
    description: >
      A list of integer pairs, where each pair represent the dtest line the
      particular channel should be connected to and the flags denoting how the
      value should be outputed, as defined in the datasheet. The number of
      pairs should be the same as the number of channels.
    items:
      items:
        - description: dtest line to attach
        - description: flags for the attachment

  multi-led:
    type: object
    $ref: leds-class-multicolor.yaml#
    properties:
      "#address-cells":
        const: 1

      "#size-cells":
        const: 0

    patternProperties:
      "^led@[0-9a-f]$":
        type: object
        $ref: common.yaml#

patternProperties:
  "^led@[0-9a-f]$":
    type: object
    $ref: common.yaml#

    properties:
      reg: true

    required:
      - reg

required:
  - compatible

additionalProperties: false

examples:
  - |
    #include <dt-bindings/leds/common.h>

    led-controller {
      compatible = "qcom,pmi8994-lpg";

      #address-cells = <1>;
      #size-cells = <0>;

      qcom,power-source = <1>;

      qcom,dtest = <0 0>,
                   <0 0>,
                   <0 0>,
                   <4 1>;

      led@1 {
        reg = <1>;
        color = <LED_COLOR_ID_GREEN>;
        function = LED_FUNCTION_INDICATOR;
        function-enumerator = <1>;
      };

      led@2 {
        reg = <2>;
        color = <LED_COLOR_ID_GREEN>;
        function = LED_FUNCTION_INDICATOR;
        function-enumerator = <0>;
        default-state = "on";
      };

      led@3 {
        reg = <3>;
        color = <LED_COLOR_ID_GREEN>;
        function = LED_FUNCTION_INDICATOR;
        function-enumerator = <2>;
      };

      led@4 {
        reg = <4>;
        color = <LED_COLOR_ID_GREEN>;
        function = LED_FUNCTION_INDICATOR;
        function-enumerator = <3>;
      };
    };
  - |
    #include <dt-bindings/leds/common.h>

    led-controller {
      compatible = "qcom,pmi8994-lpg";

      #address-cells = <1>;
      #size-cells = <0>;

      qcom,power-source = <1>;

      multi-led {
        color = <LED_COLOR_ID_RGB>;
        function = LED_FUNCTION_STATUS;

        #address-cells = <1>;
        #size-cells = <0>;

        led@1 {
          reg = <1>;
          color = <LED_COLOR_ID_RED>;
        };

        led@2 {
          reg = <2>;
          color = <LED_COLOR_ID_GREEN>;
        };

        led@3 {
          reg = <3>;
          color = <LED_COLOR_ID_BLUE>;
        };
      };
    };
  - |
    pwm-controller {
      compatible = "qcom,pm8916-pwm";
      #pwm-cells = <2>;
    };
...
Loading