Commit 431f1051 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull LED updates from Lee Jones:
 "Core Frameworks:
   - Add support for a bunch more colours

  New Drivers:
   - Add support for Kinetic KTD2026/7 RGB/White LEDs

  New Functionality:
   - Add support for device to enter HW Controlled Mode to Turris Omnia
     LEDs
   - Add support for HW Gamma Correction to Turris Omnia LEDs

  Fix-ups:
   - Apply new __counted_by() annotation to several data structures
     containing flexible arrays
   - Rid the return value from Platform's .remove() operation
   - Use *_cansleep() variants for instances were threads can sleep
   - Improve the semantics when setting the brightness
   - Generic clean-ups; code reduction, coding style, standard patterns
   - Replace strncpy() with strscpy()
   - Fix-up / add various documentation
   - Re-author the GPIO associated Trigger to use trigger-sources
   - Move to using standard APIs and helpers
   - Improve error checking
   - Stop using static GPIO bases

  Bug Fixes:
   - Fix Pointer to Enum casing warnings
   - Do not pretend that I2C backed device supports SMBUS
   - Ensure PWM LEDs are extinguished when disabled, rather than held in
     a state
   - Fix 'output may be truncated' warnings"

* tag 'leds-next-6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/leds: (43 commits)
  leds: lp5521: Add an error check in lp5521_post_init_device
  leds: gpio: Update headers
  leds: gpio: Remove unneeded assignment
  leds: gpio: Move temporary variable for struct device to gpio_led_probe()
  leds: gpio: Refactor code to use devm_gpiod_get_index_optional()
  leds: gpio: Utilise PTR_ERR_OR_ZERO()
  leds: gpio: Keep driver firmware interface agnostic
  leds: core: Refactor led_update_brightness() to use standard pattern
  leds: turris-omnia: Fix brightness setting and trigger activating
  leds: sc27xx: Move mutex_init() down
  leds: trigger: netdev: Move size check in set_device_name
  leds: Add ktd202x driver
  dt-bindings: leds: Add Kinetic KTD2026/2027 LED
  leds: core: Add more colors from DT bindings to led_colors
  dt-bindings: leds: Last color ID is now 14 (LED_COLOR_ID_LIME)
  leds: tca6507: Don't use fixed GPIO base
  leds: lp3952: Convert to use maple tree register cache
  leds: lm392x: Convert to use maple tree register cache
  leds: aw200xx: Convert to use maple tree register cache
  leds: lm3601x: Convert to use maple tree register cache
  ...
parents 38984d78 b9604be2
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -12,3 +12,17 @@ Description: (RW) On the front panel of the Turris Omnia router there is also
		able to change this setting from software.

		Format: %i

What:		/sys/class/leds/<led>/device/gamma_correction
Date:		August 2023
KernelVersion:	6.6
Contact:	Marek Behún <kabel@kernel.org>
Description:	(RW) Newer versions of the microcontroller firmware of the
		Turris Omnia router support gamma correction for the RGB LEDs.
		This feature can be enabled/disabled by writing to this file.

		If the feature is not supported because the MCU firmware is too
		old, the file always reads as 0, and writing to the file results
		in the EOPNOTSUPP error.

		Format: %i
+3 −1
Original line number Diff line number Diff line
@@ -43,7 +43,7 @@ properties:
      LED_COLOR_ID available, add a new one.
    $ref: /schemas/types.yaml#/definitions/uint32
    minimum: 0
    maximum: 9
    maximum: 14

  function-enumerator:
    description:
@@ -191,6 +191,8 @@ properties:
      each of them having its own LED assigned (assuming they are not
      hardwired). In such cases this property should contain phandle(s) of
      related source device(s).
      Another example is a GPIO line that will be monitored and mirror the
      state of the line (with or without inversion flags) to the LED.
      In many cases LED can be related to more than one device (e.g. one USB LED
      vs. multiple USB ports). Each source should be represented by a node in
      the device tree and be referenced by a phandle and a set of phandle
