OSDN Git Service

arm64: dts: qcom: msm8916-alcatel-idol347: add GPIO torch LED
authorVincent Knecht <vincent.knecht@mailoo.org>
Fri, 4 Nov 2022 13:23:59 +0000 (14:23 +0100)
committerBjorn Andersson <andersson@kernel.org>
Mon, 7 Nov 2022 03:11:10 +0000 (21:11 -0600)
Add support for torch LED on GPIO 32.

Signed-off-by: Vincent Knecht <vincent.knecht@mailoo.org>
Reviewed-by: Konrad Dybcio <konrad.dybcio@somainline.org>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Link: https://lore.kernel.org/r/20221104132400.1763218-3-vincent.knecht@mailoo.org
arch/arm64/boot/dts/qcom/msm8916-alcatel-idol347.dts

index 668f8ff..eadeb1a 100644 (file)
@@ -5,6 +5,7 @@
 #include "msm8916-pm8916.dtsi"
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/input/input.h>
+#include <dt-bindings/leds/common.h>
 
 / {
        model = "Alcatel OneTouch Idol 3 (4.7)";
                };
        };
 
+       gpio-leds {
+               compatible = "gpio-leds";
+
+               pinctrl-names = "default";
+               pinctrl-0 = <&gpio_leds_default>;
+
+               led-0 {
+                       gpios = <&msmgpio 32 GPIO_ACTIVE_HIGH>;
+                       linux,default-trigger = "torch";
+                       function = LED_FUNCTION_TORCH;
+               };
+       };
+
        usb_id: usb-id {
                compatible = "linux,extcon-usb-gpio";
                id-gpio = <&msmgpio 69 GPIO_ACTIVE_HIGH>;
                bias-pull-up;
        };
 
+       gpio_leds_default: gpio-leds-default-state {
+               pins = "gpio32";
+               function = "gpio";
+
+               drive-strength = <2>;
+               bias-disable;
+       };
+
        gyro_int_default: gyro-int-default-state {
                pins = "gpio97", "gpio98";
                function = "gpio";