Skip to contentSkip to conversation

Support TI LMU devices

PATCH Superseded Milo Kim 2 participants 20 messages Nov 2, 2015 – Nov 3, 2015

Subsystems (7)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Milo Kim

author
#0 lore raw

cover Support TI LMU devices

TI LMU(Lighting Management Unit) driver supports lighting devices below.

         Enable pin  Backlights  HWMON  LEDs   Regulators
         ----------  ----------  -----  ----  ------------
LM3532       o           o         x     x        x
LM3631       o           o         x     x    5 regulators
LM3632       o           o         x     x    3 regulators
LM3633       o           o         o     o        x
LM3695       o           o         x     x        x
LM3697       o           o         o     x        x

This patch-set consists of several parts below.

DT bindings : Binding information for each module
TI LMU MFD : Device registration, HW enable pin control and
I2C register access
TI LMU backlight : Common driver for TI LMU backlight devices
Each backlight driver : Chip dependent code
HWMON : LMU hardware fault monitoring driver
LM3633 LED : LED subsystem and dimming pattern generation
supported
LM363X regulator : LM3631 and LM3632 regulator driver for the
display bias

Git location:
Please refer to the location below. Branch name is 'ti-lmu'. git clone -b ti-lmu https://github.com/milokim/linux.git

Milo Kim (16):
Documentation: dt-bindings: mfd: add TI LMU device binding information
Documentation: dt-bindings: backlight: add TI LMU backlight binding
information
Documentation: dt-bindings: hwmon: add TI LMU HWMON binding
information
Documentation: dt-bindings: leds: add LM3633 LED binding information
Documentation: dt-bindings: regulator: add LM363x regulator binding
information
mfd: add TI LMU driver
backlight: add TI LMU backlight common driver
backlight: ti-lmu-backlight: add LM3532 driver
backlight: ti-lmu-backlight: add LM3631 driver
backlight: ti-lmu-backlight: add LM3632 driver
backlight: ti-lmu-backlight: add LM3633 driver
backlight: ti-lmu-backlight: add LM3695 driver
backlight: ti-lmu-backlight: add LM3697 driver
hwmon: add TI LMU hardware fault monitoring driver
leds: add LM3633 driver
regulator: add LM363X driver

 Documentation/ABI/testing/sysfs-class-led-lm3633   |  60 ++
 .../devicetree/bindings/hwmon/ti-lmu-hwmon.txt     |  12 +
 .../devicetree/bindings/leds/leds-lm3633.txt       |  28 +
 Documentation/devicetree/bindings/mfd/ti-lmu.txt   | 282 ++++++++
 .../bindings/regulator/lm363x-regulator.txt        |  28 +
 .../bindings/video/backlight/ti-lmu-backlight.txt  |  67 ++
 drivers/hwmon/Kconfig                              |  10 +
 drivers/hwmon/Makefile                             |   1 +
 drivers/hwmon/ti-lmu-hwmon.c                       | 393 +++++++++++
 drivers/leds/Kconfig                               |  10 +
 drivers/leds/Makefile                              |   1 +
 drivers/leds/leds-lm3633.c                         | 749 +++++++++++++++++++++
 drivers/mfd/Kconfig                                |  12 +
 drivers/mfd/Makefile                               |   1 +
 drivers/mfd/ti-lmu.c                               | 324 +++++++++
 drivers/regulator/Kconfig                          |   9 +
 drivers/regulator/Makefile                         |   1 +
 drivers/regulator/lm363x-regulator.c               | 349 ++++++++++
 drivers/video/backlight/Kconfig                    |  62 ++
 drivers/video/backlight/Makefile                   |   7 +
 drivers/video/backlight/lm3532_bl.c                | 183 +++++
 drivers/video/backlight/lm3631_bl.c                | 129 ++++
 drivers/video/backlight/lm3632_bl.c                | 125 ++++
 drivers/video/backlight/lm3633_bl.c                | 210 ++++++
 drivers/video/backlight/lm3695_bl.c                |  91 +++
 drivers/video/backlight/lm3697_bl.c                | 187 +++++
 drivers/video/backlight/ti-lmu-backlight.c         | 429 ++++++++++++
 drivers/video/backlight/ti-lmu-backlight.h         | 152 +++++
 include/linux/mfd/ti-lmu-register.h                | 277 ++++++++
 include/linux/mfd/ti-lmu.h                         |  81 +++
 30 files changed, 4270 insertions(+)
 create mode 100644 Documentation/ABI/testing/sysfs-class-led-lm3633
 create mode 100644 Documentation/devicetree/bindings/hwmon/ti-lmu-hwmon.txt
 create mode 100644 Documentation/devicetree/bindings/leds/leds-lm3633.txt
 create mode 100644 Documentation/devicetree/bindings/mfd/ti-lmu.txt
 create mode 100644 Documentation/devicetree/bindings/regulator/lm363x-regulator.txt
 create mode 100644 Documentation/devicetree/bindings/video/backlight/ti-lmu-backlight.txt
 create mode 100644 drivers/hwmon/ti-lmu-hwmon.c
 create mode 100644 drivers/leds/leds-lm3633.c
 create mode 100644 drivers/mfd/ti-lmu.c
 create mode 100644 drivers/regulator/lm363x-regulator.c
 create mode 100644 drivers/video/backlight/lm3532_bl.c
 create mode 100644 drivers/video/backlight/lm3631_bl.c
 create mode 100644 drivers/video/backlight/lm3632_bl.c
 create mode 100644 drivers/video/backlight/lm3633_bl.c
 create mode 100644 drivers/video/backlight/lm3695_bl.c
 create mode 100644 drivers/video/backlight/lm3697_bl.c
 create mode 100644 drivers/video/backlight/ti-lmu-backlight.c
 create mode 100644 drivers/video/backlight/ti-lmu-backlight.h
 create mode 100644 include/linux/mfd/ti-lmu-register.h
 create mode 100644 include/linux/mfd/ti-lmu.h
Signature · 1 line
1.9.1
author
#1 lore raw

PATCH 1/16 Documentation: dt-bindings: mfd: add TI LMU device binding information

This patch describes overall binding for TI LMU MFD devices.

---
 Documentation/devicetree/bindings/mfd/ti-lmu.txt | 282 +++++++++++++++++++++++
 1 file changed, 282 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/mfd/ti-lmu.txt
