2022-05-05 18:16:33

by Bjorn Andersson

[permalink] [raw]
Subject: [PATCH 0/4] arm64: dts: qcom: Add a few LPG LEDs

Now that the LPG binding is accepted, sprinkle some lpg definitions in various
PMIC files and define the LPG attached LEDs for RB3 and db820c.

Bjorn Andersson (4):
arm64: dts: qcom: Add LPG to pm8916, pm8994, pmi8994 and pmi8998
arm64: dts: qcom: sdm845: Enable user LEDs on DB845c
arm64: dts: qcom: pmi8994: Define MPP block
arm64: dts: qcom: db820c: Add user LEDs

arch/arm64/boot/dts/qcom/apq8096-db820c.dts | 56 +++++++++++++++++++++
arch/arm64/boot/dts/qcom/pm8916.dtsi | 8 +++
arch/arm64/boot/dts/qcom/pm8994.dtsi | 10 ++++
arch/arm64/boot/dts/qcom/pmi8994.dtsi | 20 ++++++++
arch/arm64/boot/dts/qcom/pmi8998.dtsi | 11 +++-
arch/arm64/boot/dts/qcom/sdm845-db845c.dts | 31 ++++++++++++
6 files changed, 135 insertions(+), 1 deletion(-)

--
2.35.1



2022-05-05 18:19:58

by Bjorn Andersson

[permalink] [raw]
Subject: [PATCH 1/4] arm64: dts: qcom: Add LPG to pm8916, pm8994, pmi8994 and pmi8998

Add PWM/LPG nodes to the PMICs currently supported by the binding.

