diff mbox series

[v1,1/2] arm64: dts: qcom: msm8916-alcatel-idol347: add GPIO torch LED

Message ID 20221029145557.106920-1-vincent.knecht@mailoo.org (mailing list archive)
State Superseded
Headers show
Series [v1,1/2] arm64: dts: qcom: msm8916-alcatel-idol347: add GPIO torch LED | expand

Commit Message

Vincent Knecht Oct. 29, 2022, 2:55 p.m. UTC
Add support for torch LED on GPIO 32.

Signed-off-by: Vincent Knecht <vincent.knecht@mailoo.org>
---
 .../boot/dts/qcom/msm8916-alcatel-idol347.dts | 22 +++++++++++++++++++
 1 file changed, 22 insertions(+)

Comments

Krzysztof Kozlowski Nov. 3, 2022, 10:20 p.m. UTC | #1
On 29/10/2022 10:55, Vincent Knecht wrote:
> Add support for torch LED on GPIO 32.
> 
> Signed-off-by: Vincent Knecht <vincent.knecht@mailoo.org>
> ---
>  .../boot/dts/qcom/msm8916-alcatel-idol347.dts | 22 +++++++++++++++++++
>  1 file changed, 22 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/qcom/msm8916-alcatel-idol347.dts b/arch/arm64/boot/dts/qcom/msm8916-alcatel-idol347.dts
> index 3dc9619fde6e..3a0a593899ae 100644
> --- a/arch/arm64/boot/dts/qcom/msm8916-alcatel-idol347.dts
> +++ b/arch/arm64/boot/dts/qcom/msm8916-alcatel-idol347.dts
> @@ -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)";
> @@ -34,6 +35,19 @@ button-volume-up {
>  		};
>  	};
>  
> +	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>;
> @@ -276,6 +290,14 @@ gpio_keys_default: gpio-keys-default {
>  		bias-pull-up;
>  	};
>  
> +	gpio_leds_default: gpio-leds-default {

Node name: gpio-leds-default-state

Best regards,
Krzysztof
Bjorn Andersson Nov. 8, 2022, 1:27 a.m. UTC | #2
On Sat, 29 Oct 2022 16:55:56 +0200, Vincent Knecht wrote:
> Add support for torch LED on GPIO 32.
> 
> 

Applied, thanks!

[1/2] arm64: dts: qcom: msm8916-alcatel-idol347: add GPIO torch LED
      commit: 64323952aa5a14471a1225f2c1121aa5447c6ded
[2/2] arm64: dts: qcom: msm8916-alcatel-idol347: add LED indicator
      commit: 1c8cc183d07059d23d28c29a8e345464c4055127

Best regards,
diff mbox series

Patch

diff --git a/arch/arm64/boot/dts/qcom/msm8916-alcatel-idol347.dts b/arch/arm64/boot/dts/qcom/msm8916-alcatel-idol347.dts
index 3dc9619fde6e..3a0a593899ae 100644
--- a/arch/arm64/boot/dts/qcom/msm8916-alcatel-idol347.dts
+++ b/arch/arm64/boot/dts/qcom/msm8916-alcatel-idol347.dts
@@ -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)";
@@ -34,6 +35,19 @@  button-volume-up {
 		};
 	};
 
+	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>;
@@ -276,6 +290,14 @@  gpio_keys_default: gpio-keys-default {
 		bias-pull-up;
 	};
 
+	gpio_leds_default: gpio-leds-default {
+		pins = "gpio32";
+		function = "gpio";
+
+		drive-strength = <2>;
+		bias-disable;
+	};
+
 	gyro_int_default: gyro-int-default {
 		pins = "gpio97", "gpio98";
 		function = "gpio";