Documentation/devicetree/bindings/mfd/ti-lmu.txt new file +282 -0
new file mode 100644
index 0000000..7ccf07e
@@ -0,0 +1,282 @@
+TI LMU(Lighting Management Unit) device tree bindings
+
+TI LMU driver supports lighting devices belows.
+
+   Name              Child nodes
+  ------      -------------------------
+  LM3532       Backlight
+  LM3631       Backlight and regulator
+  LM3632       Backlight and regulator
+  LM3633       Backlight, LED and HWMON
+  LM3695       Backlight
+  LM3697       Backlight and HWMON
+
+Required properties:
+  - compatible: Should be one of lists below.
+                "ti,lm3532"
+                "ti,lm3631"
+                "ti,lm3632"
+                "ti,lm3633"
+                "ti,lm3695"
+                "ti,lm3697"
+  - reg: I2C slave address.
+         0x11 is LM3632
+         0x29 is LM3631
+         0x36 is LM3633, LM3697
+         0x38 is LM3532
+         0x63 is LM3695
+
+Optional properties:
+  - enable-gpios: A GPIO specifier for hardware enable pin.
+
+Required node:
+  - backlight: All LMU devices have backlight child nodes.
+               For the properties, please refer to [1].
+
+Optional nodes:
+  - hwmon: Hardware fault monitoring driver for LM3633 and LM3697.
+           For the property, please refer to [2].
+  - leds: LED properties for LM3633. Please refer to [3].
+  - regulators: Regulator properties for LM3631 and LM3632.
+          Please refer to [4].
+
+[1] Documentation/devicetree/bindings/video/backlight/ti-lmu-backlight.txt
+[2] Documentation/devicetree/bindings/hwm/ti-lmu-hwmon.txt
+[3] Documentation/devicetree/bindings/leds/leds-lm3633.txt
+[4] Documentation/devicetree/bindings/regulator/lm363x-regulator.txt
+
+Examples:
+
+LM3532 has a backlight device. External GPIO is used for enabling LM3532.
+
+lm3532@38 {
+	compatible = "ti,lm3532";
+	reg = <0x38>;
+
+	enable-gpios = <&pioC 2 GPIO_ACTIVE_HIGH>;
+
+	backlight {
+		compatible = "ti,lm3532-backlight";
+
+		lcd {
+			hvled1-used;
+			hvled2-used;
+			hvled3-used;
+
+			ramp-up-msec = <30>;
+			ramp-down-msec = <0>;
+
+			backlight-max-microamp = <5000>;
+		};
+	};
+};
+
+LM3631 has 5 regulators with one backlight device.
+
+lm3631@29 {
+	compatible = "ti,lm3631";
+	reg = <0x29>;
+
+	regulators {
+		compatible = "ti,lm363x-regulator";
+
+		vboost {
+			regulator-name = "lcd_boost";
+			regulator-min-microvolt = <4500000>;
+			regulator-max-microvolt = <6350000>;
+			regulator-always-on;
+		};
+
+		vcont {
+			regulator-name = "lcd_vcont";
+			regulator-min-microvolt = <1800000>;
+			regulator-max-microvolt = <3300000>;
+		};
+
+		voref {
+			regulator-name = "lcd_voref";
+			regulator-min-microvolt = <4000000>;
+			regulator-max-microvolt = <6000000>;
+		};
+
+		vpos {
+			regulator-name = "lcd_vpos";
+			regulator-min-microvolt = <4000000>;
+			regulator-max-microvolt = <6000000>;
+			regulator-boot-on;
+		};
+
+		vneg {
+			regulator-name = "lcd_vneg";
+			regulator-min-microvolt = <4000000>;
+			regulator-max-microvolt = <6000000>;
+			regulator-boot-on;
+		};
+	};
+
+	backlight {
+		compatible = "ti,lm3631-backlight";
+
+		lcd {
+			backlight-name = "lcd_bl";
+			hvled1-used;
+			hvled2-used;
+
+			ramp-up-msec = <300>;
+		};
+	};
+};
+
+LM3632 has 3 regulators with one backlight device. External GPIO is
+used for enabling LM3632.
+
+lm3632@11 {
+	compatible = "ti,lm3632";
+	reg = <0x11>;
+
+	enable-gpios = <&pioC 2 GPIO_ACTIVE_HIGH>;
+
+	regulators {
+		compatible = "ti,lm363x-regulator";
+
+		ti,lcm-en1-gpio = <&pioC 0 GPIO_ACTIVE_HIGH>;
+		ti,lcm-en2-gpio = <&pioC 1 GPIO_ACTIVE_HIGH>;
+
+		vboost {
+			regulator-name = "lcd_boost";
+			regulator-min-microvolt = <4500000>;
+			regulator-max-microvolt = <6400000>;
+			regulator-always-on;
+		};
+
+		vpos {
+			regulator-name = "lcd_vpos";
+			regulator-min-microvolt = <4000000>;
+			regulator-max-microvolt = <6000000>;
+		};
+
+		vneg {
+			regulator-name = "lcd_vneg";
+			regulator-min-microvolt = <4000000>;
+			regulator-max-microvolt = <6000000>;
+		};
+	};
+
+	backlight {
+		compatible = "ti,lm3632-backlight";
+
+		lcd {
+			backlight-name = "lcd";
+			hvled1-used;
+			hvled2-used;
+		};
+	};
+};
+
+LM3633 has multiple backlight channels, LED channels and hardware fault
+monitoring driver. External GPIO is used for enabling LM3633.
+
+lm3633@36 {
+	compatible = "ti,lm3633";
+	reg = <0x36>;
+
+	enable-gpios = <&pioC 2 GPIO_ACTIVE_HIGH>;
+
+	backlight {
+		compatible = "ti,lm3633-backlight";
+
+		pwms = <&pwm0 0 10000 0>; /* pwm number, period, polarity */
+		pwm-names = "lmu-backlight";
+
+		main {
+			backlight-name = "main_lcd";
+			hvled2-used;
+			hvled3-used;
+			backlight-max-microamp = <20000>;
+
+			ramp-up-msec = <500>;
+			ramp-down-msec = <500>;
+		};
+
+		front {
+			backlight-name = "front_lcd";
+			hvled1-used;
+
+			ramp-up-msec = <1000>;
+			ramp-down-msec = <0>;
+
+			pwm-period = <10000>;
+		};
+	};
+
+	leds {
+		compatible = "ti,lm3633-leds";
+
+		chan2 {
+			channel-name = "status";
+			lvled2-used;
+			led-max-microamp = <6000>;
+		};
+
+		chan456 {
+			channel-name = "rgb";
+			lvled4-used;
+			lvled5-used;
+			lvled6-used;
+		};
+	};
+
+	hwmon {
+		compatible = "ti,lm3633-hwmon";
+	};
+};
+
+LM3695 is single backlight device.
+
+lm3695@63 {
+	compatible = "ti,lm3695";
+	reg = <0x63>;
+
+	backlight {
+		compatible = "ti,lm3695-backlight";
+
+		lcd {
+			hvled1-used;
+			hvled2-used;
+			backlight-max-microamp = <20000>;
+		};
+	};
+};
+
+LM3697 has one backlight device and hardware fault monitoring driver.
+External GPIO is used for enabling LM3697.
+
+lm3697@36 {
+	compatible = "ti,lm3697";
+	reg = <0x36>;
+
+	enable-gpios = <&pioC 2 GPIO_ACTIVE_HIGH>;
+
+	backlight {
+		compatible = "ti,lm3697-backlight";
+
+		pwms = <&pwm0 0 10000 0>; /* pwm number, period, polarity */
+		pwm-names = "lmu-backlight";
+
+		lcd {
+			backlight-name = "bl";
+			hvled1-used;
+			hvled2-used;
+			hvled3-used;
+			backlight-max-microamp = <20000>;
+
+			ramp-up-msec = <500>;
+			ramp-down-msec = <500>;
+			pwm-period = <10000>;
+		};
+	};
+
+	hwmon {
+		compatible = "ti,lm3697-hwmon";
+	};
+};
Signature · 1 line
1.9.1
author
#2 lore raw

PATCH 2/16 Documentation: dt-bindings: backlight: add TI LMU backlight binding information

LM3532, LM3631, LM3632, LM3633, LM3695 and LM3697 use common dt-bindings for describing device.

---
 .../bindings/video/backlight/ti-lmu-backlight.txt  | 67 ++++++++++++++++++++++
 1 file changed, 67 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/video/backlight/ti-lmu-backlight.txt
Documentation/devicetree/bindings/video/backlight/ti-lmu-backlight.txt new file +67 -0
new file mode 100644
index 0000000..27b0036
@@ -0,0 +1,67 @@
+TI LMU backlight device tree bindings
+
+Required properties:
+  - compatible: Should be one of lists below.
+                "ti,lm3532-backlight"
+                "ti,lm3631-backlight"
+                "ti,lm3632-backlight"
+                "ti,lm3633-backlight"
+                "ti,lm3695-backlight"
+                "ti,lm3697-backlight"
+
+Optional properties:
+  There are two backlight control mode. One is I2C, the other is PWM mode.
+  Following properties are only specified in PWM mode.
+  Please note that LMU backlight device can have only one PWM channel.
+
+  - pwms: OF device-tree PWM specification.
+  - pwm-names: a list of names for the PWM devices specified in the "pwms"
+               property.
+
+  For the PWM user nodes, please refer to [1].
+
+Child nodes:
+  LMU backlight is represented as sub-nodes of the TI LMU device [2].
+  So, LMU backlight should have more than one backlight child node.
+  Each node exactly matches with backlight control bank configuration.
+  Maximum numbers of child nodes depend on the device.
+  1 = LM3631, LM3632, LM3695
+  2 = LM3633, LM3697
+  3 = LM3532
+
+  Required property of a child node:
+  - hvled1-used, hvled2-used, hvled3-used:
+    High voltage backlight strings configuration. Type is <boolean>.
+    Please describe which output backlight string is used.
+    Please refer to the datasheets [3].
+
+  Optional properties of a child node:
+  - backlight-name: Name string for backlight device identification.
+                    It is used for creating backlight sysfs,
+                    /sys/class/backlight/<backlight-name>/.
+  - backlight-max-microamp: Max current setting. Type is <u32>.
+                            Unit is microampere.
+                            Range is from 5000 to 30000.
+  - initial-brightness: Backlight initial brightness value. Type is <u32>.
+                        It is set as soon as backlight device is created.
+                        0 ~ 2047 = LM3631, LM3632, LM3633, LM3695 and LM3697
+                        0 ~ 255  = LM3532
+  - ramp-up-msec, ramp-down-msec: Light dimming effect properties.
+                                  Type is <u32>. Unit is millisecond.
+                                  0 ~ 65 msec    = LM3532
+                                  0 ~ 4000 msec  = LM3631
+                                  0 ~ 16000 msec = LM3633 and LM3697
+  - pwm-period: PWM period. Only valid in PWM brightness mode.
+                Type is <u32>. If this property is missing, then control
+                mode is set to I2C by default.
+
+Examples: Please refer to ti-lmu dt-bindings. [2].
+
+[1] Documentation/devicetree/bindings/pwm/pwm.txt
+[2] Documentation/devicetree/bindings/mfd/ti-lmu.txt
+[3] LM3532: http://www.ti.com/product/LM3532/datasheet
+    LM3631: http://www.ti.com/product/LM3631/datasheet
+    LM3632: http://www.ti.com/product/LM3632A/datasheet
+    LM3633: http://www.ti.com/product/LM3633/datasheet
+    LM3695: Datasheet is not opened yet, but only two strings are used.
+    LM3697: http://www.ti.com/product/LM3697/datasheet
Signature · 1 line
1.9.1
author
#3 lore raw