Signed-off-by: Bjorn Andersson <[email protected]>
---
arch/arm64/boot/dts/qcom/pm8916.dtsi | 8 ++++++++
arch/arm64/boot/dts/qcom/pm8994.dtsi | 10 ++++++++++
arch/arm64/boot/dts/qcom/pmi8994.dtsi | 10 ++++++++++
arch/arm64/boot/dts/qcom/pmi8998.dtsi | 11 ++++++++++-
4 files changed, 38 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/qcom/pm8916.dtsi b/arch/arm64/boot/dts/qcom/pm8916.dtsi
index d58902432812..99bf8387bfb6 100644
--- a/arch/arm64/boot/dts/qcom/pm8916.dtsi
+++ b/arch/arm64/boot/dts/qcom/pm8916.dtsi
@@ -125,6 +125,14 @@ pm8916_1: pmic@1 {
#address-cells = <1>;
#size-cells = <0>;

+ pm8916_pwm: pwm {
+ compatible = "qcom,pm8916-pwm";
+
+ #pwm-cells = <2>;
+
+ status = "disabled";
+ };
+
pm8916_vib: vibrator@c000 {
compatible = "qcom,pm8916-vib";
reg = <0xc000>;
diff --git a/arch/arm64/boot/dts/qcom/pm8994.dtsi b/arch/arm64/boot/dts/qcom/pm8994.dtsi
index 5ab46117d737..ab342397fcd8 100644
--- a/arch/arm64/boot/dts/qcom/pm8994.dtsi
+++ b/arch/arm64/boot/dts/qcom/pm8994.dtsi
@@ -135,6 +135,16 @@ pmic@1 {
#address-cells = <1>;
#size-cells = <0>;

+ pm8994_lpg: lpg {
+ compatible = "qcom,pm8994-lpg";
+
+ #address-cells = <1>;
+ #size-cells = <0>;
+ #pwm-cells = <2>;
+
+ status = "disabled";
+ };
+
pm8994_spmi_regulators: regulators {
compatible = "qcom,pm8994-regulators";
};
diff --git a/arch/arm64/boot/dts/qcom/pmi8994.dtsi b/arch/arm64/boot/dts/qcom/pmi8994.dtsi
index 6e7c252568e6..b1b50c99ada2 100644
--- a/arch/arm64/boot/dts/qcom/pmi8994.dtsi
+++ b/arch/arm64/boot/dts/qcom/pmi8994.dtsi
@@ -27,6 +27,16 @@ pmic@3 {
#address-cells = <1>;
#size-cells = <0>;

+ pmi8994_lpg: lpg {
+ compatible = "qcom,pmi8994-lpg";
+
+ #address-cells = <1>;
+ #size-cells = <0>;
+ #pwm-cells = <2>;
+
+ status = "disabled";
+ };
+
pmi8994_spmi_regulators: regulators {
compatible = "qcom,pmi8994-regulators";
#address-cells = <1>;
diff --git a/arch/arm64/boot/dts/qcom/pmi8998.dtsi b/arch/arm64/boot/dts/qcom/pmi8998.dtsi
index 0fef5f113f05..7af106683f8d 100644
--- a/arch/arm64/boot/dts/qcom/pmi8998.dtsi
+++ b/arch/arm64/boot/dts/qcom/pmi8998.dtsi
@@ -42,6 +42,16 @@ lab: lab {
};
};

+ pmi8998_lpg: lpg {
+ compatible = "qcom,pmi8998-lpg";
+
+ #address-cells = <1>;
+ #size-cells = <0>;
+ #pwm-cells = <2>;
+
+ status = "disabled";
+ };
+
pmi8998_wled: leds@d800 {
compatible = "qcom,pmi8998-wled";
reg = <0xd800 0xd900>;
@@ -52,6 +62,5 @@ pmi8998_wled: leds@d800 {

status = "disabled";
};
-
};
};
--
2.35.1


2022-05-07 15:39:10

by Bjorn Andersson

[permalink] [raw]
Subject: [PATCH 3/4] arm64: dts: qcom: pmi8994: Define MPP block

The pmi8994 has 4 multi-purpose-pins, add these to the definition.

Signed-off-by: Bjorn Andersson <[email protected]>
---
arch/arm64/boot/dts/qcom/pmi8994.dtsi | 10 ++++++++++
1 file changed, 10 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/pmi8994.dtsi b/arch/arm64/boot/dts/qcom/pmi8994.dtsi
index b1b50c99ada2..0dfdd42f6f55 100644
--- a/arch/arm64/boot/dts/qcom/pmi8994.dtsi
+++ b/arch/arm64/boot/dts/qcom/pmi8994.dtsi
@@ -19,6 +19,16 @@ pmi8994_gpios: gpios@c000 {
interrupt-controller;
#interrupt-cells = <2>;
};
+
+ pmi8994_mpps: mpps@a000 {
+ compatible = "qcom,pmi8994-mpp";
+ reg = <0xa000>;
+ gpio-controller;
+ gpio-ranges = <&pmi8994_mpps 0 0 4>;
+ #gpio-cells = <2>;
+ interrupt-controller;
+ #interrupt-cells = <2>;
+ };
};

pmic@3 {
--
2.35.1


2022-05-09 06:40:14

by Bjorn Andersson

[permalink] [raw]
Subject: [PATCH 2/4] arm64: dts: qcom: sdm845: Enable user LEDs on DB845c

The DB845c has 4 "user LEDs", the last one is already supported as it's
just wired to a gpio. Now that the LPG binding is in place we can wire
up the other 3 LEDs as well.

Signed-off-by: Bjorn Andersson <[email protected]>
---
arch/arm64/boot/dts/qcom/sdm845-db845c.dts | 31 ++++++++++++++++++++++
1 file changed, 31 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/sdm845-db845c.dts b/arch/arm64/boot/dts/qcom/sdm845-db845c.dts
index 194ebeb3259c..e4d3de0a1e6d 100644
--- a/arch/arm64/boot/dts/qcom/sdm845-db845c.dts
+++ b/arch/arm64/boot/dts/qcom/sdm845-db845c.dts
@@ -5,6 +5,7 @@

/dts-v1/;

+#include <dt-bindings/leds/common.h>
#include <dt-bindings/pinctrl/qcom,pmic-gpio.h>
#include <dt-bindings/regulator/qcom,rpmh-regulator.h>
#include <dt-bindings/sound/qcom,q6afe.h>
@@ -606,6 +607,36 @@ resin {
};
};

+&pmi8998_lpg {
+ status = "okay";
+
+ qcom,power-source = <1>;
+
+ led@3 {
+ reg = <3>;
+ color = <LED_COLOR_ID_GREEN>;
+ function = LED_FUNCTION_HEARTBEAT;
+ function-enumerator = <3>;
+
+ linux,default-trigger = "heartbeat";
+ default-state = "on";
+ };
+
+ led@4 {
+ reg = <4>;
+ color = <LED_COLOR_ID_GREEN>;
+ function = LED_FUNCTION_INDICATOR;
+ function-enumerator = <2>;
+ };
+
+ led@5 {
+ reg = <5>;
+ color = <LED_COLOR_ID_GREEN>;
+ function = LED_FUNCTION_INDICATOR;
+ function-enumerator = <1>;
+ };
+};
+
/* QUAT I2S Uses 4 I2S SD Lines for audio on LT9611 HDMI Bridge */
&q6afedai {
qi2s@22 {
--
2.35.1


2022-05-30 13:44:01

by Pavel Machek

[permalink] [raw]
Subject: Re: [PATCH 2/4] arm64: dts: qcom: sdm845: Enable user LEDs on DB845c

Hi!

> The DB845c has 4 "user LEDs", the last one is already supported as it's
> just wired to a gpio. Now that the LPG binding is in place we can wire
> up the other 3 LEDs as well.


> +&pmi8998_lpg {
> + status = "okay";
> +
> + qcom,power-source = <1>;
> +
> + led@3 {
> + reg = <3>;
> + color = <LED_COLOR_ID_GREEN>;
> + function = LED_FUNCTION_HEARTBEAT;
> + function-enumerator = <3>;
> +
> + linux,default-trigger = "heartbeat";
> + default-state = "on";
> + };
> +
> + led@4 {
> + reg = <4>;
> + color = <LED_COLOR_ID_GREEN>;
> + function = LED_FUNCTION_INDICATOR;
> + function-enumerator = <2>;
> + };
> +
> + led@5 {
> + reg = <5>;
> + color = <LED_COLOR_ID_GREEN>;
> + function = LED_FUNCTION_INDICATOR;
> + function-enumerator = <1>;
> + };

Do the LEDs have some kind of markings? Marking them as "indicator" is not too useful.

Best regards,
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

2022-06-30 04:02:07

by Bjorn Andersson

[permalink] [raw]
Subject: Re: [PATCH 2/4] arm64: dts: qcom: sdm845: Enable user LEDs on DB845c

On Mon 30 May 02:06 CDT 2022, Pavel Machek wrote:

> Hi!
>
> > The DB845c has 4 "user LEDs", the last one is already supported as it's
> > just wired to a gpio. Now that the LPG binding is in place we can wire
> > up the other 3 LEDs as well.
>
>
> > +&pmi8998_lpg {
> > + status = "okay";
> > +
> > + qcom,power-source = <1>;
> > +
> > + led@3 {
> > + reg = <3>;
> > + color = <LED_COLOR_ID_GREEN>;
> > + function = LED_FUNCTION_HEARTBEAT;
> > + function-enumerator = <3>;
> > +
> > + linux,default-trigger = "heartbeat";
> > + default-state = "on";
> > + };
> > +
> > + led@4 {
> > + reg = <4>;
> > + color = <LED_COLOR_ID_GREEN>;
> > + function = LED_FUNCTION_INDICATOR;
> > + function-enumerator = <2>;
> > + };
> > +
> > + led@5 {
> > + reg = <5>;
> > + color = <LED_COLOR_ID_GREEN>;
> > + function = LED_FUNCTION_INDICATOR;
> > + function-enumerator = <1>;
> > + };
>
> Do the LEDs have some kind of markings? Marking them as "indicator" is not too useful.
>

Unfortunately no, there is just 4 green LEDs tightly packed together (3
driven by the lpg, 1 by a gpio), with no indications of which is which.

Regards,
Bjorn

2022-07-01 06:20:47

by Dylan Van Assche

[permalink] [raw]
Subject: Re: [PATCH 0/4] arm64: dts: qcom: Add a few LPG LEDs

On Wed, 2022-05-04 at 19:27 -0700, Bjorn Andersson wrote:
> Now that the LPG binding is accepted, sprinkle some lpg definitions
> in various
> PMIC files and define the LPG attached LEDs for RB3 and db820c.
>
> Bjorn Andersson (4):
>   arm64: dts: qcom: Add LPG to pm8916, pm8994, pmi8994 and pmi8998
>   arm64: dts: qcom: sdm845: Enable user LEDs on DB845c
>   arm64: dts: qcom: pmi8994: Define MPP block
>   arm64: dts: qcom: db820c: Add user LEDs
>
>  arch/arm64/boot/dts/qcom/apq8096-db820c.dts | 56
> +++++++++++++++++++++
>  arch/arm64/boot/dts/qcom/pm8916.dtsi        |  8 +++
>  arch/arm64/boot/dts/qcom/pm8994.dtsi        | 10 ++++
>  arch/arm64/boot/dts/qcom/pmi8994.dtsi       | 20 ++++++++
>  arch/arm64/boot/dts/qcom/pmi8998.dtsi       | 11 +++-
>  arch/arm64/boot/dts/qcom/sdm845-db845c.dts  | 31 ++++++++++++
>  6 files changed, 135 insertions(+), 1 deletion(-)
>

Changes look good to me, I applied similar changes here:
https://patchwork.kernel.org/project/linux-arm-msm/patch/[email protected]/

Reviewed-by: Dylan Van Assche <[email protected]>

Thanks!
Dylan

2022-07-01 18:52:34

by Caleb Connolly

[permalink] [raw]
Subject: Re: [PATCH 1/4] arm64: dts: qcom: Add LPG to pm8916, pm8994, pmi8994 and pmi8998



On 05/05/2022 03:27, Bjorn Andersson wrote:
> Add PWM/LPG nodes to the PMICs currently supported by the binding.
>
> Signed-off-by: Bjorn Andersson <[email protected]>
fwiw:
Reviewed-by: Caleb Connolly <[email protected]>
> ---
> arch/arm64/boot/dts/qcom/pm8916.dtsi | 8 ++++++++
> arch/arm64/boot/dts/qcom/pm8994.dtsi | 10 ++++++++++
> arch/arm64/boot/dts/qcom/pmi8994.dtsi | 10 ++++++++++
> arch/arm64/boot/dts/qcom/pmi8998.dtsi | 11 ++++++++++-
> 4 files changed, 38 insertions(+), 1 deletion(-)
>
> diff --git a/arch/arm64/boot/dts/qcom/pm8916.dtsi b/arch/arm64/boot/dts/qcom/pm8916.dtsi
> index d58902432812..99bf8387bfb6 100644
> --- a/arch/arm64/boot/dts/qcom/pm8916.dtsi
> +++ b/arch/arm64/boot/dts/qcom/pm8916.dtsi
> @@ -125,6 +125,14 @@ pm8916_1: pmic@1 {
> #address-cells = <1>;
> #size-cells = <0>;
>
> + pm8916_pwm: pwm {
> + compatible = "qcom,pm8916-pwm";
> +
> + #pwm-cells = <2>;
> +
> + status = "disabled";
> + };
> +
> pm8916_vib: vibrator@c000 {
> compatible = "qcom,pm8916-vib";
> reg = <0xc000>;
> diff --git a/arch/arm64/boot/dts/qcom/pm8994.dtsi b/arch/arm64/boot/dts/qcom/pm8994.dtsi
> index 5ab46117d737..ab342397fcd8 100644
> --- a/arch/arm64/boot/dts/qcom/pm8994.dtsi
> +++ b/arch/arm64/boot/dts/qcom/pm8994.dtsi
> @@ -135,6 +135,16 @@ pmic@1 {
> #address-cells = <1>;
> #size-cells = <0>;
>
> + pm8994_lpg: lpg {
> + compatible = "qcom,pm8994-lpg";
> +
> + #address-cells = <1>;
> + #size-cells = <0>;
> + #pwm-cells = <2>;
> +
> + status = "disabled";
> + };
> +
> pm8994_spmi_regulators: regulators {
> compatible = "qcom,pm8994-regulators";
> };
> diff --git a/arch/arm64/boot/dts/qcom/pmi8994.dtsi b/arch/arm64/boot/dts/qcom/pmi8994.dtsi
> index 6e7c252568e6..b1b50c99ada2 100644
> --- a/arch/arm64/boot/dts/qcom/pmi8994.dtsi
> +++ b/arch/arm64/boot/dts/qcom/pmi8994.dtsi
> @@ -27,6 +27,16 @@ pmic@3 {
> #address-cells = <1>;
> #size-cells = <0>;
>
> + pmi8994_lpg: lpg {
> + compatible = "qcom,pmi8994-lpg";
> +
> + #address-cells = <1>;
> + #size-cells = <0>;
> + #pwm-cells = <2>;
> +
> + status = "disabled";
> + };
> +
> pmi8994_spmi_regulators: regulators {
> compatible = "qcom,pmi8994-regulators";
> #address-cells = <1>;
> diff --git a/arch/arm64/boot/dts/qcom/pmi8998.dtsi b/arch/arm64/boot/dts/qcom/pmi8998.dtsi
> index 0fef5f113f05..7af106683f8d 100644
> --- a/arch/arm64/boot/dts/qcom/pmi8998.dtsi
> +++ b/arch/arm64/boot/dts/qcom/pmi8998.dtsi
> @@ -42,6 +42,16 @@ lab: lab {
> };
> };
>
> + pmi8998_lpg: lpg {
> + compatible = "qcom,pmi8998-lpg";
> +
> + #address-cells = <1>;
> + #size-cells = <0>;
> + #pwm-cells = <2>;
> +
> + status = "disabled";
> + };
> +
> pmi8998_wled: leds@d800 {
> compatible = "qcom,pmi8998-wled";
> reg = <0xd800 0xd900>;
> @@ -52,6 +62,5 @@ pmi8998_wled: leds@d800 {
>
> status = "disabled";
> };
> -
> };
> };
> --
> 2.35.1
>

--
Kind Regards,
Caleb

2022-07-01 19:06:18

by Caleb Connolly

[permalink] [raw]
Subject: Re: [PATCH 2/4] arm64: dts: qcom: sdm845: Enable user LEDs on DB845c



On 05/05/2022 03:27, Bjorn Andersson wrote:
> The DB845c has 4 "user LEDs", the last one is already supported as it's
> just wired to a gpio. Now that the LPG binding is in place we can wire
> up the other 3 LEDs as well.
>
> Signed-off-by: Bjorn Andersson <[email protected]>
Reviewed-by: Caleb Connolly <[email protected]>
> ---
> arch/arm64/boot/dts/qcom/sdm845-db845c.dts | 31 ++++++++++++++++++++++
> 1 file changed, 31 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/qcom/sdm845-db845c.dts b/arch/arm64/boot/dts/qcom/sdm845-db845c.dts
> index 194ebeb3259c..e4d3de0a1e6d 100644
> --- a/arch/arm64/boot/dts/qcom/sdm845-db845c.dts
> +++ b/arch/arm64/boot/dts/qcom/sdm845-db845c.dts
> @@ -5,6 +5,7 @@
>
> /dts-v1/;
>
> +#include <dt-bindings/leds/common.h>
> #include <dt-bindings/pinctrl/qcom,pmic-gpio.h>
> #include <dt-bindings/regulator/qcom,rpmh-regulator.h>
> #include <dt-bindings/sound/qcom,q6afe.h>
> @@ -606,6 +607,36 @@ resin {
> };
> };
>
> +&pmi8998_lpg {
> + status = "okay";
> +
> + qcom,power-source = <1>;
> +
> + led@3 {
> + reg = <3>;
> + color = <LED_COLOR_ID_GREEN>;
> + function = LED_FUNCTION_HEARTBEAT;
> + function-enumerator = <3>;
> +
> + linux,default-trigger = "heartbeat";
> + default-state = "on";
> + };
> +
> + led@4 {
> + reg = <4>;
> + color = <LED_COLOR_ID_GREEN>;
> + function = LED_FUNCTION_INDICATOR;
> + function-enumerator = <2>;
> + };
> +
> + led@5 {
> + reg = <5>;
> + color = <LED_COLOR_ID_GREEN>;
> + function = LED_FUNCTION_INDICATOR;
> + function-enumerator = <1>;
> + };
> +};
> +
> /* QUAT I2S Uses 4 I2S SD Lines for audio on LT9611 HDMI Bridge */
> &q6afedai {
> qi2s@22 {
> --
> 2.35.1
>

--
Kind Regards,
Caleb

2022-07-04 17:17:42

by Dmitry Baryshkov

[permalink] [raw]
Subject: Re: [PATCH 3/4] arm64: dts: qcom: pmi8994: Define MPP block

On 05/05/2022 05:27, Bjorn Andersson wrote:
> The pmi8994 has 4 multi-purpose-pins, add these to the definition.
>
> Signed-off-by: Bjorn Andersson <[email protected]>

Reviewed-by: Dmitry Baryshkov <[email protected]>

> ---
> arch/arm64/boot/dts/qcom/pmi8994.dtsi | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/qcom/pmi8994.dtsi b/arch/arm64/boot/dts/qcom/pmi8994.dtsi
> index b1b50c99ada2..0dfdd42f6f55 100644
> --- a/arch/arm64/boot/dts/qcom/pmi8994.dtsi
> +++ b/arch/arm64/boot/dts/qcom/pmi8994.dtsi
> @@ -19,6 +19,16 @@ pmi8994_gpios: gpios@c000 {
> interrupt-controller;
> #interrupt-cells = <2>;
> };
> +
> + pmi8994_mpps: mpps@a000 {
> + compatible = "qcom,pmi8994-mpp";
> + reg = <0xa000>;
> + gpio-controller;
> + gpio-ranges = <&pmi8994_mpps 0 0 4>;
> + #gpio-cells = <2>;
> + interrupt-controller;
> + #interrupt-cells = <2>;
> + };
> };
>
> pmic@3 {


--
With best wishes
Dmitry

2022-07-07 02:32:39

by Bjorn Andersson

[permalink] [raw]
Subject: Re: [PATCH 0/4] arm64: dts: qcom: Add a few LPG LEDs

On Wed, 4 May 2022 19:27:02 -0700, Bjorn Andersson wrote:
> Now that the LPG binding is accepted, sprinkle some lpg definitions in various
> PMIC files and define the LPG attached LEDs for RB3 and db820c.
>
> Bjorn Andersson (4):
> arm64: dts: qcom: Add LPG to pm8916, pm8994, pmi8994 and pmi8998
> arm64: dts: qcom: sdm845: Enable user LEDs on DB845c
> arm64: dts: qcom: pmi8994: Define MPP block
> arm64: dts: qcom: db820c: Add user LEDs
>
> [...]

Applied, thanks!

[1/4] arm64: dts: qcom: Add LPG to pm8916, pm8994, pmi8994 and pmi8998
commit: e79a1385ab74451e2e61efd5e59de3c1d3b4cd05
[2/4] arm64: dts: qcom: sdm845: Enable user LEDs on DB845c
commit: f23f1fa880bfbf47404aef9aaaff1dc7804d4df7
[3/4] arm64: dts: qcom: pmi8994: Define MPP block
commit: f041bb3cd77fb68b59cbec8031bfe65eeff15823
[4/4] arm64: dts: qcom: db820c: Add user LEDs
commit: d1a405d2228f686a3fecf0f0374b61ae81d441aa

Best regards,
--
Bjorn Andersson <[email protected]>