Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8a3367cc authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'leds-for-5.3-rc1' of...

Merge tag 'leds-for-5.3-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/j.anaszewski/linux-leds

Pull LED updates from Jacek Anaszewski:

 - Add a new LED common module for ti-lmu driver family

 - Modify MFD ti-lmu bindings
        - add ti,brightness-resolution
        - add the ramp up/down property

 - Add regulator support for LM36274 driver to lm363x-regulator.c

 - New LED class drivers with DT bindings:
        - leds-spi-byte
        - leds-lm36274
        - leds-lm3697 (move the support from MFD to LED subsystem)

 - Simplify getting the I2C adapter of a client:
        - leds-tca6507
        - leds-pca955x

 - Convert LED documentation to ReST

* tag 'leds-for-5.3-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/j.anaszewski/linux-leds:
  dt: leds-lm36274.txt: fix a broken reference to ti-lmu.txt
  docs: leds: convert to ReST
  leds: leds-tca6507: simplify getting the adapter of a client
  leds: leds-pca955x: simplify getting the adapter of a client
  leds: lm36274: Introduce the TI LM36274 LED driver
  dt-bindings: leds: Add LED bindings for the LM36274
  regulator: lm363x: Add support for LM36274
  mfd: ti-lmu: Add LM36274 support to the ti-lmu
  dt-bindings: mfd: Add lm36274 bindings to ti-lmu
  leds: max77650: Remove set but not used variable 'parent'
  leds: avoid flush_work in atomic context
  leds: lm3697: Introduce the lm3697 driver
  mfd: ti-lmu: Remove support for LM3697
  dt-bindings: ti-lmu: Modify dt bindings for the LM3697
  leds: TI LMU: Add common code for TI LMU devices
  leds: spi-byte: add single byte SPI LED driver
  dt-bindings: leds: Add binding for spi-byte LED.
  dt-bindings: mfd: LMU: Add ti,brightness-resolution
  dt-bindings: mfd: LMU: Add the ramp up/down property
parents 6e2bbb68 2605085f
Loading
Loading
Loading
Loading
+85 −0
Original line number Diff line number Diff line
* Texas Instruments LM36274 4-Channel LCD Backlight Driver w/Integrated Bias

The LM36274 is an integrated four-channel WLED driver and LCD bias supply.
The backlight boost provides the power to bias four parallel LED strings with
up to 29V total output voltage. The 11-bit LED current is programmable via
the I2C bus and/or controlled via a logic level PWM input from 60 uA to 30 mA.

Parent device properties are documented in
Documentation/devicetree/bindings/mfd/ti-lmu.txt

Regulator properties are documented in
Documentation/devicetree/bindings/regulator/lm363x-regulator.txt

Required backlight properties:
	- compatible:
		"ti,lm36274-backlight"
	- reg : 0
	- #address-cells : 1
	- #size-cells : 0
	- led-sources : Indicates which LED strings will be enabled.
			Values from 0-3, sources is 0 based so strings will be
			source value + 1.

Optional backlight properties:
	- label : see Documentation/devicetree/bindings/leds/common.txt
	- linux,default-trigger :
	   see Documentation/devicetree/bindings/leds/common.txt

Example:

HVLED string 1 and 3 are controlled by control bank A and HVLED 2 string is
controlled by control bank B.

lm36274@11 {
	compatible = "ti,lm36274";
	#address-cells = <1>;
	#size-cells = <0>;
	reg = <0x11>;

	enable-gpios = <&gpio1 28 GPIO_ACTIVE_HIGH>;

	regulators {
		#address-cells = <1>;
		#size-cells = <0>;
		compatible = "ti,lm363x-regulator";

		enable-gpios = <&pioC 0 GPIO_ACTIVE_HIGH>,
			       <&pioC 1 GPIO_ACTIVE_HIGH>;

		vboost {
			regulator-name = "lcd_boost";
			regulator-min-microvolt = <4000000>;
			regulator-max-microvolt = <7150000>;
			regulator-always-on;
		};

		vpos {
			regulator-name = "lcd_vpos";
			regulator-min-microvolt = <4000000>;
			regulator-max-microvolt = <6500000>;
		};

		vneg {
			regulator-name = "lcd_vneg";
			regulator-min-microvolt = <4000000>;
			regulator-max-microvolt = <6500000>;
		};
	};

	backlight {
		#address-cells = <1>;
		#size-cells = <0>;
		compatible = "ti,lm36274-backlight";

		led@0 {
			reg = <0>;
			led-sources = <0 2>;
			label = "white:backlight_cluster";
			linux,default-trigger = "backlight";
		};
	};
};

For more product information please see the link below:
http://www.ti.com/lit/ds/symlink/lm36274.pdf
+73 −0
Original line number Diff line number Diff line
* Texas Instruments - LM3697 Highly Efficient White LED Driver