PATCH 3/16 Documentation: dt-bindings: hwmon: add TI LMU HWMON binding information

Hardware fault monitoring driver is used in LM3633 and LM3697 device. Just 'compatible' property is required to describe the driver.

---
 Documentation/devicetree/bindings/hwmon/ti-lmu-hwmon.txt | 12 ++++++++++++
 1 file changed, 12 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/hwmon/ti-lmu-hwmon.txt
Documentation/devicetree/bindings/hwmon/ti-lmu-hwmon.txt new file +12 -0
new file mode 100644
index 0000000..99cb241
@@ -0,0 +1,12 @@
+TI LMU Hardware Monotoring device tree bindings
+
+LMU HWON driver monitors hardware fault situation of LMU devices,
+LM3633 and LM3697.
+
+Required properties:
+  - compatible: Should be one of lists below.
+                "ti,lm3633-hwmon"
+                "ti,lm3697-hwmon"
+
+Examples: Please refer to ti-lmu dt-bindings.
+          Documentation/devicetree/bindings/mfd/ti-lmu.txt
Signature · 1 line
1.9.1
author
#4 lore raw

PATCH 4/16 Documentation: dt-bindings: leds: add LM3633 LED binding information

LM3633 LED device is one of TI LMU device list.

---
 .../devicetree/bindings/leds/leds-lm3633.txt       | 28 ++++++++++++++++++++++
 1 file changed, 28 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/leds/leds-lm3633.txt
Documentation/devicetree/bindings/leds/leds-lm3633.txt new file +28 -0
new file mode 100644
index 0000000..bb7f213
@@ -0,0 +1,28 @@
+TI LMU LM3633 LED device tree bindings
+
+Required properties:
+  - compatible: "ti,lm3633-leds"
+
+Child nodes:
+  Each node matches with LED control bank.
+  Please refer to the datasheet [1].
+
+  Required properties of a child node:
+  - lvled1-used, lvled2-used, lvled3-used,
+    lvled4-used, lvled5-used, lvled6-used:
+    Low voltage LED string configuration. Type is <boolean>.
+    Please describe which output LED string is used.
+
+  Optional properties of a child node:
+  - channel-name: Name string for LED channel identification
+                  It is used for creating LED sysfs,
+                  /sys/class/leds/<channel-name>/.
+                  If this property is empty, then default name is set to
+                  "indicator:<id>" by the driver.
+  - led-max-microamp: Max current setting. Type is <u32>.
+                      Unit is microampere. Range is from 5000 to 30000.
+
+Examples: Please refer to ti-lmu dt-bindings [2].
+
+[1] http://www.ti.com/product/LM3633/datasheet
+[2] Documentation/devicetree/bindings/mfd/ti-lmu.txt
Signature · 1 line
1.9.1
author
#5 lore raw

PATCH 5/16 Documentation: dt-bindings: regulator: add LM363x regulator binding information

This binding supports LM3631 and LM3632 regulator configuration.

---
 .../bindings/regulator/lm363x-regulator.txt        | 28 ++++++++++++++++++++++
 1 file changed, 28 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/regulator/lm363x-regulator.txt
Documentation/devicetree/bindings/regulator/lm363x-regulator.txt new file +28 -0
new file mode 100644
index 0000000..597716f
@@ -0,0 +1,28 @@
+TI LMU LM363x regulator device tree bindings
+
+LM363x regulator driver supports LM3631 and LM3632.
+LM3631 has five regulators and LM3632 supports three regulators.
+
+Required properties:
+  - compatible: "ti,lm363x-regulator"
+
+Child nodes:
+  LM3631
+  - vboost
+  - vcont
+  - voref
+  - vpos
+  - vneg
+
+  LM3632
+  - vboost
+  - vpos
+  - vneg
+
+  Optional properties of each node:
+  Please refer to [1].
+
+Examples: Please refer to ti-lmu dt-bindings [2].
+
+[1] Documentation/devicetree/bindings/regulator/regulator.txt
+[2] Documentation/devicetree/bindings/mfd/ti-lmu.txt
Signature · 1 line
1.9.1
author
#6 lore raw

PATCH 6/16 mfd: add TI LMU driver

TI LMU(Lighting Management Unit) driver supports lighting devices below.

LM3532, LM3631, LM3632, LM3633, LM3695 and LM3697.

LMU devices have common features.
- I2C interface for accessing device registers
- Hardware enable pin control
- Backlight brightness control
- Max current conversion helper function
- Notifier for hardware fault monitoring
- Regulators for LCD display bias

It contains backlight, HWMON, LED and regulator driver.

Backlight
---------
It's handled by TI LMU backlight common driver and chip dependent driver. Please refer to separate patches for ti-lmu-backlight.

HWMON
-----
LM3633 and LM3697 provide hardware monitoring feature. It enables opened or shorted circuit detection.
After monitoring is done, each device should be re-initialized. Notifier is used for this case.
Please refer to separate patch for ti-lmu-hwmon.

LED indicator
-------------
LM3633 has 6 indicator LEDs. Programmable pattern is also supported. Please refer to separate patch for leds-lm3633.

Regulator
---------
LM3631 has 5 regulators for the display bias.
LM3632 supports 3 regulators. One consolidated driver enables it. Please refer to separate patch for lm363x-regulator.

---
 drivers/mfd/Kconfig                 |  12 ++
 drivers/mfd/Makefile                |   1 +
 drivers/mfd/ti-lmu.c                | 324 ++++++++++++++++++++++++++++++++++++
 include/linux/mfd/ti-lmu-register.h | 277 ++++++++++++++++++++++++++++++
 include/linux/mfd/ti-lmu.h          |  81 +++++++++
 5 files changed, 695 insertions(+)
 create mode 100644 drivers/mfd/ti-lmu.c
 create mode 100644 include/linux/mfd/ti-lmu-register.h
 create mode 100644 include/linux/mfd/ti-lmu.h
drivers/mfd/Kconfig +12 -0
index 99d6367..a53a38e 100644
@@ -1037,6 +1037,18 @@ config MFD_LP8788
 	  TI LP8788 PMU supports regulators, battery charger, RTC,
 	  ADC, backlight driver and current sinks.
 
+config MFD_TI_LMU
+	tristate "TI Lighting Management Unit driver"
+	depends on I2C
+	select MFD_CORE
+	select REGMAP_I2C
+	help
+	  Say yes here to enable support for TI LMU chips.
+
+	  TI LMU MFD supports LM3532, LM3631, LM3632, LM3633, LM3695 and LM3697.
+	  It consists of backlight, hwmon, LED and regulator driver.
+	  It provides consistent device controls for lighting functions.
+
 config MFD_OMAP_USB_HOST
 	bool "TI OMAP USBHS core and TLL driver"
 	depends on USB_EHCI_HCD_OMAP || USB_OHCI_HCD_OMAP3
