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