The LM3697 11-bit LED driver provides high-
performance backlight dimming for 1, 2, or 3 series
LED strings while delivering up to 90% efficiency.

This device is suitable for display and keypad lighting

Required properties:
	- compatible:
		"ti,lm3697"
	- reg :  I2C slave address
	- #address-cells : 1
	- #size-cells : 0

Optional properties:
	- enable-gpios : GPIO pin to enable/disable the device
	- vled-supply : LED supply

Required child properties:
	- reg : 0 - LED is Controlled by bank A
		1 - LED is Controlled by bank B
	- led-sources : Indicates which HVLED string is associated to which
			control bank.  This is a zero based property so
			HVLED1 = 0, HVLED2 = 1, HVLED3 = 2.
			Additional information is contained
			in Documentation/devicetree/bindings/leds/common.txt

Optional child properties:
	- ti,brightness-resolution - see Documentation/devicetree/bindings/mfd/ti-lmu.txt
	- ramp-up-us: see Documentation/devicetree/bindings/mfd/ti-lmu.txt
	- ramp-down-us: see Documentation/devicetree/bindings/mfd/ti-lmu.txt
	- label : see Documentation/devicetree/bindings/leds/common.txt
	- linux,default-trigger :
	   see Documentation/devicetree/bindings/leds/common.txt

Example:

HVLED string 1 and 3 are controlled by control bank A and HVLED 2 string is
controlled by control bank B.

led-controller@36 {
	compatible = "ti,lm3697";
	#address-cells = <1>;
	#size-cells = <0>;
	reg = <0x36>;

	enable-gpios = <&gpio1 28 GPIO_ACTIVE_HIGH>;
	vled-supply = <&vbatt>;

	led@0 {
		reg = <0>;
		led-sources = <0 2>;
		ti,brightness-resolution = <2047>;
		ramp-up-us = <5000>;
		ramp-down-us = <1000>;
		label = "white:first_backlight_cluster";
		linux,default-trigger = "backlight";
	};

	led@1 {
		reg = <1>;
		led-sources = <1>;
		ti,brightness-resolution = <255>;
		ramp-up-us = <500>;
		ramp-down-us = <1000>;
		label = "white:second_backlight_cluster";
		linux,default-trigger = "backlight";
	};
}

For more product information please see the link below:
http://www.ti.com/lit/ds/symlink/lm3697.pdf
+44 −0
Original line number Diff line number Diff line
* Single Byte SPI LED Device Driver.

The driver can be used for controllers with a very simple SPI protocol:
- one LED is controlled by a single byte on MOSI
- the value of the byte gives the brightness between two values (lowest to
  highest)
- no return value is necessary (no MISO signal)

The value for lowest and highest brightness is dependent on the device and
therefore on the compatible string.

Depending on the compatible string some special functions (like hardware
accelerated blinking) might can be supported too.

The driver currently only supports one LED. The properties of the LED are
configured in a sub-node in the device node.

Required properties:
- compatible: should be one of
   * "ubnt,acb-spi-led"		microcontroller (SONiX 8F26E611LA) based device
				used for example in Ubiquiti airCube ISP

Property rules described in Documentation/devicetree/bindings/spi/spi-bus.txt
apply.

LED sub-node properties:
- label:
	see Documentation/devicetree/bindings/leds/common.txt
- default-state:
	see Documentation/devicetree/bindings/leds/common.txt
	Only "on" and "off" are supported.

Example:

led-controller@0 {
	compatible = "ubnt,acb-spi-led";
	reg = <0>;
	spi-max-frequency = <100000>;

	led {
		label = "white:status";
		default-state = "on";
	};
};
+67 −21
Original line number Diff line number Diff line
@@ -8,7 +8,7 @@ TI LMU driver supports lighting devices below.
  LM3632       Backlight and regulator
  LM3633       Backlight, LED and fault monitor
  LM3695       Backlight
  LM3697       Backlight and fault monitor
  LM36274      Backlight and regulator

Required properties:
  - compatible: Should be one of:
@@ -16,15 +16,32 @@ Required properties:
                "ti,lm3632"
                "ti,lm3633"
                "ti,lm3695"
                "ti,lm3697"
		"ti,lm36274"
  - reg: I2C slave address.
         0x11 for LM3632
         0x29 for LM3631
         0x36 for LM3633, LM3697
         0x36 for LM3633
         0x63 for LM3695
         0x11 for LM36274

