1*c66ec88fSEmmanuel VadotLED connected to PWM 2*c66ec88fSEmmanuel Vadot 3*c66ec88fSEmmanuel VadotRequired properties: 4*c66ec88fSEmmanuel Vadot- compatible : should be "pwm-leds". 5*c66ec88fSEmmanuel Vadot 6*c66ec88fSEmmanuel VadotEach LED is represented as a sub-node of the pwm-leds device. Each 7*c66ec88fSEmmanuel Vadotnode's name represents the name of the corresponding LED. 8*c66ec88fSEmmanuel Vadot 9*c66ec88fSEmmanuel VadotLED sub-node properties: 10*c66ec88fSEmmanuel Vadot- pwms : PWM property to point to the PWM device (phandle)/port (id) and to 11*c66ec88fSEmmanuel Vadot specify the period time to be used: <&phandle id period_ns>; 12*c66ec88fSEmmanuel Vadot- pwm-names : (optional) Name to be used by the PWM subsystem for the PWM device 13*c66ec88fSEmmanuel Vadot For the pwms and pwm-names property please refer to: 14*c66ec88fSEmmanuel Vadot Documentation/devicetree/bindings/pwm/pwm.txt 15*c66ec88fSEmmanuel Vadot- max-brightness : Maximum brightness possible for the LED 16*c66ec88fSEmmanuel Vadot- active-low : (optional) For PWMs where the LED is wired to supply 17*c66ec88fSEmmanuel Vadot rather than ground. 18*c66ec88fSEmmanuel Vadot- label : (optional) 19*c66ec88fSEmmanuel Vadot see Documentation/devicetree/bindings/leds/common.txt 20*c66ec88fSEmmanuel Vadot- linux,default-trigger : (optional) 21*c66ec88fSEmmanuel Vadot see Documentation/devicetree/bindings/leds/common.txt 22*c66ec88fSEmmanuel Vadot 23*c66ec88fSEmmanuel VadotExample: 24*c66ec88fSEmmanuel Vadot 25*c66ec88fSEmmanuel Vadottwl_pwm: pwm { 26*c66ec88fSEmmanuel Vadot /* provides two PWMs (id 0, 1 for PWM1 and PWM2) */ 27*c66ec88fSEmmanuel Vadot compatible = "ti,twl6030-pwm"; 28*c66ec88fSEmmanuel Vadot #pwm-cells = <2>; 29*c66ec88fSEmmanuel Vadot}; 30*c66ec88fSEmmanuel Vadot 31*c66ec88fSEmmanuel Vadottwl_pwmled: pwmled { 32*c66ec88fSEmmanuel Vadot /* provides one PWM (id 0 for Charing indicator LED) */ 33*c66ec88fSEmmanuel Vadot compatible = "ti,twl6030-pwmled"; 34*c66ec88fSEmmanuel Vadot #pwm-cells = <2>; 35*c66ec88fSEmmanuel Vadot}; 36*c66ec88fSEmmanuel Vadot 37*c66ec88fSEmmanuel Vadotpwmleds { 38*c66ec88fSEmmanuel Vadot compatible = "pwm-leds"; 39*c66ec88fSEmmanuel Vadot kpad { 40*c66ec88fSEmmanuel Vadot label = "omap4::keypad"; 41*c66ec88fSEmmanuel Vadot pwms = <&twl_pwm 0 7812500>; 42*c66ec88fSEmmanuel Vadot max-brightness = <127>; 43*c66ec88fSEmmanuel Vadot }; 44*c66ec88fSEmmanuel Vadot 45*c66ec88fSEmmanuel Vadot charging { 46*c66ec88fSEmmanuel Vadot label = "omap4:green:chrg"; 47*c66ec88fSEmmanuel Vadot pwms = <&twl_pwmled 0 7812500>; 48*c66ec88fSEmmanuel Vadot max-brightness = <255>; 49*c66ec88fSEmmanuel Vadot }; 50*c66ec88fSEmmanuel Vadot}; 51