Commit b386ef62 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull LED updates from Lee Jones:
 "This submission is a mix of new features, a number of fixes, some
  clean-up/refactoring and a few Device Tree binding updates. The most
  significant changes include new device support for the IS31FL3236A and
  QNAP's status LEDs, a number of fixes for the Qualcomm flash, LP55xx,
  MAX77705 and QNAP MCU drivers, along with some generic LED consumer
  binding documentation and unification.

  New Support & Features:
   - Add support for the IS31FL3236A LED driver, including an optional
     22kHz PWM frequency setting.
   - Add support for the red and green status LEDs on QNAP MCU devices.

  Improvements & Fixes:
   - Fix an issue in the MAX77705 driver where an error value was
     assigned but not returned.
   - Correctly update the torch current clamp setting in the Qualcomm
     flash LED driver to prevent unexpected clamping.
   - Add a separate register map for the PMI8998 to the Qualcomm flash
     LED driver to handle its unique register layout.
   - Fix the state numbering for the USB LED in the QNAP MCU driver to
     avoid command conflicts.
   - Correct the memory programming address calculation for non-paged
     devices like the LP5562 in the LP55xx driver.
   - Add Device Tree support to the generic led_get() function, allowing
     LEDs to be looked up by name.

  Cleanups & Refactoring:
   - Fix a spelling mistake in the Kconfig help text for the BD2606MVV
     driver.
   - Use devm_mutex_init() in the IS31FL319x driver to simplify code.

  Device Tree Bindings Updates:
   - Drop the redundant '-db' suffix from the IS31FL319x binding.
   - Introduce generic LED consumer bindings for referencing LEDs via
     phandles.
   - Unify the 'leds' property across several bindings to use the new
     generic consumer binding.
   - Convert the AMS AS3645A LED controller binding to the DT schema
     format"

* tag 'leds-next-6.18' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/leds:
  dt-bindings: leds: as3645: Convert to DT schema
  leds: led-class: Add Device Tree support to led_get()
  dt-bindings: leds: Unify 'leds' property
  dt-bindings: leds: Add generic LED consumer documentation
  leds: is31fl319x: Use devm_mutex_init()
  leds: leds-lp55xx: Use correct address for memory programming
  dt-bindings: leds: issi,is31fl319x: Drop 'db' suffix duplicating dtschema
  leds: qnap-mcu: Add support for the red and green status LEDs
  leds: qnap-mcu: Fix state numbering for USB LED
  leds: flash: leds-qcom-flash: Add a separate register map for PMI8998
  leds: flash: leds-qcom-flash: Update torch current clamp setting
  leds: max77705: Function return instead of variable assignment
  leds: Kconfig: Fix spelling mistake "limitiation" -> "limitation"
  leds: leds-is31fl32xx: Add support for is31fl3236a
parents b4918003 64826db1
Loading
Loading
Loading
Loading
+0 −85
Original line number Diff line number Diff line
Analog devices AS3645A device tree bindings

The AS3645A flash LED controller can drive two LEDs, one high current
flash LED and one indicator LED. The high current flash LED can be
used in torch mode as well.

Ranges below noted as [a, b] are closed ranges between a and b, i.e. a
and b are included in the range.

Please also see common.txt in the same directory.


Required properties
===================

compatible	: Must be "ams,as3645a".
reg		: The I2C address of the device. Typically 0x30.
#address-cells	: 1
#size-cells	: 0


Required properties of the flash child node (0)
===============================================

reg: 0
flash-timeout-us: Flash timeout in microseconds. The value must be in
		  the range [100000, 850000] and divisible by 50000.
flash-max-microamp: Maximum flash current in microamperes. Has to be
		    in the range between [200000, 500000] and
		    divisible by 20000.
led-max-microamp: Maximum torch (assist) current in microamperes. The
		  value must be in the range between [20000, 160000] and
		  divisible by 20000.
ams,input-max-microamp: Maximum flash controller input current. The
			value must be in the range [1250000, 2000000]
			and divisible by 50000.


Optional properties of the flash child node
===========================================

function	:  See Documentation/devicetree/bindings/leds/common.txt.
color		:  See Documentation/devicetree/bindings/leds/common.txt.
label		:  See Documentation/devicetree/bindings/leds/common.txt (deprecated).


Required properties of the indicator child node (1)
===================================================

reg: 1
led-max-microamp: Maximum indicator current. The allowed values are
		  2500, 5000, 7500 and 10000.

Optional properties of the indicator child node
===============================================

function	:  See Documentation/devicetree/bindings/leds/common.txt.
color		:  See Documentation/devicetree/bindings/leds/common.txt.
label		:  See Documentation/devicetree/bindings/leds/common.txt (deprecated).


