diff mbox series

[4/4] arm64: dts: qcom: db820c: Add user LEDs

Message ID 20220505022706.1692554-5-bjorn.andersson@linaro.org (mailing list archive)
State Accepted
Commit d1a405d2228f686a3fecf0f0374b61ae81d441aa
Headers show
Series arm64: dts: qcom: Add a few LPG LEDs | expand

Commit Message

Bjorn Andersson May 5, 2022, 2:27 a.m. UTC
The db820c has 4 "user LEDs", all connected to the PMI8994. The first
three are connected to the three current sinks provided by the TRILED
and the fourth is connected to MPP2.

By utilizing the DTEST bus the MPP is fed the control signal from the
fourth LPG block, providing a consistent interface to the user.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
---
 arch/arm64/boot/dts/qcom/apq8096-db820c.dts | 56 +++++++++++++++++++++
 1 file changed, 56 insertions(+)

Comments

Dmitry Baryshkov July 4, 2022, 4:33 p.m. UTC | #1
On 05/05/2022 05:27, Bjorn Andersson wrote:
> The db820c has 4 "user LEDs", all connected to the PMI8994. The first
> three are connected to the three current sinks provided by the TRILED
> and the fourth is connected to MPP2.
> 
> By utilizing the DTEST bus the MPP is fed the control signal from the
> fourth LPG block, providing a consistent interface to the user.
> 
> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>

> ---
>   arch/arm64/boot/dts/qcom/apq8096-db820c.dts | 56 +++++++++++++++++++++
>   1 file changed, 56 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/qcom/apq8096-db820c.dts b/arch/arm64/boot/dts/qcom/apq8096-db820c.dts
> index 56e54ce4d10e..e9039e68a095 100644
> --- a/arch/arm64/boot/dts/qcom/apq8096-db820c.dts
> +++ b/arch/arm64/boot/dts/qcom/apq8096-db820c.dts
> @@ -10,6 +10,7 @@
>   #include "pmi8994.dtsi"
>   #include <dt-bindings/input/input.h>
>   #include <dt-bindings/gpio/gpio.h>
> +#include <dt-bindings/leds/common.h>
>   #include <dt-bindings/pinctrl/qcom,pmic-gpio.h>
>   #include <dt-bindings/sound/qcom,q6afe.h>
>   #include <dt-bindings/sound/qcom,q6asm.h>
> @@ -683,6 +684,61 @@ pinconf {
>   	};
>   };
>   
> +&pmi8994_lpg {
> +	qcom,power-source = <1>;
> +
> +	pinctrl-names = "default";
> +	pinctrl-0 = <&pmi8994_mpp2_userled4>;
> +
> +	qcom,dtest = <0 0>,
> +		     <0 0>,
> +		     <0 0>,
> +		     <4 1>;
> +
> +	status = "okay";
> +
> +	led@1 {
> +		reg = <1>;
> +		color = <LED_COLOR_ID_GREEN>;
> +		function = LED_FUNCTION_HEARTBEAT;
> +		function-enumerator = <1>;
> +
> +		linux,default-trigger = "heartbeat";
> +		default-state = "on";
> +	};
> +
> +	led@2 {
> +		reg = <2>;
> +		color = <LED_COLOR_ID_GREEN>;
> +		function = LED_FUNCTION_HEARTBEAT;
> +		function-enumerator = <0>;
> +	};
> +
> +	led@3 {
> +		reg = <3>;
> +		color = <LED_COLOR_ID_GREEN>;
> +		function = LED_FUNCTION_HEARTBEAT;
> +		function-enumerator = <2>;
> +	};
> +
> +	led@4 {
> +		reg = <4>;
> +		color = <LED_COLOR_ID_GREEN>;
> +		function = LED_FUNCTION_HEARTBEAT;
> +		function-enumerator = <3>;
> +	};
> +};
> +
> +&pmi8994_mpps {
> +	pmi8994_mpp2_userled4: mpp2-userled4-state {
> +		pins = "mpp2";
> +		function = "sink";
> +
> +		output-low;
> +		qcom,dtest = <4>;
> +	};
> +};
> +
>   &pmi8994_spmi_regulators {
>   	vdd_s2-supply = <&vph_pwr>;
>
diff mbox series

Patch

diff --git a/arch/arm64/boot/dts/qcom/apq8096-db820c.dts b/arch/arm64/boot/dts/qcom/apq8096-db820c.dts
index 56e54ce4d10e..e9039e68a095 100644
--- a/arch/arm64/boot/dts/qcom/apq8096-db820c.dts
+++ b/arch/arm64/boot/dts/qcom/apq8096-db820c.dts
@@ -10,6 +10,7 @@ 
 #include "pmi8994.dtsi"
 #include <dt-bindings/input/input.h>
 #include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/leds/common.h>
 #include <dt-bindings/pinctrl/qcom,pmic-gpio.h>
 #include <dt-bindings/sound/qcom,q6afe.h>
 #include <dt-bindings/sound/qcom,q6asm.h>
@@ -683,6 +684,61 @@  pinconf {
 	};
 };
 
+&pmi8994_lpg {
+	qcom,power-source = <1>;
+
+	pinctrl-names = "default";
+	pinctrl-0 = <&pmi8994_mpp2_userled4>;
+
+	qcom,dtest = <0 0>,
+		     <0 0>,
+		     <0 0>,
+		     <4 1>;
+
+	status = "okay";
+
+	led@1 {
+		reg = <1>;
+		color = <LED_COLOR_ID_GREEN>;
+		function = LED_FUNCTION_HEARTBEAT;
+		function-enumerator = <1>;
+
+		linux,default-trigger = "heartbeat";
+		default-state = "on";
+	};
+
+	led@2 {
+		reg = <2>;
+		color = <LED_COLOR_ID_GREEN>;
+		function = LED_FUNCTION_HEARTBEAT;
+		function-enumerator = <0>;
+	};
+
+	led@3 {
+		reg = <3>;
+		color = <LED_COLOR_ID_GREEN>;
+		function = LED_FUNCTION_HEARTBEAT;
+		function-enumerator = <2>;
+	};
+
+	led@4 {
+		reg = <4>;
+		color = <LED_COLOR_ID_GREEN>;
+		function = LED_FUNCTION_HEARTBEAT;
+		function-enumerator = <3>;
+	};
+};
+
+&pmi8994_mpps {
+	pmi8994_mpp2_userled4: mpp2-userled4-state {
+		pins = "mpp2";
+		function = "sink";
+
+		output-low;
+		qcom,dtest = <4>;
+	};
+};
+
 &pmi8994_spmi_regulators {
 	vdd_s2-supply = <&vph_pwr>;