drivers/mfd/Makefile +1 -0
index a59e3fc..32920f8 100644
@@ -110,6 +110,7 @@ obj-$(CONFIG_MFD_AXP20X)	+= axp20x.o
 
 obj-$(CONFIG_MFD_LP3943)	+= lp3943.o
 obj-$(CONFIG_MFD_LP8788)	+= lp8788.o lp8788-irq.o
+obj-$(CONFIG_MFD_TI_LMU)	+= ti-lmu.o
 
 da9055-objs			:= da9055-core.o da9055-i2c.o
 obj-$(CONFIG_MFD_DA9055)	+= da9055.o
drivers/mfd/ti-lmu.c new file +324 -0

324 lines not on this page · raw message

include/linux/mfd/ti-lmu-register.h new file +277 -0

277 lines not on this page · raw message

include/linux/mfd/ti-lmu.h new file +81 -0

81 lines not on this page · raw message

Signature · 1 line
1.9.1
author
#7 lore raw

PATCH 7/16 backlight: add TI LMU backlight common driver

TI LMU backlight driver provides common driver features.
Chip specific configuration is handled by each backlight driver such like LM3532, LM3631, LM3632, LM3633, LM3695 and LM3697.

It supports common features as below.
- Backlight subsystem control
- Consistent device control flow
- Control bank assignment
- HWMON notifier handling
- PWM brightness control
- Shared device tree node

Operation
---------
Each LMU backlight driver uses two macros for device registration. TI_LMU_BL_OF_DEVICE() and TI_LMU_BL_PLATFORM_DRIVER().

(Common driver code) (Chip dependent code)

Define device operations, 'ti_lmu_bl_ops' : init, configure, update brightness,
enable, max brightness, light effect and LMU HWMON event option

_probe()
register backlight
parsing the device tree
create data from the DT
init -> init()
configure -> configure()
add backlight device

Helper
convert ramp time value to
register index

Update brightness

    pwm mode
    I2C mode			-> enable(), update_brightness()

LMU HWMON event handling -> check 'hwmon_notifier_used'

    reinitialize device		-> init(), configure()

_remove()
unregister notifier if used
turn off the backlight

Data structure
--------------
ti_lmu_bl_ops: Configure device specific operation and option.
ti_lmu_bl_chip: Backlight device data.
ti_lmu_bl: Backlight output channel data.
One backlight device can have multiple backlight channels.

---
 drivers/video/backlight/Kconfig            |   9 +
 drivers/video/backlight/Makefile           |   1 +
 drivers/video/backlight/ti-lmu-backlight.c | 429 +++++++++++++++++++++++++++++
 drivers/video/backlight/ti-lmu-backlight.h | 152 ++++++++++
 4 files changed, 591 insertions(+)
 create mode 100644 drivers/video/backlight/ti-lmu-backlight.c
 create mode 100644 drivers/video/backlight/ti-lmu-backlight.h
drivers/video/backlight/Kconfig +9 -0
index 5ffa4b4..f26eb1c 100644
@@ -390,6 +390,15 @@ config BACKLIGHT_LM3639
 	help
 	  This supports TI LM3639 Backlight + 1.5A Flash LED Driver
 
+config TI_LMU_BACKLIGHT
+	tristate "Backlight driver for TI LMU"
+	depends on BACKLIGHT_LM3532 || BACKLIGHT_LM3631 || \
+		   BACKLIGHT_LM3632 || BACKLIGHT_LM3633 || \
+		   BACKLIGHT_LM3695 || BACKLIGHT_LM3697
+	help
+	  TI LMU backlight driver provides common driver features.
+	  Chip specific configuration is handled by each backlight driver.
+
 config BACKLIGHT_LP855X
 	tristate "Backlight driver for TI LP855X"
 	depends on BACKLIGHT_CLASS_DEVICE && I2C && PWM
drivers/video/backlight/Makefile +1 -0
index 16ec534..9e475dc 100644
@@ -55,3 +55,4 @@ obj-$(CONFIG_BACKLIGHT_SKY81452)	+= sky81452-backlight.o
 obj-$(CONFIG_BACKLIGHT_TOSA)		+= tosa_bl.o
 obj-$(CONFIG_BACKLIGHT_TPS65217)	+= tps65217_bl.o
 obj-$(CONFIG_BACKLIGHT_WM831X)		+= wm831x_bl.o
+obj-$(CONFIG_TI_LMU_BACKLIGHT)		+= ti-lmu-backlight.o
drivers/video/backlight/ti-lmu-backlight.c new file +429 -0

429 lines not on this page · raw message

drivers/video/backlight/ti-lmu-backlight.h new file +152 -0

152 lines not on this page · raw message

Signature · 1 line
1.9.1
author
#8 lore raw

PATCH 8/16 backlight: ti-lmu-backlight: add LM3532 driver

LM3532 has 3 backlight strings and 8 bit dimming is supported. PWM brightness control is also supported.

Common backlight driver is controlled by TI LMU backlight driver. Only LM3532 specific code is implemented here.

---
 drivers/video/backlight/Kconfig     |   9 ++
 drivers/video/backlight/Makefile    |   1 +
 drivers/video/backlight/lm3532_bl.c | 183 ++++++++++++++++++++++++++++++++++++
 3 files changed, 193 insertions(+)
 create mode 100644 drivers/video/backlight/lm3532_bl.c
drivers/video/backlight/Kconfig +9 -0
index f26eb1c..86d7946 100644
@@ -390,6 +390,15 @@ config BACKLIGHT_LM3639
 	help
 	  This supports TI LM3639 Backlight + 1.5A Flash LED Driver
 
+config BACKLIGHT_LM3532
+	tristate "Backlight driver for TI LM3532"
+	depends on BACKLIGHT_CLASS_DEVICE && MFD_TI_LMU
+	select TI_LMU_BACKLIGHT
+	help
+	  Say Y to enable the backlight driver for TI LM3532.
+	  Up to 3 backlight strings and 8 bit dimming is supported.
+	  PWM brightness control is also supported.
+
 config TI_LMU_BACKLIGHT
 	tristate "Backlight driver for TI LMU"
 	depends on BACKLIGHT_LM3532 || BACKLIGHT_LM3631 || \
drivers/video/backlight/Makefile +1 -0
index 9e475dc..e037f57 100644
@@ -36,6 +36,7 @@ obj-$(CONFIG_BACKLIGHT_GPIO)		+= gpio_backlight.o
 obj-$(CONFIG_BACKLIGHT_HP680)		+= hp680_bl.o
 obj-$(CONFIG_BACKLIGHT_HP700)		+= jornada720_bl.o
 obj-$(CONFIG_BACKLIGHT_IPAQ_MICRO)	+= ipaq_micro_bl.o
+obj-$(CONFIG_BACKLIGHT_LM3532)		+= lm3532_bl.o
 obj-$(CONFIG_BACKLIGHT_LM3533)		+= lm3533_bl.o
 obj-$(CONFIG_BACKLIGHT_LM3630A)		+= lm3630a_bl.o
 obj-$(CONFIG_BACKLIGHT_LM3639)		+= lm3639_bl.o
drivers/video/backlight/lm3532_bl.c new file +183 -0

183 lines not on this page · raw message

Signature · 1 line
1.9.1
author
#9 lore raw

PATCH 9/16 backlight: ti-lmu-backlight: add LM3631 driver

LM3631 has 2 backlight strings and 11 bit dimming is supported. PWM brightness control is also supported.

Common backlight driver is controlled by TI LMU backlight driver. Only LM3631 specific code is implemented here.

---
 drivers/video/backlight/Kconfig     |   9 +++
 drivers/video/backlight/Makefile    |   1 +
 drivers/video/backlight/lm3631_bl.c | 129 ++++++++++++++++++++++++++++++++++++
 3 files changed, 139 insertions(+)
 create mode 100644 drivers/video/backlight/lm3631_bl.c
drivers/video/backlight/Kconfig +9 -0
index 86d7946..986842e 100644
@@ -399,6 +399,15 @@ config BACKLIGHT_LM3532
 	  Up to 3 backlight strings and 8 bit dimming is supported.
 	  PWM brightness control is also supported.
 
