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

Commit 25529ede authored by Jacek Anaszewski's avatar Jacek Anaszewski
Browse files

Merge tag 'ti-lmu-led-drivers' into for-next

Merge immutable branch between LEDs, MFD and REGULATOR due to
TI LMU LED support rework and introduction of two new drivers
with DT bindings.

* tag 'ti-lmu-led-drivers':
  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: 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
  dt-bindings: mfd: LMU: Add ti,brightness-resolution
  dt-bindings: mfd: LMU: Add the ramp up/down property
parents 09bfa5f6 11e1bbc1
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
+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";
		};
	};
};
+25 −0
Original line number Diff line number Diff line
@@ -793,6 +793,31 @@ config LEDS_SPI_BYTE
	  for controlling the brightness. Currently the following controller is
	  supported: Ubiquiti airCube ISP microcontroller based LED controller.

config LEDS_TI_LMU_COMMON
	tristate "LED driver for TI LMU"
	depends on LEDS_CLASS
	depends on REGMAP
	help
	  Say Y to enable the LED driver for TI LMU devices.
	  This supports common features between the TI LM3532, LM3631, LM3632,
	  LM3633, LM3695 and LM3697.

config LEDS_LM3697
	tristate "LED driver for LM3697"
	depends on LEDS_TI_LMU_COMMON
	depends on I2C && OF
	help
	  Say Y to enable the LM3697 LED driver for TI LMU devices.
	  This supports the LED device LM3697.

config LEDS_LM36274
	tristate "LED driver for LM36274"
	depends on LEDS_TI_LMU_COMMON
	depends on MFD_TI_LMU
	help
	  Say Y to enable the LM36274 LED driver for TI LMU devices.
	  This supports the LED device LM36274.

comment "LED Triggers"
source "drivers/leds/trigger/Kconfig"

+3 −0
Original line number Diff line number Diff line
@@ -82,6 +82,9 @@ obj-$(CONFIG_LEDS_MT6323) += leds-mt6323.o
obj-$(CONFIG_LEDS_LM3692X)		+= leds-lm3692x.o
obj-$(CONFIG_LEDS_SC27XX_BLTC)		+= leds-sc27xx-bltc.o
obj-$(CONFIG_LEDS_LM3601X)		+= leds-lm3601x.o
obj-$(CONFIG_LEDS_TI_LMU_COMMON)	+= leds-ti-lmu-common.o
obj-$(CONFIG_LEDS_LM3697)		+= leds-lm3697.o
obj-$(CONFIG_LEDS_LM36274)		+= leds-lm36274.o

# LED SPI Drivers
obj-$(CONFIG_LEDS_CR0014114)		+= leds-cr0014114.o
Loading