ARM: dts: chromecast: use PWM for LEDs
authorThomas Hebb <tommyhebb@gmail.com>
Mon, 14 May 2018 21:58:15 +0000 (17:58 -0400)
committerJisheng Zhang <Jisheng.Zhang@synaptics.com>
Thu, 24 May 2018 07:14:37 +0000 (15:14 +0800)
Control the Chromecast's two LEDs using PWM instead of GPIO pins. This
allows for variable brightness.

Signed-off-by: Thomas Hebb <tommyhebb@gmail.com>
Signed-off-by: Jisheng Zhang <Jisheng.Zhang@synaptics.com>
arch/arm/boot/dts/berlin2cd-google-chromecast.dts

index f1767c8..4b46e53 100644 (file)
        };
 
        leds {
-               compatible = "gpio-leds";
+               compatible = "pwm-leds";
+               pinctrl-0 = <&ledpwm_pmux>;
+               pinctrl-names = "default";
 
                white {
                        label = "white";
-                       gpios = <&portc 1 GPIO_ACTIVE_HIGH>;
-                       default-state = "keep";
+                       pwms = <&pwm 0 600000 0>;
+                       max-brightness = <255>;
+                       linux,default-trigger = "default-on";
                };
 
                red {
                        label = "red";
-                       gpios = <&portc 2 GPIO_ACTIVE_HIGH>;
-                       default-state = "keep";
+                       pwms = <&pwm 1 600000 0>;
+                       max-brightness = <255>;
                };
        };
 };
 &usb_phy1 { status = "okay"; };
 
 &usb1 { status = "okay"; };
+
+&soc_pinctrl {
+       ledpwm_pmux: ledpwm-pmux {
+               groups = "G0";
+               function = "pwm";
+       };
+};