+config BACKLIGHT_LM3631
+	tristate "Backlight driver for TI LM3631"
+	depends on BACKLIGHT_CLASS_DEVICE && MFD_TI_LMU
+	select TI_LMU_BACKLIGHT
+	help
+	  Say Y to enable the backlight driver for TI LM3631.
+	  Up to 2 backlight strings and 11 bit dimming is supported.
+	  PWM brightness control is also supported.
+
 config TI_LMU_BACKLIGHT
 	tristate "Backlight driver for TI LMU"
 	depends on BACKLIGHT_LM3532 || BACKLIGHT_LM3631 || \
drivers/video/backlight/Makefile +1 -0
index e037f57..e8891e8 100644
@@ -39,6 +39,7 @@ obj-$(CONFIG_BACKLIGHT_IPAQ_MICRO)	+= ipaq_micro_bl.o
 obj-$(CONFIG_BACKLIGHT_LM3532)		+= lm3532_bl.o
 obj-$(CONFIG_BACKLIGHT_LM3533)		+= lm3533_bl.o
 obj-$(CONFIG_BACKLIGHT_LM3630A)		+= lm3630a_bl.o
+obj-$(CONFIG_BACKLIGHT_LM3631)		+= lm3631_bl.o
 obj-$(CONFIG_BACKLIGHT_LM3639)		+= lm3639_bl.o
 obj-$(CONFIG_BACKLIGHT_LOCOMO)		+= locomolcd.o
 obj-$(CONFIG_BACKLIGHT_LP855X)		+= lp855x_bl.o
drivers/video/backlight/lm3631_bl.c new file +129 -0

129 lines not on this page · raw message

Signature · 1 line
1.9.1
author
#10 lore raw

PATCH 10/16 backlight: ti-lmu-backlight: add LM3632 driver

LM3632 has 2 backlight strings and 11 bit dimming is supported. PWM brightness control is also supported.

Common backlight driver is controlled by TI LMU backlight driver. Only LM3632 specific code is implemented here.

---
 drivers/video/backlight/Kconfig     |   9 +++
 drivers/video/backlight/Makefile    |   1 +
 drivers/video/backlight/lm3632_bl.c | 125 ++++++++++++++++++++++++++++++++++++
 3 files changed, 135 insertions(+)
 create mode 100644 drivers/video/backlight/lm3632_bl.c
drivers/video/backlight/Kconfig +9 -0
index 986842e..e3bf905 100644
@@ -408,6 +408,15 @@ config BACKLIGHT_LM3631
 	  Up to 2 backlight strings and 11 bit dimming is supported.
 	  PWM brightness control is also supported.
 
+config BACKLIGHT_LM3632
+	tristate "Backlight driver for TI LM3632"
+	depends on BACKLIGHT_CLASS_DEVICE && MFD_TI_LMU
+	select TI_LMU_BACKLIGHT
+	help
+	  Say Y to enable the backlight driver for TI LM3632.
+	  Up to 2 backlight strings and 11 bit dimming is supported.
+	  PWM brightness control is also supported.
+
 config TI_LMU_BACKLIGHT
 	tristate "Backlight driver for TI LMU"
 	depends on BACKLIGHT_LM3532 || BACKLIGHT_LM3631 || \
drivers/video/backlight/Makefile +1 -0
index e8891e8..6cd5232 100644
@@ -40,6 +40,7 @@ obj-$(CONFIG_BACKLIGHT_LM3532)		+= lm3532_bl.o
 obj-$(CONFIG_BACKLIGHT_LM3533)		+= lm3533_bl.o
 obj-$(CONFIG_BACKLIGHT_LM3630A)		+= lm3630a_bl.o
 obj-$(CONFIG_BACKLIGHT_LM3631)		+= lm3631_bl.o
+obj-$(CONFIG_BACKLIGHT_LM3632)		+= lm3632_bl.o
 obj-$(CONFIG_BACKLIGHT_LM3639)		+= lm3639_bl.o
 obj-$(CONFIG_BACKLIGHT_LOCOMO)		+= locomolcd.o
 obj-$(CONFIG_BACKLIGHT_LP855X)		+= lp855x_bl.o
drivers/video/backlight/lm3632_bl.c new file +125 -0

125 lines not on this page · raw message

Signature · 1 line
1.9.1
author
#11 lore raw

PATCH 11/16 backlight: ti-lmu-backlight: add LM3633 driver

LM3633 has 3 backlight strings and 11 bit dimming is supported. PWM brightness control is also supported.

LM3633 MFD has HWMON driver which monitors hardware fault detection. After this monitoring is done, LM3633 backlight device should be reinitialized. To enable this, 'hwmon_notifier_used' is set to true. Then, TI LMU backlight handles LMU HWMON event in ti_lmu_backlight_hwmon_notifier().

Common backlight driver is controlled by TI LMU backlight driver. Only LM3633 specific code is implemented here.

---
 drivers/video/backlight/Kconfig     |   9 ++
 drivers/video/backlight/Makefile    |   1 +
 drivers/video/backlight/lm3633_bl.c | 210 ++++++++++++++++++++++++++++++++++++
 3 files changed, 220 insertions(+)
 create mode 100644 drivers/video/backlight/lm3633_bl.c
drivers/video/backlight/Kconfig +9 -0
index e3bf905..e3c4adb 100644
@@ -417,6 +417,15 @@ config BACKLIGHT_LM3632
 	  Up to 2 backlight strings and 11 bit dimming is supported.
 	  PWM brightness control is also supported.
 
+config BACKLIGHT_LM3633
+	tristate "Backlight driver for TI LM3633"
+	depends on BACKLIGHT_CLASS_DEVICE && MFD_TI_LMU
+	select TI_LMU_BACKLIGHT
+	help
+	  Say Y to enable the backlight driver for TI LM3633.
+	  Up to 3 backlight strings and 11 bit dimming is supported.
+	  PWM brightness control is also supported.
+
 config TI_LMU_BACKLIGHT
 	tristate "Backlight driver for TI LMU"
 	depends on BACKLIGHT_LM3532 || BACKLIGHT_LM3631 || \
drivers/video/backlight/Makefile +1 -0
index 6cd5232..364b854 100644
@@ -41,6 +41,7 @@ obj-$(CONFIG_BACKLIGHT_LM3533)		+= lm3533_bl.o
 obj-$(CONFIG_BACKLIGHT_LM3630A)		+= lm3630a_bl.o
 obj-$(CONFIG_BACKLIGHT_LM3631)		+= lm3631_bl.o
 obj-$(CONFIG_BACKLIGHT_LM3632)		+= lm3632_bl.o
+obj-$(CONFIG_BACKLIGHT_LM3633)		+= lm3633_bl.o
 obj-$(CONFIG_BACKLIGHT_LM3639)		+= lm3639_bl.o
 obj-$(CONFIG_BACKLIGHT_LOCOMO)		+= locomolcd.o
 obj-$(CONFIG_BACKLIGHT_LP855X)		+= lp855x_bl.o
drivers/video/backlight/lm3633_bl.c new file +210 -0

210 lines not on this page · raw message

Signature · 6 lines
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
author
#12 lore raw

PATCH 12/16 backlight: ti-lmu-backlight: add LM3695 driver

LM3695 has 2 backlight strings and 11 bit dimming is supported.

Common backlight driver is controlled by TI LMU backlight driver. Only LM3695 specific code is implemented here.

---
 drivers/video/backlight/Kconfig     |  8 ++++
 drivers/video/backlight/Makefile    |  1 +
 drivers/video/backlight/lm3695_bl.c | 91 +++++++++++++++++++++++++++++++++++++
 3 files changed, 100 insertions(+)
 create mode 100644 drivers/video/backlight/lm3695_bl.c
drivers/video/backlight/Kconfig +8 -0
index e3c4adb..c1dc908 100644
@@ -426,6 +426,14 @@ config BACKLIGHT_LM3633
 	  Up to 3 backlight strings and 11 bit dimming is supported.
 	  PWM brightness control is also supported.
 
+config BACKLIGHT_LM3695
+	tristate "Backlight driver for TI LM3695"
+	depends on BACKLIGHT_CLASS_DEVICE && MFD_TI_LMU
+	select TI_LMU_BACKLIGHT
+	help
+	  Say Y to enable the backlight driver for TI LM3695.
+	  Up to 2 backlight strings and 11 bit dimming is supported.
+
 config TI_LMU_BACKLIGHT
 	tristate "Backlight driver for TI LMU"
 	depends on BACKLIGHT_LM3532 || BACKLIGHT_LM3631 || \
