diff mbox series

[8/8] arm64: dts: qcom: sdm632-fairphone-fp3: Add notification LED

Message ID 20230414-pmi632-v1-8-fe94dc414832@z3ntu.xyz (mailing list archive)
State Superseded
Headers show
Series Add PMI632 PMIC and RGB LED on sdm632-fairphone-fp3 | expand

Commit Message

Luca Weiss April 13, 2023, 11:17 p.m. UTC
The phone features a notification LED connected to the pmi632. Configure
the RGB led found on it.

Signed-off-by: Luca Weiss <luca@z3ntu.xyz>
---
 arch/arm64/boot/dts/qcom/sdm632-fairphone-fp3.dts | 29 +++++++++++++++++++++++
 1 file changed, 29 insertions(+)

Comments

Konrad Dybcio April 13, 2023, 11:36 p.m. UTC | #1
On 14.04.2023 01:17, Luca Weiss wrote:
> The phone features a notification LED connected to the pmi632. Configure
> the RGB led found on it.
> 
> Signed-off-by: Luca Weiss <luca@z3ntu.xyz>
> ---
>  arch/arm64/boot/dts/qcom/sdm632-fairphone-fp3.dts | 29 +++++++++++++++++++++++
>  1 file changed, 29 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/qcom/sdm632-fairphone-fp3.dts b/arch/arm64/boot/dts/qcom/sdm632-fairphone-fp3.dts
> index 70e683b7e4fc..301eca9a4f31 100644
> --- a/arch/arm64/boot/dts/qcom/sdm632-fairphone-fp3.dts
> +++ b/arch/arm64/boot/dts/qcom/sdm632-fairphone-fp3.dts
> @@ -4,8 +4,10 @@
>   */
>  /dts-v1/;
>  
> +#include <dt-bindings/leds/common.h>
>  #include "sdm632.dtsi"
>  #include "pm8953.dtsi"
> +#include "pmi632.dtsi"
>  
>  / {
>  	model = "Fairphone 3";
> @@ -83,6 +85,33 @@ &pm8953_resin {
>  	linux,code = <KEY_VOLUMEDOWN>;
>  };
>  
> +&pmi632_lpg {
qcom,power-source?

Konrad
> +	status = "okay";
> +
> +	multi-led {
> +		color = <LED_COLOR_ID_RGB>;
> +		function = LED_FUNCTION_STATUS;
> +
> +		#address-cells = <1>;
> +		#size-cells = <0>;
> +
> +		led@1 {
> +			reg = <1>;
> +			color = <LED_COLOR_ID_RED>;
> +		};
> +
> +		led@2 {
> +			reg = <2>;
> +			color = <LED_COLOR_ID_GREEN>;
> +		};
> +
> +		led@3 {
> +			reg = <3>;
> +			color = <LED_COLOR_ID_BLUE>;
> +		};
> +	};
> +};
> +
>  &sdhc_1 {
>  	status = "okay";
>  	vmmc-supply = <&pm8953_l8>;
>
Pavel Machek April 14, 2023, 12:24 p.m. UTC | #2
On Fri 2023-04-14 01:17:52, Luca Weiss wrote:
> The phone features a notification LED connected to the pmi632. Configure
> the RGB led found on it.

Could you document the usage in Documentation/leds/well-known-leds.txt
so that all phones share the same name for the RGB notification LED?

Thanks,
								Pavel
Luca Weiss April 14, 2023, 3:48 p.m. UTC | #3
On Freitag, 14. April 2023 14:24:06 CEST Pavel Machek wrote:
> On Fri 2023-04-14 01:17:52, Luca Weiss wrote:
> > The phone features a notification LED connected to the pmi632. Configure
> > the RGB led found on it.
> 
> Could you document the usage in Documentation/leds/well-known-leds.txt
> so that all phones share the same name for the RGB notification LED?

This dts results in /sys/class/leds/rgb:status like (presumably) all of these 
existing in-tree users:
* qcom-msm8974-lge-nexus5-hammerhead.dts
* qcom-msm8974-sony-xperia-rhine.dtsi
* qcom-msm8974pro-fairphone-fp2.dts
* qcom-msm8974pro-sony-xperia-shinano-castor.dts
* freescale/imx8mq-librem5.dtsi
* qcom/msm8996-xiaomi-common.dtsi
* qcom/sdm630-sony-xperia-nile.dtsi
* qcom/sdm845-shift-axolotl.dts

However I can send a patch adding it to this txt doc since it doesn't seem to 
be there yet.

Regards
Luca

> 
> Thanks,
> 								
Pavel
Luca Weiss April 14, 2023, 3:49 p.m. UTC | #4
On Freitag, 14. April 2023 01:36:38 CEST Konrad Dybcio wrote:
> On 14.04.2023 01:17, Luca Weiss wrote:
> > The phone features a notification LED connected to the pmi632. Configure
> > the RGB led found on it.
> > 
> > Signed-off-by: Luca Weiss <luca@z3ntu.xyz>
> > ---
> > 
> >  arch/arm64/boot/dts/qcom/sdm632-fairphone-fp3.dts | 29
> >  +++++++++++++++++++++++ 1 file changed, 29 insertions(+)
> > 
> > diff --git a/arch/arm64/boot/dts/qcom/sdm632-fairphone-fp3.dts
> > b/arch/arm64/boot/dts/qcom/sdm632-fairphone-fp3.dts index
> > 70e683b7e4fc..301eca9a4f31 100644
> > --- a/arch/arm64/boot/dts/qcom/sdm632-fairphone-fp3.dts
> > +++ b/arch/arm64/boot/dts/qcom/sdm632-fairphone-fp3.dts
> > @@ -4,8 +4,10 @@
> > 
> >   */
> >  
> >  /dts-v1/;
> > 
> > +#include <dt-bindings/leds/common.h>
> > 
> >  #include "sdm632.dtsi"
> >  #include "pm8953.dtsi"
> > 
> > +#include "pmi632.dtsi"
> > 
> >  / {
> >  
> >  	model = "Fairphone 3";
> > 
> > @@ -83,6 +85,33 @@ &pm8953_resin {
> > 
> >  	linux,code = <KEY_VOLUMEDOWN>;
> >  
> >  };
> > 
> > +&pmi632_lpg {
> 
> qcom,power-source?

This property is only used if triled_has_src_sel is set in the driver (which 
it isn't on pmi632), only on pm8941 & pmi8994 it is set.

Regards
Luca

> 
> Konrad
> 
> > +	status = "okay";
> > +
> > +	multi-led {
> > +		color = <LED_COLOR_ID_RGB>;
> > +		function = LED_FUNCTION_STATUS;
> > +
> > +		#address-cells = <1>;
> > +		#size-cells = <0>;
> > +
> > +		led@1 {
> > +			reg = <1>;
> > +			color = <LED_COLOR_ID_RED>;
> > +		};
> > +
> > +		led@2 {
> > +			reg = <2>;
> > +			color = <LED_COLOR_ID_GREEN>;
> > +		};
> > +
> > +		led@3 {
> > +			reg = <3>;
> > +			color = <LED_COLOR_ID_BLUE>;
> > +		};
> > +	};
> > +};
> > +
> > 
> >  &sdhc_1 {
> >  
> >  	status = "okay";
> >  	vmmc-supply = <&pm8953_l8>;
diff mbox series

Patch

diff --git a/arch/arm64/boot/dts/qcom/sdm632-fairphone-fp3.dts b/arch/arm64/boot/dts/qcom/sdm632-fairphone-fp3.dts
index 70e683b7e4fc..301eca9a4f31 100644
--- a/arch/arm64/boot/dts/qcom/sdm632-fairphone-fp3.dts
+++ b/arch/arm64/boot/dts/qcom/sdm632-fairphone-fp3.dts
@@ -4,8 +4,10 @@ 
  */
 /dts-v1/;
 
+#include <dt-bindings/leds/common.h>
 #include "sdm632.dtsi"
 #include "pm8953.dtsi"
+#include "pmi632.dtsi"
 
 / {
 	model = "Fairphone 3";
@@ -83,6 +85,33 @@  &pm8953_resin {
 	linux,code = <KEY_VOLUMEDOWN>;
 };
 
+&pmi632_lpg {
+	status = "okay";
+
+	multi-led {
+		color = <LED_COLOR_ID_RGB>;
+		function = LED_FUNCTION_STATUS;
+
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		led@1 {
+			reg = <1>;
+			color = <LED_COLOR_ID_RED>;
+		};
+
+		led@2 {
+			reg = <2>;
+			color = <LED_COLOR_ID_GREEN>;
+		};
+
+		led@3 {
+			reg = <3>;
+			color = <LED_COLOR_ID_BLUE>;
+		};
+	};
+};
+
 &sdhc_1 {
 	status = "okay";
 	vmmc-supply = <&pm8953_l8>;