+171 −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,ktd202x.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Kinetic KTD2026/7 RGB/White LED Driver

maintainers:
  - André Apitzsch <git@apitzsch.eu>

description: |
  The KTD2026/7 is a RGB/White LED driver with I2C interface.

  The data sheet can be found at:
    https://www.kinet-ic.com/uploads/KTD2026-7-04h.pdf

properties:
  compatible:
    enum:
      - kinetic,ktd2026
      - kinetic,ktd2027

  reg:
    maxItems: 1

  vin-supply:
    description: Regulator providing power to the "VIN" pin.

  vio-supply:
    description: Regulator providing power for pull-up of the I/O lines.
      Note that this regulator does not directly connect to KTD2026, but is
      needed for the correct operation of the status ("ST") and I2C lines.

  "#address-cells":
    const: 1

  "#size-cells":
    const: 0

  multi-led:
    type: object
    $ref: leds-class-multicolor.yaml#
    unevaluatedProperties: false

    properties:
      "#address-cells":
        const: 1

      "#size-cells":
        const: 0

    patternProperties:
      "^led@[0-3]$":
        type: object
        $ref: common.yaml#
        unevaluatedProperties: false

        properties:
          reg:
            description: Index of the LED.
            minimum: 0
            maximum: 3

        required:
          - reg
          - color

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

patternProperties:
  "^led@[0-3]$":
    type: object
    $ref: common.yaml#
    unevaluatedProperties: false

    properties:
      reg:
        description: Index of the LED.
        minimum: 0
        maximum: 3

    required:
      - reg

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

additionalProperties: false

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

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

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

            vin-supply = <&pm8916_l17>;
            vio-supply = <&pm8916_l6>;

            led@0 {
                reg = <0>;
                function = LED_FUNCTION_STATUS;
                color = <LED_COLOR_ID_RED>;
            };

            led@1 {
                reg = <1>;
                function = LED_FUNCTION_STATUS;
                color = <LED_COLOR_ID_GREEN>;
            };

            led@2 {
                reg = <2>;
                function = LED_FUNCTION_STATUS;
                color = <LED_COLOR_ID_BLUE>;
            };
        };
    };
  - |
    #include <dt-bindings/leds/common.h>

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

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

            vin-supply = <&pm8916_l17>;
            vio-supply = <&pm8916_l6>;

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

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

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

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

                led@2 {
                    reg = <2>;
                    color = <LED_COLOR_ID_BLUE>;
                };
            };
        };
    };
+1 −0
Original line number Diff line number Diff line
@@ -187,6 +187,7 @@ config LEDS_TURRIS_OMNIA
	depends on I2C
	depends on MACH_ARMADA_38X || COMPILE_TEST
	depends on OF
	select LEDS_TRIGGERS
	help
	  This option enables basic support for the LEDs found on the front
	  side of CZ.NIC's Turris Omnia router. There are 12 RGB LEDs on the
+2 −4
Original line number Diff line number Diff line
@@ -837,7 +837,7 @@ static int intel_sso_led_probe(struct platform_device *pdev)
	return 0;
}

static int intel_sso_led_remove(struct platform_device *pdev)
static void intel_sso_led_remove(struct platform_device *pdev)
{
	struct sso_led_priv *priv;
	struct sso_led *led, *n;
@@ -850,8 +850,6 @@ static int intel_sso_led_remove(struct platform_device *pdev)
	}

	regmap_exit(priv->mmap);

	return 0;
}

static const struct of_device_id of_sso_led_match[] = {
@@ -863,7 +861,7 @@ MODULE_DEVICE_TABLE(of, of_sso_led_match);

static struct platform_driver intel_sso_led_driver = {
	.probe		= intel_sso_led_probe,
	.remove		= intel_sso_led_remove,
	.remove_new	= intel_sso_led_remove,
	.driver		= {
			.name = "lgm-ssoled",
			.of_match_table = of_sso_led_match,
Loading