drivers/video/backlight/Makefile +1 -0
index 364b854..af20285 100644
@@ -43,6 +43,7 @@ obj-$(CONFIG_BACKLIGHT_LM3631)		+= lm3631_bl.o
 obj-$(CONFIG_BACKLIGHT_LM3632)		+= lm3632_bl.o
 obj-$(CONFIG_BACKLIGHT_LM3633)		+= lm3633_bl.o
 obj-$(CONFIG_BACKLIGHT_LM3639)		+= lm3639_bl.o
+obj-$(CONFIG_BACKLIGHT_LM3695)		+= lm3695_bl.o
 obj-$(CONFIG_BACKLIGHT_LOCOMO)		+= locomolcd.o
 obj-$(CONFIG_BACKLIGHT_LP855X)		+= lp855x_bl.o
 obj-$(CONFIG_BACKLIGHT_LP8788)		+= lp8788_bl.o
drivers/video/backlight/lm3695_bl.c new file +91 -0

91 lines not on this page · raw message

Signature · 1 line
1.9.1
author
#13 lore raw

PATCH 13/16 backlight: ti-lmu-backlight: add LM3697 driver

LM3697 has 3 backlight strings and 11 bit dimming is supported. PWM brightness control is also supported.

LM3697 MFD has HWMON driver which monitors hardware fault detection. After this monitoring is done, LM3697 backlight device should be reinitialized. To enable this, 'hwmon_notifier_used' is set to true. Then, TI LMU backlight handles LMU HWMON event in ti_lmu_backlight_hwmon_notifier().

Common backlight driver is controlled by TI LMU backlight driver. Only LM3697 specific code is implemented here.

---
 drivers/video/backlight/Kconfig     |   9 ++
 drivers/video/backlight/Makefile    |   1 +
 drivers/video/backlight/lm3697_bl.c | 187 ++++++++++++++++++++++++++++++++++++
 3 files changed, 197 insertions(+)
 create mode 100644 drivers/video/backlight/lm3697_bl.c
drivers/video/backlight/Kconfig +9 -0
index c1dc908..c672073 100644
@@ -434,6 +434,15 @@ config BACKLIGHT_LM3695
 	  Say Y to enable the backlight driver for TI LM3695.
 	  Up to 2 backlight strings and 11 bit dimming is supported.
 
+config BACKLIGHT_LM3697
+	tristate "Backlight driver for TI LM3697"
+	depends on BACKLIGHT_CLASS_DEVICE && MFD_TI_LMU
+	select TI_LMU_BACKLIGHT
+	help
+	  Say Y to enable the backlight driver for TI LM3697.
+	  Up to 3 backlight strings and 11 bit dimming is supported.
+	  PWM brightness control is also supported.
+
 config TI_LMU_BACKLIGHT
 	tristate "Backlight driver for TI LMU"
 	depends on BACKLIGHT_LM3532 || BACKLIGHT_LM3631 || \
drivers/video/backlight/Makefile +1 -0
index af20285..abb7fe0 100644
@@ -44,6 +44,7 @@ obj-$(CONFIG_BACKLIGHT_LM3632)		+= lm3632_bl.o
 obj-$(CONFIG_BACKLIGHT_LM3633)		+= lm3633_bl.o
 obj-$(CONFIG_BACKLIGHT_LM3639)		+= lm3639_bl.o
 obj-$(CONFIG_BACKLIGHT_LM3695)		+= lm3695_bl.o
+obj-$(CONFIG_BACKLIGHT_LM3697)		+= lm3697_bl.o
 obj-$(CONFIG_BACKLIGHT_LOCOMO)		+= locomolcd.o
 obj-$(CONFIG_BACKLIGHT_LP855X)		+= lp855x_bl.o
 obj-$(CONFIG_BACKLIGHT_LP8788)		+= lp8788_bl.o
drivers/video/backlight/lm3697_bl.c new file +187 -0

187 lines not on this page · raw message

Signature · 1 line
1.9.1
author
#14 lore raw

PATCH 14/16 hwmon: add TI LMU hardware fault monitoring driver

LM3633 and LM3697 are TI LMU MFD device.
Those device have hardware monitoring feature which detects opened or shorted circuit case.

Attributes
----------
Two attributes are registered.
open_fault: check backlight output channel is opened or not
short_fault: check backlight output channel is shorted or not

With register R/W operations, LMU HWMON driver checks the status of backlight output channels.
LM3633 and LM3697 have same sequence to check channels, so common functions are used.

Operations
----------
Two devices have common control flow but register addresses are different. The structure, 'ti_lmu_reg' is used for device configuration.

HWMON notifier
--------------
After LMU HWMON operation is done, backlight device should be reinitialized. LMU HWMON driver notifies an event as soon as the monitoring is done. Then, LM3633 and LM3697 backlight driver handles this event.

---
 drivers/hwmon/Kconfig        |  10 ++
 drivers/hwmon/Makefile       |   1 +
 drivers/hwmon/ti-lmu-hwmon.c | 393 +++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 404 insertions(+)
 create mode 100644 drivers/hwmon/ti-lmu-hwmon.c
drivers/hwmon/Kconfig +10 -0
index e13c902..989e1fa 100644
@@ -1483,6 +1483,16 @@ config SENSORS_THMC50
 	  This driver can also be built as a module.  If so, the module
 	  will be called thmc50.
 
+config SENSORS_TI_LMU
+	tristate "Texas Instruments LMU Hardware Fault Monitoring Driver"
+	depends on MFD_TI_LMU
+	help
+	  Say Y here to include support for the TI LMU opened and shorted
+	  circuit fault detection.
+
+	  This driver can also be built as a module. If so the module
+	  will be called ti-lmu-hwmon.
+
 config SENSORS_TMP102
 	tristate "Texas Instruments TMP102"
 	depends on I2C
drivers/hwmon/Makefile +1 -0
index 9e0f3dd..de11b74 100644
@@ -143,6 +143,7 @@ obj-$(CONFIG_SENSORS_SMSC47M192)+= smsc47m192.o
 obj-$(CONFIG_SENSORS_AMC6821)	+= amc6821.o
 obj-$(CONFIG_SENSORS_TC74)	+= tc74.o
 obj-$(CONFIG_SENSORS_THMC50)	+= thmc50.o
+obj-$(CONFIG_SENSORS_TI_LMU)	+= ti-lmu-hwmon.o
 obj-$(CONFIG_SENSORS_TMP102)	+= tmp102.o
 obj-$(CONFIG_SENSORS_TMP103)	+= tmp103.o
 obj-$(CONFIG_SENSORS_TMP401)	+= tmp401.o
drivers/hwmon/ti-lmu-hwmon.c new file +393 -0

393 lines not on this page · raw message

Signature · 1 line
1.9.1
author
#15 lore raw

PATCH 15/16 leds: add LM3633 driver

LM3633 LED driver supports generic LED functions and pattern generation. Pattern is generated through the sysfs. ABI documentation is also added.

Device creation from device tree
--------------------------------
LED channel name, LED string usage and max current settings are configured inside the DT.

LED dimming pattern generation
------------------------------
LM3633 supports programmable dimming pattern generator. To enable it, three attributes are used. 'pattern_times', 'pattern_levels' and 'run_pattern'. Sysfs ABI describes it.

LMU HWMON event handling
------------------------
As soon as LMU HWMON operation is done, LMU HWMON driver sends the event, 'LMU_EVENT_HWMON_DONE'. Then, LM3633 device should be reinitialized because the device was reset by LMU HWMON driver. lm3633_led_hwmon_notifier() handles this event.

Data structure
--------------
ti_lmu_led_chip: LED device data.
ti_lmu_led: LED output channel data.
One LED device can have multiple LED channels.

---
 Documentation/ABI/testing/sysfs-class-led-lm3633 |  60 ++
 drivers/leds/Kconfig                             |  10 +
 drivers/leds/Makefile                            |   1 +
 drivers/leds/leds-lm3633.c                       | 749 +++++++++++++++++++++++
 4 files changed, 820 insertions(+)
 create mode 100644 Documentation/ABI/testing/sysfs-class-led-lm3633
 create mode 100644 drivers/leds/leds-lm3633.c
