^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) * Texas Instruments - lm3532 White LED driver with ambient light sensing
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) capability.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) The LM3532 provides the 3 high-voltage, low-side current sinks. The device is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) programmable over an I2C-compatible interface and has independent
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) current control for all three channels. The adaptive current regulation
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) method allows for different LED currents in each current sink thus allowing
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) for a wide variety of backlight and keypad applications.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) The main features of the LM3532 include dual ambient light sensor inputs
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) each with 32 internal voltage setting resistors, 8-bit logarithmic and linear
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) brightness control, dual external PWM brightness control inputs, and up to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) 1000:1 dimming ratio with programmable fade in and fade out settings.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) Required properties:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) - compatible : "ti,lm3532"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) - reg : I2C slave address
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) - #address-cells : 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) - #size-cells : 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) Optional properties:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) - enable-gpios : gpio pin to enable (active high)/disable the device.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) - ramp-up-us - The Run time ramp rates/step are from one current
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) set-point to another after the device has reached its
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) initial target set point from turn-on
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) - ramp-down-us - The Run time ramp rates/step are from one current
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) set-point to another after the device has reached its
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) initial target set point from turn-on
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) Range for ramp settings: 8us - 65536us
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) Optional properties if ALS mode is used:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) - ti,als-vmin - Minimum ALS voltage defined in Volts
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) - ti,als-vmax - Maximum ALS voltage defined in Volts
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) Per the data sheet the max ALS voltage is 2V and the min is 0V
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) - ti,als1-imp-sel - ALS1 impedance resistor selection in Ohms
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) - ti,als2-imp-sel - ALS2 impedance resistor selection in Ohms
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) Range for impedance select: 37000 Ohms - 1190 Ohms
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) Values above 37kohms will be set to the "High Impedance" setting
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) - ti,als-avrg-time-us - Determines the length of time the device needs to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) average the two ALS inputs. This is only used if
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) the input mode is LM3532_ALS_INPUT_AVRG.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) Range: 17920us - 2293760us
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) - ti,als-input-mode - Determines how the device uses the attached ALS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) devices.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) 0x00 - ALS1 and ALS2 input average
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) 0x01 - ALS1 Input
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) 0x02 - ALS2 Input
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) 0x03 - Max of ALS1 and ALS2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) Required child properties:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) - reg : Indicates control bank the LED string is controlled by
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) - led-sources : see Documentation/devicetree/bindings/leds/common.txt
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) - ti,led-mode : Defines if the LED strings are manually controlled or
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) if the LED strings are controlled by the ALS.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) 0x00 - LED strings are I2C controlled via full scale
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) brightness control register
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) 0x01 - LED strings are ALS controlled
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) Optional LED child properties:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) - label : see Documentation/devicetree/bindings/leds/common.txt
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) - linux,default-trigger :
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) see Documentation/devicetree/bindings/leds/common.txt
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) - led-max-microamp : Defines the full scale current value for each control
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) bank. The range is from 5000uA-29800uA in increments
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) of 800uA.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) Example:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) led-controller@38 {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71) compatible = "ti,lm3532";
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) #address-cells = <1>;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73) #size-cells = <0>;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74) reg = <0x38>;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76) enable-gpios = <&gpio6 12 GPIO_ACTIVE_HIGH>;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77) ramp-up-us = <1024>;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 78) ramp-down-us = <65536>;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 79)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 80) ti,als-vmin = <0>;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 81) ti,als-vmax = <2000>;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 82) ti,als1-imp-sel = <4110>;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 83) ti,als2-imp-sel = <2180>;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 84) ti,als-avrg-time-us = <17920>;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 85) ti,als-input-mode = <0x00>;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 86)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 87) led@0 {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 88) reg = <0>;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 89) led-sources = <2>;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 90) ti,led-mode = <1>;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 91) led-max-microamp = <21800>;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 92) label = ":backlight";
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 93) linux,default-trigger = "backlight";
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 94) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 95)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 96) led@1 {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 97) reg = <1>;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 98) led-sources = <1>;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 99) ti,led-mode = <0>;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) label = ":kbd_backlight";
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) For more product information please see the links below:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) https://www.ti.com/product/LM3532