Optional property:
Optional properties:
  - enable-gpios: A GPIO specifier for hardware enable pin.
  - ramp-up-us: Current ramping from one brightness level to
		the a higher brightness level.
		Range from 2048 us - 117.44 s
  - ramp-down-us: Current ramping from one brightness level to
		  the a lower brightness level.
		  Range from 2048 us - 117.44 s
  - ti,brightness-resolution - This determines whether to use 8 bit brightness
			       mode or 11 bit brightness mode.  If this value is
			       not set the device is defaulted to the preferred
			       8bit brightness mode per 7.3.4.1 of the data
			       sheet.  This setting can either be in the parent
			       node or as part of the LED child nodes.  This
			       is determined by the part itself if the strings
			       have a common brightness register or individual
			       brightness registers.
			       The values are 255 (8bit) or 2047 (11bit).

Required node:
  - backlight: All LMU devices have backlight child nodes.
@@ -35,14 +52,15 @@ Optional nodes:
    Required properties:
      - compatible: Should be one of:
                    "ti,lm3633-fault-monitor"
                    "ti,lm3697-fault-monitor"
  - leds: LED properties for LM3633. Please refer to [2].
	  LED properties for LM36274. Please refer to [4].
  - regulators: Regulator properties for LM3631 and LM3632.
                Please refer to [3].

[1] ../leds/backlight/ti-lmu-backlight.txt
[2] ../leds/leds-lm3633.txt
[3] ../regulator/lm363x-regulator.txt
[4] ../leds/leds-lm36274.txt

lm3631@29 {
	compatible = "ti,lm3631";
@@ -90,7 +108,7 @@ lm3631@29 {

		lcd_bl {
			led-sources = <0 1>;
			ramp-up-msec = <300>;
			ramp-up-us = <300000>;
		};
	};
};
@@ -152,15 +170,15 @@ lm3633@36 {
		main {
			label = "main_lcd";
			led-sources = <1 2>;
			ramp-up-msec = <500>;
			ramp-down-msec = <500>;
			ramp-up-us = <500000>;
			ramp-down-us = <500000>;
		};

		front {
			label = "front_lcd";
			led-sources = <0>;
			ramp-up-msec = <1000>;
			ramp-down-msec = <0>;
			ramp-up-us = <1000000>;
			ramp-down-us = <0>;
		};
	};

@@ -201,23 +219,51 @@ lm3695@63 {
	};
};

lm3697@36 {
	compatible = "ti,lm3697";
	reg = <0x36>;
lm36274@11 {
	compatible = "ti,lm36274";
	#address-cells = <1>;
	#size-cells = <0>;
	reg = <0x11>;

	enable-gpios = <&pioC 2 GPIO_ACTIVE_HIGH>;
	regulators {
		#address-cells = <1>;
		#size-cells = <0>;
		compatible = "ti,lm363x-regulator";

	backlight {
		compatible = "ti,lm3697-backlight";
		enable-gpios = <&pioC 0 GPIO_ACTIVE_HIGH>,
			       <&pioC 1 GPIO_ACTIVE_HIGH>;

		lcd {
			led-sources = <0 1 2>;
			ramp-up-msec = <200>;
			ramp-down-msec = <200>;
		vboost {
			regulator-name = "lcd_boost";
			regulator-min-microvolt = <4000000>;
			regulator-max-microvolt = <7150000>;
			regulator-always-on;
		};

		vpos {
			regulator-name = "lcd_vpos";
			regulator-min-microvolt = <4000000>;
			regulator-max-microvolt = <6500000>;
		};

	fault-monitor {
		compatible = "ti,lm3697-fault-monitor";
		vneg {
			regulator-name = "lcd_vneg";
			regulator-min-microvolt = <4000000>;
			regulator-max-microvolt = <6500000>;
		};
	};

	backlight {
		#address-cells = <1>;
		#size-cells = <0>;
		compatible = "ti,lm36274-backlight";

		led@0 {
			reg = <0>;
			led-sources = <0 2>;
			label = "white:backlight_cluster";
			linux,default-trigger = "backlight";
		};
	};
};
+2 −2
Original line number Diff line number Diff line
@@ -679,7 +679,7 @@ status as "unknown". The available commands are:
sysfs notes:

The ThinkLight sysfs interface is documented by the LED class
documentation, in Documentation/leds/leds-class.txt.  The ThinkLight LED name
documentation, in Documentation/leds/leds-class.rst.  The ThinkLight LED name
is "tpacpi::thinklight".

Due to limitations in the sysfs LED class, if the status of the ThinkLight
@@ -779,7 +779,7 @@ All of the above can be turned on and off and can be made to blink.
sysfs notes:

The ThinkPad LED sysfs interface is described in detail by the LED class
documentation, in Documentation/leds/leds-class.txt.
documentation, in Documentation/leds/leds-class.rst.

The LEDs are named (in LED ID order, from 0 to 12):
"tpacpi::power", "tpacpi:orange:batt", "tpacpi:green:batt",
Loading