Documentation/ABI/testing/sysfs-class-led-lm3633 new file +60 -0
new file mode 100644
index 0000000..c1d8759
@@ -0,0 +1,60 @@
+LM3633 LED driver generates programmable pattern via the sysfs.
+
+LED Pattern Generator Structure
+
+                            (3)
+  (a) --------------->  ___________
+                       /           \
+                  (2) /             \ (4)
+  (b) ----> _________/               \_________  ...
+               (1)                       (5)
+
+                     |<-----   period   -----> |
+
+What:		/sys/class/leds/<led>/pattern_times
+Date:		Oct 2015
+KernelVersion:	4.3
+Contact:	Milo Kim <[email protected]>
+Description:	read/write
+                Set pattern time dimension. There are five arguments.
+                  (1) startup delay
+                  (2) rising dimming time
+                  (3) how much time stays at high level
+                  (4) falling dimming time
+                  (5) how much time stays at low level
+                Ranges are
+                  (1), (3), (5): 0 ~ 10000. Unit is millisecond.
+                  (2), (4): 0 ~ 16000. Unit is millisecond.
+
+                Example:
+                No delay, rising 200ms, high 300ms, falling 100ms, low 400ms.
+                echo "0 200 300 100 400" > /sys/class/leds/<led>/pattern_times
+
+                cat /sys/class/leds/<led>/pattern_times
+                delay: 0, rise: 200, high: 300, fall: 100, low: 400
+
+What:		/sys/class/leds/<led>/pattern_levels
+Date:		Oct 2015
+KernelVersion:	4.3
+Contact:	Milo Kim <[email protected]>
+Description:	read/write
+                Set pattern level(brightness). There are two arguments.
+                  (a) Low brightness level
+                  (b) High brightness level
+                Ranges are from 0 to 255.
+
+                Example:
+                Low level is 0, high level is 255.
+                echo "0 255" > /sys/class/leds/<led>/pattern_levels
+
+                cat /sys/class/leds/<led>/pattern_levels
+                low brightness: 0, high brightness: 255
+
+What:		/sys/class/leds/<led>/run_pattern
+Date:		Oct 2015
+KernelVersion:	4.3
+Contact:	Milo Kim <[email protected]>
+Description:	write only
+                After 'pattern_times' and 'pattern_levels' are updated,
+                run the pattern by writing 1 to 'run_pattern'.
+                To stop running pattern, writes 0 to 'run_pattern'.
drivers/leds/Kconfig +10 -0
index 42990f2..bc41a0e 100644
@@ -88,6 +88,16 @@ config LEDS_LM3533
 	  hardware-accelerated blinking with maximum on and off periods of 9.8
 	  and 77 seconds respectively.
 
+config LEDS_LM3633
+	tristate "LED support for the TI LM3633 LMU"
+	depends on LEDS_CLASS
+	depends on MFD_TI_LMU
+	help
+	  This option enables support for the LEDs on the LM3633.
+	  LM3633 has 6 low voltage indicator LEDs.
+	  All low voltage current sinks can have a programmable pattern
+	  modulated onto LED output strings.
+
 config LEDS_LM3642
 	tristate "LED support for LM3642 Chip"
 	depends on LEDS_CLASS && I2C
drivers/leds/Makefile +1 -0
index b503f92..984f44a 100644
@@ -14,6 +14,7 @@ obj-$(CONFIG_LEDS_BD2802)		+= leds-bd2802.o
 obj-$(CONFIG_LEDS_LOCOMO)		+= leds-locomo.o
 obj-$(CONFIG_LEDS_LM3530)		+= leds-lm3530.o
 obj-$(CONFIG_LEDS_LM3533)		+= leds-lm3533.o
+obj-$(CONFIG_LEDS_LM3633)		+= leds-lm3633.o
 obj-$(CONFIG_LEDS_LM3642)		+= leds-lm3642.o
 obj-$(CONFIG_LEDS_MIKROTIK_RB532)	+= leds-rb532.o
 obj-$(CONFIG_LEDS_S3C24XX)		+= leds-s3c24xx.o
drivers/leds/leds-lm3633.c new file +749 -0

749 lines not on this page · raw message

Signature · 1 line
1.9.1
author
#16 lore raw

PATCH 16/16 regulator: add LM363X driver

LM363X regulator driver supports LM3631 and LM3632.
LM3631 has 5 regulators. LM3632 provides 3 regulators.
One boost output and LDOs are used for the display module. Boost voltage is configurable but always on.
Supported operations for LDOs are enabled/disabled and voltage change.

Two LDOs of LM3632 can be controlled by external pins. Those are described in the device tree bindings.

---
 drivers/regulator/Kconfig            |   9 +
 drivers/regulator/Makefile           |   1 +
 drivers/regulator/lm363x-regulator.c | 349 +++++++++++++++++++++++++++++++++++
 3 files changed, 359 insertions(+)
 create mode 100644 drivers/regulator/lm363x-regulator.c
drivers/regulator/Kconfig +9 -0
index 64bccff..efac1eb 100644
@@ -274,6 +274,15 @@ config REGULATOR_ISL6271A
 	help
 	  This driver supports ISL6271A voltage regulator chip.
 
+config REGULATOR_LM363X
+	tristate "TI LM363X voltage regulators"
+	depends on MFD_TI_LMU
+	help
+	  This driver supports LM3631 and LM3632 voltage regulators for
+	  the LCD bias.
+	  One boost output voltage is configurable and always on.
+	  Other LDOs are used for the display module.
+
 config REGULATOR_LP3971
 	tristate "National Semiconductors LP3971 PMIC regulator driver"
 	depends on I2C
drivers/regulator/Makefile +1 -0
index 0f81749..0ea87cd 100644
@@ -36,6 +36,7 @@ obj-$(CONFIG_REGULATOR_GPIO) += gpio-regulator.o
 obj-$(CONFIG_REGULATOR_HI6421) += hi6421-regulator.o
 obj-$(CONFIG_REGULATOR_ISL6271A) += isl6271a-regulator.o
 obj-$(CONFIG_REGULATOR_ISL9305) += isl9305.o
+obj-$(CONFIG_REGULATOR_LM363X) += lm363x-regulator.o
 obj-$(CONFIG_REGULATOR_LP3971) += lp3971.o
 obj-$(CONFIG_REGULATOR_LP3972) += lp3972.o
 obj-$(CONFIG_REGULATOR_LP872X) += lp872x.o
drivers/regulator/lm363x-regulator.c new file +349 -0

349 lines not on this page · raw message

Signature · 1 line
1.9.1
author
#19 lore raw
In reply to Milo Kim

My apologies for sending without no-chain-reply-to option. So, I've resent the patch-set named 'PATCH RESEND 00/16 .. 16/16'.

Best regards,
Milo

Quoted 92 lines · Milo Kim

TI LMU(Lighting Management Unit) driver supports lighting devices below.

          Enable pin  Backlights  HWMON  LEDs   Regulators
          ----------  ----------  -----  ----  ------------
LM3532       o           o         x     x        x
LM3631       o           o         x     x    5 regulators
LM3632       o           o         x     x    3 regulators
LM3633       o           o         o     o        x
LM3695       o           o         x     x        x
LM3697       o           o         o     x        x

This patch-set consists of several parts below.

DT bindings : Binding information for each module
TI LMU MFD : Device registration, HW enable pin control and
I2C register access
TI LMU backlight : Common driver for TI LMU backlight devices
Each backlight driver : Chip dependent code
HWMON : LMU hardware fault monitoring driver
LM3633 LED : LED subsystem and dimming pattern generation
supported
LM363X regulator : LM3631 and LM3632 regulator driver for the
display bias

Git location:
Please refer to the location below. Branch name is 'ti-lmu'. git clone -b ti-lmu https://github.com/milokim/linux.git