Example
=======

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

	as3645a@30 {
		#address-cells = <1>;
		#size-cells = <0>;
		reg = <0x30>;
		compatible = "ams,as3645a";
		led@0 {
			reg = <0x0>;
			flash-timeout-us = <150000>;
			flash-max-microamp = <320000>;
			led-max-microamp = <60000>;
			ams,input-max-microamp = <1750000>;
			function = LED_FUNCTION_FLASH;
		};
		led@1 {
			reg = <0x1>;
			led-max-microamp = <10000>;
			function = LED_FUNCTION_INDICATOR;
		};
	};
+130 −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/ams,as3645a.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Analog Devices AS3645A LED Controller

maintainers:
  - Sakari Ailus <sakari.ailus@iki.fi>

description:
  The AS3645A flash LED controller can drive two LEDs, one
  high current flash LED and one indicator LED. The high
  current flash LED can be used in torch mode as well.

properties:
  compatible:
    const: ams,as3645a

  "#address-cells":
    const: 1

  "#size-cells":
    const: 0

  reg:
    maxItems: 1

  led@0:
    description: led0 describes the 'flash' feature
    type: object
    $ref: common.yaml#
    unevaluatedProperties: false

    properties:
      reg:
        const: 0

      flash-timeout-us:
        minimum: 100000
        maximum: 850000
        multipleOf: 50000

      flash-max-microamp:
        minimum: 200000
        maximum: 500000
        multipleOf: 20000

      led-max-microamp:
        minimum: 20000
        maximum: 160000
        multipleOf: 20000
        description:
          Maximum current when in torch (assist) mode.

      ams,input-max-microamp:
        minimum: 1250000
        maximum: 2000000
        multipleOf: 50000

    required:
      - reg
      - flash-timeout-us
      - flash-max-microamp
      - led-max-microamp
      - ams,input-max-microamp

  led@1:
    description: led1 describes the 'indicator' feature
    type: object
    $ref: common.yaml#
    unevaluatedProperties: false

    properties:
      reg:
        const: 1

      led-max-microamp:
        enum:
          - 2500
          - 5000
          - 7500
          - 10000
        description:
          Maximum indicator current.

    required:
      - reg
      - led-max-microamp

required:
  - compatible
  - reg
  - "#size-cells"
  - "#address-cells"

additionalProperties: false

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

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

        led-controller@30 {
            compatible = "ams,as3645a";
            #address-cells = <1>;
            #size-cells = <0>;
            reg = <0x30>;

            led@0 {
                reg = <0>;
                flash-timeout-us = <150000>;
                flash-max-microamp = <320000>;
                led-max-microamp = <60000>;
                ams,input-max-microamp = <1750000>;
                function = LED_FUNCTION_FLASH;
            };

            led@1 {
                reg = <1>;
                led-max-microamp = <10000>;
                function = LED_FUNCTION_INDICATOR;
            };
        };
    };
...
+1 −5
Original line number Diff line number Diff line
@@ -23,11 +23,7 @@ properties:
  compatible:
    const: led-backlight

  leds:
    description: A list of LED nodes
    $ref: /schemas/types.yaml#/definitions/phandle-array
    items:
      maxItems: 1
  leds: true

required:
  - compatible
+0 −1
Original line number Diff line number Diff line
@@ -42,7 +42,6 @@ properties:
    description: GPIO attached to the SDB pin.

  audio-gain-db:
    $ref: /schemas/types.yaml#/definitions/uint32
    default: 0
    description: Audio gain selection for external analog modulation input.
    enum: [0, 3, 6, 9, 12, 15, 18, 21]
+67 −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-consumer.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Common leds consumer

maintainers:
  - Aleksandrs Vinarskis <alex@vinarskis.com>

description:
  Some LED defined in DT are required by other DT consumers, for example
  v4l2 subnode may require privacy or flash LED. Unlike trigger-source
  approach which is typically used as 'soft' binding, referencing LED
  devices by phandle makes things simpler when 'hard' binding is desired.

  Document LED properties that its consumers may define.

select: true

properties:
  leds:
    oneOf:
      - type: object
      - $ref: /schemas/types.yaml#/definitions/phandle-array
        description:
          A list of LED device(s) required by a particular consumer.
        items:
          maxItems: 1

  led-names:
    description:
      A list of device name(s). Used to map LED devices to their respective
      functions, when consumer requires more than one LED.

additionalProperties: true

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

    leds {
        compatible = "gpio-leds";

        privacy_led: privacy-led {
            color = <LED_COLOR_ID_RED>;
            default-state = "off";
            function = LED_FUNCTION_INDICATOR;
            gpios = <&tlmm 110 GPIO_ACTIVE_HIGH>;
        };
    };

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

      v4l2_node: camera@36 {
        reg = <0x36>;

        leds = <&privacy_led>;
        led-names = "privacy";
      };
    };

...
Loading