[3/5] arm64: dts: qcom: qrb4210-rb2: Add GPIO LEDs

Message ID 20230515-topic-rb2-bits-v1-3-a52d154a639d@linaro.org
State New
Headers
Series QTI RB2 features |

Commit Message

Konrad Dybcio May 15, 2023, 1:04 p.m. UTC
  Add the three LEDs (blue/yellow/green) connected to TLMM GPIOs.

Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
---
 arch/arm64/boot/dts/qcom/qrb4210-rb2.dts | 36 ++++++++++++++++++++++++++++++--
 1 file changed, 34 insertions(+), 2 deletions(-)
  

Comments

Bjorn Andersson May 18, 2023, 2:13 a.m. UTC | #1
On Mon, May 15, 2023 at 03:04:14PM +0200, Konrad Dybcio wrote:
> Add the three LEDs (blue/yellow/green) connected to TLMM GPIOs.
> 
> Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
> ---
>  arch/arm64/boot/dts/qcom/qrb4210-rb2.dts | 36 ++++++++++++++++++++++++++++++--
>  1 file changed, 34 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/arm64/boot/dts/qcom/qrb4210-rb2.dts b/arch/arm64/boot/dts/qcom/qrb4210-rb2.dts
> index 9b539720f05d..eeee268ebfe2 100644
> --- a/arch/arm64/boot/dts/qcom/qrb4210-rb2.dts
> +++ b/arch/arm64/boot/dts/qcom/qrb4210-rb2.dts
> @@ -5,6 +5,7 @@
>  
>  /dts-v1/;
>  
> +#include <dt-bindings/leds/common.h>
>  #include "sm4250.dtsi"
>  
>  / {
> @@ -30,6 +31,38 @@ hdmi_con: endpoint {
>  		};
>  	};
>  
> +	leds {
> +		compatible = "gpio-leds";
> +
> +		led-bt {
> +			label = "blue:bt";
> +			function = LED_FUNCTION_BLUETOOTH;
> +			color = <LED_COLOR_ID_BLUE>;
> +			gpios = <&tlmm 45 GPIO_ACTIVE_HIGH>;
> +			linux,default-trigger = "bluetooth-power";
> +			default-state = "off";
> +		};
> +
> +		led-user0 {
> +			label = "green:user0";
> +			function = LED_FUNCTION_INDICATOR;
> +			color = <LED_COLOR_ID_GREEN>;
> +			gpios = <&tlmm 52 GPIO_ACTIVE_HIGH>;
> +			linux,default-trigger = "none";
> +			default-state = "off";
> +			panic-indicator;
> +		};
> +
> +		led-wlan {
> +			label = "yellow:wlan";
> +			function = LED_FUNCTION_WLAN;
> +			color = <LED_COLOR_ID_YELLOW>;
> +			gpios = <&tlmm 47 GPIO_ACTIVE_HIGH>;
> +			linux,default-trigger = "phy0tx";
> +			default-state = "off";
> +		};
> +	};
> +
>  	vreg_hdmi_out_1p2: regulator-hdmi-out-1p2 {
>  		compatible = "regulator-fixed";
>  		regulator-name = "VREG_HDMI_OUT_1P2";
> @@ -385,8 +418,7 @@ &sleep_clk {
>  };
>  
>  &tlmm {
> -	gpio-reserved-ranges = <43 2>, <47 1>,
> -			       <49 1>, <52 1>, <54 1>,
> +	gpio-reserved-ranges = <43 2>, <49 1>, <54 1>,

How come pin 49 becomes inaccessible here? Was this intended for the
previous patch?

Regards,
Bjorn

>  			       <56 3>, <61 2>, <64 1>,
>  			       <68 1>, <72 8>, <96 1>;
>  
> 
> -- 
> 2.40.1
>
  
Konrad Dybcio May 18, 2023, 9:41 a.m. UTC | #2
On 18.05.2023 04:13, Bjorn Andersson wrote:
> On Mon, May 15, 2023 at 03:04:14PM +0200, Konrad Dybcio wrote:
>> Add the three LEDs (blue/yellow/green) connected to TLMM GPIOs.
>>
>> Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
>> ---
>>  arch/arm64/boot/dts/qcom/qrb4210-rb2.dts | 36 ++++++++++++++++++++++++++++++--
>>  1 file changed, 34 insertions(+), 2 deletions(-)
>>
>> diff --git a/arch/arm64/boot/dts/qcom/qrb4210-rb2.dts b/arch/arm64/boot/dts/qcom/qrb4210-rb2.dts
>> index 9b539720f05d..eeee268ebfe2 100644
>> --- a/arch/arm64/boot/dts/qcom/qrb4210-rb2.dts
>> +++ b/arch/arm64/boot/dts/qcom/qrb4210-rb2.dts
>> @@ -5,6 +5,7 @@
>>  
>>  /dts-v1/;
>>  
>> +#include <dt-bindings/leds/common.h>
>>  #include "sm4250.dtsi"
>>  
>>  / {
>> @@ -30,6 +31,38 @@ hdmi_con: endpoint {
>>  		};
>>  	};
>>  
>> +	leds {
>> +		compatible = "gpio-leds";
>> +
>> +		led-bt {
>> +			label = "blue:bt";
>> +			function = LED_FUNCTION_BLUETOOTH;
>> +			color = <LED_COLOR_ID_BLUE>;
>> +			gpios = <&tlmm 45 GPIO_ACTIVE_HIGH>;
>> +			linux,default-trigger = "bluetooth-power";
>> +			default-state = "off";
>> +		};
>> +
>> +		led-user0 {
>> +			label = "green:user0";
>> +			function = LED_FUNCTION_INDICATOR;
>> +			color = <LED_COLOR_ID_GREEN>;
>> +			gpios = <&tlmm 52 GPIO_ACTIVE_HIGH>;
>> +			linux,default-trigger = "none";
>> +			default-state = "off";
>> +			panic-indicator;
>> +		};
>> +
>> +		led-wlan {
>> +			label = "yellow:wlan";
>> +			function = LED_FUNCTION_WLAN;
>> +			color = <LED_COLOR_ID_YELLOW>;
>> +			gpios = <&tlmm 47 GPIO_ACTIVE_HIGH>;
>> +			linux,default-trigger = "phy0tx";
>> +			default-state = "off";
>> +		};
>> +	};
>> +
>>  	vreg_hdmi_out_1p2: regulator-hdmi-out-1p2 {
>>  		compatible = "regulator-fixed";
>>  		regulator-name = "VREG_HDMI_OUT_1P2";
>> @@ -385,8 +418,7 @@ &sleep_clk {
>>  };
>>  
>>  &tlmm {
>> -	gpio-reserved-ranges = <43 2>, <47 1>,
>> -			       <49 1>, <52 1>, <54 1>,
>> +	gpio-reserved-ranges = <43 2>, <49 1>, <54 1>,
> 
> How come pin 49 becomes inaccessible here? Was this intended for the
> previous patch?
It doesn't, the "remove" part of the diff is 2-lines.

This reserved-ranges is totally bogus since introduction.. I can send
a separate patch squaring it out.

Konrad

> 
> Regards,
> Bjorn
> 
>>  			       <56 3>, <61 2>, <64 1>,
>>  			       <68 1>, <72 8>, <96 1>;
>>  
>>
>> -- 
>> 2.40.1
>>
  

Patch

diff --git a/arch/arm64/boot/dts/qcom/qrb4210-rb2.dts b/arch/arm64/boot/dts/qcom/qrb4210-rb2.dts
index 9b539720f05d..eeee268ebfe2 100644
--- a/arch/arm64/boot/dts/qcom/qrb4210-rb2.dts
+++ b/arch/arm64/boot/dts/qcom/qrb4210-rb2.dts
@@ -5,6 +5,7 @@ 
 
 /dts-v1/;
 
+#include <dt-bindings/leds/common.h>
 #include "sm4250.dtsi"
 
 / {
@@ -30,6 +31,38 @@  hdmi_con: endpoint {
 		};
 	};
 
+	leds {
+		compatible = "gpio-leds";
+
+		led-bt {
+			label = "blue:bt";
+			function = LED_FUNCTION_BLUETOOTH;
+			color = <LED_COLOR_ID_BLUE>;
+			gpios = <&tlmm 45 GPIO_ACTIVE_HIGH>;
+			linux,default-trigger = "bluetooth-power";
+			default-state = "off";
+		};
+
+		led-user0 {
+			label = "green:user0";
+			function = LED_FUNCTION_INDICATOR;
+			color = <LED_COLOR_ID_GREEN>;
+			gpios = <&tlmm 52 GPIO_ACTIVE_HIGH>;
+			linux,default-trigger = "none";
+			default-state = "off";
+			panic-indicator;
+		};
+
+		led-wlan {
+			label = "yellow:wlan";
+			function = LED_FUNCTION_WLAN;
+			color = <LED_COLOR_ID_YELLOW>;
+			gpios = <&tlmm 47 GPIO_ACTIVE_HIGH>;
+			linux,default-trigger = "phy0tx";
+			default-state = "off";
+		};
+	};
+
 	vreg_hdmi_out_1p2: regulator-hdmi-out-1p2 {
 		compatible = "regulator-fixed";
 		regulator-name = "VREG_HDMI_OUT_1P2";
@@ -385,8 +418,7 @@  &sleep_clk {
 };
 
 &tlmm {
-	gpio-reserved-ranges = <43 2>, <47 1>,
-			       <49 1>, <52 1>, <54 1>,
+	gpio-reserved-ranges = <43 2>, <49 1>, <54 1>,
 			       <56 3>, <61 2>, <64 1>,
 			       <68 1>, <72 8>, <96 1>;