Milo Kim (16):
Documentation: dt-bindings: mfd: add TI LMU device binding information
Documentation: dt-bindings: backlight: add TI LMU backlight binding
information
Documentation: dt-bindings: hwmon: add TI LMU HWMON binding
information
Documentation: dt-bindings: leds: add LM3633 LED binding information
Documentation: dt-bindings: regulator: add LM363x regulator binding
information
mfd: add TI LMU driver
backlight: add TI LMU backlight common driver
backlight: ti-lmu-backlight: add LM3532 driver
backlight: ti-lmu-backlight: add LM3631 driver
backlight: ti-lmu-backlight: add LM3632 driver
backlight: ti-lmu-backlight: add LM3633 driver
backlight: ti-lmu-backlight: add LM3695 driver
backlight: ti-lmu-backlight: add LM3697 driver
hwmon: add TI LMU hardware fault monitoring driver
leds: add LM3633 driver
regulator: add LM363X driver

  Documentation/ABI/testing/sysfs-class-led-lm3633   |  60 ++
  .../devicetree/bindings/hwmon/ti-lmu-hwmon.txt     |  12 +
  .../devicetree/bindings/leds/leds-lm3633.txt       |  28 +
  Documentation/devicetree/bindings/mfd/ti-lmu.txt   | 282 ++++++++
  .../bindings/regulator/lm363x-regulator.txt        |  28 +
  .../bindings/video/backlight/ti-lmu-backlight.txt  |  67 ++
  drivers/hwmon/Kconfig                              |  10 +
  drivers/hwmon/Makefile                             |   1 +
  drivers/hwmon/ti-lmu-hwmon.c                       | 393 +++++++++++
  drivers/leds/Kconfig                               |  10 +
  drivers/leds/Makefile                              |   1 +
  drivers/leds/leds-lm3633.c                         | 749 +++++++++++++++++++++
  drivers/mfd/Kconfig                                |  12 +
  drivers/mfd/Makefile                               |   1 +
  drivers/mfd/ti-lmu.c                               | 324 +++++++++
  drivers/regulator/Kconfig                          |   9 +
  drivers/regulator/Makefile                         |   1 +
  drivers/regulator/lm363x-regulator.c               | 349 ++++++++++
  drivers/video/backlight/Kconfig                    |  62 ++
  drivers/video/backlight/Makefile                   |   7 +
  drivers/video/backlight/lm3532_bl.c                | 183 +++++
  drivers/video/backlight/lm3631_bl.c                | 129 ++++
  drivers/video/backlight/lm3632_bl.c                | 125 ++++
  drivers/video/backlight/lm3633_bl.c                | 210 ++++++
  drivers/video/backlight/lm3695_bl.c                |  91 +++
  drivers/video/backlight/lm3697_bl.c                | 187 +++++
  drivers/video/backlight/ti-lmu-backlight.c         | 429 ++++++++++++
  drivers/video/backlight/ti-lmu-backlight.h         | 152 +++++
  include/linux/mfd/ti-lmu-register.h                | 277 ++++++++
  include/linux/mfd/ti-lmu.h                         |  81 +++
  30 files changed, 4270 insertions(+)

create mode 100644 Documentation/ABI/testing/sysfs-class-led-lm3633
create mode 100644 Documentation/devicetree/bindings/hwmon/ti-lmu-hwmon.txt create mode 100644 Documentation/devicetree/bindings/leds/leds-lm3633.txt create mode 100644 Documentation/devicetree/bindings/mfd/ti-lmu.txt
create mode 100644 Documentation/devicetree/bindings/regulator/lm363x-regulator.txt create mode 100644 Documentation/devicetree/bindings/video/backlight/ti-lmu-backlight.txt create mode 100644 drivers/hwmon/ti-lmu-hwmon.c
create mode 100644 drivers/leds/leds-lm3633.c
create mode 100644 drivers/mfd/ti-lmu.c
create mode 100644 drivers/regulator/lm363x-regulator.c
create mode 100644 drivers/video/backlight/lm3532_bl.c
create mode 100644 drivers/video/backlight/lm3631_bl.c

Quoted 9 lines

create mode 100644 drivers/video/backlight/lm3632_bl.c create mode 100644 drivers/video/backlight/lm3633_bl.c create mode 100644 drivers/video/backlight/lm3695_bl.c create mode 100644 drivers/video/backlight/lm3697_bl.c create mode 100644 drivers/video/backlight/ti-lmu-backlight.c create mode 100644 drivers/video/backlight/ti-lmu-backlight.h create mode 100644 include/linux/mfd/ti-lmu-register.h create mode 100644 include/linux/mfd/ti-lmu.h

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

maintainer
#17 lore raw

Re: [PATCH 04/16] Documentation: dt-bindings: leds: add LM3633 LED binding information

In reply to Milo Kim
Quoted 23 lines · Milo Kim

LM3633 LED device is one of TI LMU device list.

---
 .../devicetree/bindings/leds/leds-lm3633.txt       | 28 ++++++++++++++++++++++
 1 file changed, 28 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/leds/leds-lm3633.txt
Documentation/devicetree/bindings/leds/leds-lm3633.txt new file +4 -0
new file mode 100644
index 0000000..bb7f213
@@ -0,0 +1,28 @@
+TI LMU LM3633 LED device tree bindings
+
+Required properties:
+  - compatible: "ti,lm3633-leds"

Documentation/devicetree/bindings/leds/leds-lm3633.txt line 14

Quoted 10 lines
Documentation/devicetree/bindings/leds/leds-lm3633.txt new file +10 -0
+
+Child nodes:
+  Each node matches with LED control bank.
+  Please refer to the datasheet [1].
+
+  Required properties of a child node:
+  - lvled1-used, lvled2-used, lvled3-used,
+    lvled4-used, lvled5-used, lvled6-used:
+    Low voltage LED string configuration. Type is <boolean>.
+    Please describe which output LED string is used.

What is "LED string"?

We have properties for which LED driver/channel of the parent to use and "status" can be used to disable child nodes.

Documentation/devicetree/bindings/leds/leds-lm3633.txt line 21

Quoted 7 lines
Documentation/devicetree/bindings/leds/leds-lm3633.txt new file +7 -0
+
+  Optional properties of a child node:
+  - channel-name: Name string for LED channel identification
+                  It is used for creating LED sysfs,
+                  /sys/class/leds/<channel-name>/.
+                  If this property is empty, then default name is set to
+                  "indicator:<id>" by the driver.

I believe "label" already provides this function.

Quoted 10 lines
Documentation/devicetree/bindings/leds/leds-lm3633.txt new file +7 -1
+  - led-max-microamp: Max current setting. Type is <u32>.
+                      Unit is microampere. Range is from 5000 to 30000.
+
+Examples: Please refer to ti-lmu dt-bindings [2].
+
+[1] http://www.ti.com/product/LM3633/datasheet
+[2] Documentation/devicetree/bindings/mfd/ti-lmu.txt
--

1.9.1

Quoted 4 lines

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

author
#18 lore raw

Re: [PATCH 04/16] Documentation: dt-bindings: leds: add LM3633 LED binding information

Hi Rob,

Quoted 28 lines · Rob Herring
Quoted 27 lines · Milo Kim

LM3633 LED device is one of TI LMU device list.

---
  .../devicetree/bindings/leds/leds-lm3633.txt       | 28 ++++++++++++++++++++++
  1 file changed, 28 insertions(+)

create mode 100644 Documentation/devicetree/bindings/leds/leds-lm3633.txt

Documentation/devicetree/bindings/leds/leds-lm3633.txt new file +8 -0
new file mode 100644
index 0000000..bb7f213
@@ -0,0 +1,28 @@
+TI LMU LM3633 LED device tree bindings
+
+Required properties:
+  - compatible: "ti,lm3633-leds"
+
+Child nodes:
+  Each node matches with LED control bank.
+  Please refer to the datasheet [1].
Quoted 8 lines

Documentation/devicetree/bindings/leds/leds-lm3633.txt line 14

Quoted 6 lines
Documentation/devicetree/bindings/leds/leds-lm3633.txt new file +6 -0
+
+  Required properties of a child node:
+  - lvled1-used, lvled2-used, lvled3-used,
+    lvled4-used, lvled5-used, lvled6-used:
+    Low voltage LED string configuration. Type is <boolean>.
+    Please describe which output LED string is used.

What is "LED string"?

Let me replace these properties with 'led-sources'.

Quoted 12 lines

We have properties for which LED driver/channel of the parent to use and "status" can be used to disable child nodes.

Documentation/devicetree/bindings/leds/leds-lm3633.txt line 21

Quoted 7 lines
Documentation/devicetree/bindings/leds/leds-lm3633.txt new file +7 -0
+
+  Optional properties of a child node:
+  - channel-name: Name string for LED channel identification
+                  It is used for creating LED sysfs,
+                  /sys/class/leds/<channel-name>/.
+                  If this property is empty, then default name is set to
+                  "indicator:<id>" by the driver.
Quoted 2 lines

I believe "label" already provides this function.

Yep, got it. Thanks!

Best regards,
Milo