Skip to contentSkip to conversation

leds: qcom-lpg: Add support for PMI8950 PWM

PATCH Superseded Gianluca Boiano 3 participants 12 messages Feb 24, 2024 – Feb 26, 2024

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/3 leds: qcom-lpg: Add support for PMI8950 PWM

The PMI8950 PMIC contains 1 PWM channel

---
 drivers/leds/rgb/leds-qcom-lpg.c | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/leds/rgb/leds-qcom-lpg.c +8 -0
index 6bdc5b923f98..9467c796bd04 100644
@@ -1693,6 +1693,13 @@ static const struct lpg_data pm8941_lpg_data = {
 	},
 };
 
+static const struct lpg_data pmi8950_pwm_data = {
+	.num_channels = 1,
+	.channels = (const struct lpg_channel_data[]) {
+		{ .base = 0xb000 },
+	},
+};
+
 static const struct lpg_data pm8994_lpg_data = {
 	.lut_base = 0xb000,
 	.lut_size = 64,
@@ -1819,6 +1826,7 @@ static const struct of_device_id lpg_of_table[] = {
 	{ .compatible = "qcom,pm8941-lpg", .data = &pm8941_lpg_data },
 	{ .compatible = "qcom,pm8994-lpg", .data = &pm8994_lpg_data },
 	{ .compatible = "qcom,pmi632-lpg", .data = &pmi632_lpg_data },
+	{ .compatible = "qcom,pmi8950-pwm", .data = &pmi8950_pwm_data },
 	{ .compatible = "qcom,pmi8994-lpg", .data = &pmi8994_lpg_data },
 	{ .compatible = "qcom,pmi8998-lpg", .data = &pmi8998_lpg_data },
 	{ .compatible = "qcom,pmc8180c-lpg", .data = &pm8150l_lpg_data },
Signature · 1 line
2.44.0
#1 lore raw

PATCH 2/3 dt-bindings: leds: leds-qcom-lpg: Add support for PMI8950 PWM

Update leds-qcom-lpg binding to support PMI8950 PWM.

---
 Documentation/devicetree/bindings/leds/leds-qcom-lpg.yaml | 1 +
 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/leds/leds-qcom-lpg.yaml +1 -0
index 6649ca2ec805..ea617fad5a4e 100644
@@ -27,6 +27,7 @@ properties:
           - qcom,pm8994-lpg
           - qcom,pmc8180c-lpg
           - qcom,pmi632-lpg
+          - qcom,pmi8950-pwm
           - qcom,pmi8994-lpg
           - qcom,pmi8998-lpg
           - qcom,pmk8550-pwm
Signature · 1 line
2.44.0
#2 lore raw

Re: [PATCH 2/3] dt-bindings: leds: leds-qcom-lpg: Add support for PMI8950 PWM

Quoted 12 lines · Gianluca Boiano

Update leds-qcom-lpg binding to support PMI8950 PWM.

---
 Documentation/devicetree/bindings/leds/leds-qcom-lpg.yaml | 1 +
 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/leds/leds-qcom-lpg.yaml +0 -0
index 6649ca2ec805..ea617fad5a4e 100644

Documentation/devicetree/bindings/leds/leds-qcom-lpg.yaml properties: · line 30

Quoted 4 lines
Documentation/devicetree/bindings/leds/leds-qcom-lpg.yaml +1 -0
@@ -27,6 +27,7 @@ properties:
           - qcom,pm8994-lpg
           - qcom,pmc8180c-lpg
           - qcom,pmi632-lpg
+          - qcom,pmi8950-pwm

You will need to update the if: as well. Last commit Anjelique Melendez made there a bit of a mess... Please rebase on top of:
https://lore.kernel.org/linux-devicetree/[email protected]/T/#t

Best regards,
Krzysztof

#3 lore raw

PATCH v2 1/3 leds: qcom-lpg: Add support for PMI8950 PWM

The PMI8950 PMIC contains 1 PWM channel

---
 drivers/leds/rgb/leds-qcom-lpg.c | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/leds/rgb/leds-qcom-lpg.c +8 -0
index 6bdc5b923f98..9467c796bd04 100644
@@ -1693,6 +1693,13 @@ static const struct lpg_data pm8941_lpg_data = {
 	},
 };
 
+static const struct lpg_data pmi8950_pwm_data = {
+	.num_channels = 1,
+	.channels = (const struct lpg_channel_data[]) {
+		{ .base = 0xb000 },
+	},
+};
+
 static const struct lpg_data pm8994_lpg_data = {
 	.lut_base = 0xb000,
 	.lut_size = 64,
@@ -1819,6 +1826,7 @@ static const struct of_device_id lpg_of_table[] = {
 	{ .compatible = "qcom,pm8941-lpg", .data = &pm8941_lpg_data },
 	{ .compatible = "qcom,pm8994-lpg", .data = &pm8994_lpg_data },
 	{ .compatible = "qcom,pmi632-lpg", .data = &pmi632_lpg_data },
+	{ .compatible = "qcom,pmi8950-pwm", .data = &pmi8950_pwm_data },
 	{ .compatible = "qcom,pmi8994-lpg", .data = &pmi8994_lpg_data },
 	{ .compatible = "qcom,pmi8998-lpg", .data = &pmi8998_lpg_data },
 	{ .compatible = "qcom,pmc8180c-lpg", .data = &pm8150l_lpg_data },
Signature · 1 line
2.44.0
#4 lore raw

PATCH v2 2/3 arm64: dts: qcom: pmi8950: add pwm node

This node is actually found on some msm8953 devices (xiaomi-mido) and allows irled enablement

---
 arch/arm64/boot/dts/qcom/pmi8950.dtsi | 8 ++++++++
 1 file changed, 8 insertions(+)
arch/arm64/boot/dts/qcom/pmi8950.dtsi +8 -0
index 1029f3b1bb9a..b4822cb17a37 100644
@@ -84,6 +84,14 @@ pmic@3 {
 		#address-cells = <1>;
 		#size-cells = <0>;
 
+		pmi8950_pwm: pwm@b000 {
+			compatible = "qcom,pmi8950-pwm";
+			reg = <0xb000 0x100>;
+			#pwm-cells = <2>;
+
+			status = "disabled";
+		};
+
 		pmi8950_wled: leds@d800 {
 			compatible = "qcom,pmi8950-wled";
 			reg = <0xd800>, <0xd900>;
Signature · 1 line
2.44.0
#5 lore raw

PATCH v2 3/3 dt-bindings: leds: leds-qcom-lpg: Add support for PMI8950 PWM

In reply to Gianluca Boiano

Update leds-qcom-lpg binding to support PMI8950 PWM.

---
Changes in v2:
- Add missing entry for if
- Rebase on top of https://lore.kernel.org/linux-devicetree/[email protected]/T/#t
- Link to v1: https://lore.kernel.org/all/[email protected]/

---
 Documentation/devicetree/bindings/leds/leds-qcom-lpg.yaml | 2 ++
 1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/leds/leds-qcom-lpg.yaml +2 -0
index 6649ca2ec805..e93e9b30660b 100644
@@ -27,6 +27,7 @@ properties:
           - qcom,pm8994-lpg
           - qcom,pmc8180c-lpg
           - qcom,pmi632-lpg
+          - qcom,pmi8950-pwm
           - qcom,pmi8994-lpg
           - qcom,pmi8998-lpg
           - qcom,pmk8550-pwm
@@ -148,6 +149,7 @@ allOf:
             enum:
               - qcom,pm8350c-pwm
               - qcom,pm8550-pwm
+              - qcom,pmi8950-pwm
     then:
       properties:
         nvmem:
Signature · 1 line
2.44.0
#7 lore raw

PATCH 1/3 leds: qcom-lpg: Add support for PMI8950 PWM

In reply to Krzysztof Kozlowski

The PMI8950 PMIC contains 1 PWM channel

---
 drivers/leds/rgb/leds-qcom-lpg.c | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/leds/rgb/leds-qcom-lpg.c +8 -0
index 6bdc5b923f98..9467c796bd04 100644
@@ -1693,6 +1693,13 @@ static const struct lpg_data pm8941_lpg_data = {
 	},
 };
 
+static const struct lpg_data pmi8950_pwm_data = {
+	.num_channels = 1,
+	.channels = (const struct lpg_channel_data[]) {
+		{ .base = 0xb000 },
+	},
+};
+
 static const struct lpg_data pm8994_lpg_data = {
 	.lut_base = 0xb000,
 	.lut_size = 64,
@@ -1819,6 +1826,7 @@ static const struct of_device_id lpg_of_table[] = {
 	{ .compatible = "qcom,pm8941-lpg", .data = &pm8941_lpg_data },
 	{ .compatible = "qcom,pm8994-lpg", .data = &pm8994_lpg_data },
 	{ .compatible = "qcom,pmi632-lpg", .data = &pmi632_lpg_data },
+	{ .compatible = "qcom,pmi8950-pwm", .data = &pmi8950_pwm_data },
 	{ .compatible = "qcom,pmi8994-lpg", .data = &pmi8994_lpg_data },
 	{ .compatible = "qcom,pmi8998-lpg", .data = &pmi8998_lpg_data },
 	{ .compatible = "qcom,pmc8180c-lpg", .data = &pm8150l_lpg_data },
Signature · 1 line
2.44.0
#8 lore raw

PATCH 2/3 arm64: dts: qcom: pmi8950: add pwm node

This node is actually found on some msm8953 devices (xiaomi-mido) and allows irled enablement

---
 arch/arm64/boot/dts/qcom/pmi8950.dtsi | 8 ++++++++
 1 file changed, 8 insertions(+)
arch/arm64/boot/dts/qcom/pmi8950.dtsi +8 -0
index 1029f3b1bb9a..b4822cb17a37 100644
@@ -84,6 +84,14 @@ pmic@3 {
 		#address-cells = <1>;
 		#size-cells = <0>;
 
+		pmi8950_pwm: pwm@b000 {
+			compatible = "qcom,pmi8950-pwm";
+			reg = <0xb000 0x100>;
+			#pwm-cells = <2>;
+
+			status = "disabled";
+		};
+
 		pmi8950_wled: leds@d800 {
 			compatible = "qcom,pmi8950-wled";
 			reg = <0xd800>, <0xd900>;
Signature · 1 line
2.44.0
#9 lore raw

PATCH 3/3 dt-bindings: leds: leds-qcom-lpg: Add support for PMI8950 PWM

In reply to Gianluca Boiano

Update leds-qcom-lpg binding to support PMI8950 PWM.

---
Changes:
- Add missing entry for if
- Rebase on top of https://lore.kernel.org/linux-devicetree/[email protected]/T/#t

---
 Documentation/devicetree/bindings/leds/leds-qcom-lpg.yaml | 2 ++
 1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/leds/leds-qcom-lpg.yaml +2 -0
index 6649ca2ec805..e93e9b30660b 100644
@@ -27,6 +27,7 @@ properties:
           - qcom,pm8994-lpg
           - qcom,pmc8180c-lpg
           - qcom,pmi632-lpg
+          - qcom,pmi8950-pwm
           - qcom,pmi8994-lpg
           - qcom,pmi8998-lpg
           - qcom,pmk8550-pwm
@@ -148,6 +149,7 @@ allOf:
             enum:
               - qcom,pm8350c-pwm
               - qcom,pm8550-pwm
+              - qcom,pmi8950-pwm
     then:
       properties:
         nvmem:
Signature · 1 line
2.44.0
#10 lore raw

Re: [PATCH 3/3] dt-bindings: leds: leds-qcom-lpg: Add support for PMI8950 PWM

Quoted 5 lines · Gianluca Boiano

Update leds-qcom-lpg binding to support PMI8950 PWM.

---
Changes:

Three different patchsets, two with random versioning, all attached to one thread.

Sorry, that's just confusing.
1. Version your patchsets.
2. Send them as separate thread.

Just use b4 and avoid half of review complains...

Best regards,
Krzysztof

#11 lore raw

PATCH 3/3 arm64: dts: qcom: pmi8950: add pwm node

In reply to Gianluca Boiano

This node is actually found on some msm8953 devices (xiaomi-mido) and allows irled enablement

---
 arch/arm64/boot/dts/qcom/pmi8950.dtsi | 8 ++++++++
 1 file changed, 8 insertions(+)
arch/arm64/boot/dts/qcom/pmi8950.dtsi +8 -0
index 1029f3b1bb9a..b4822cb17a37 100644
@@ -84,6 +84,14 @@ pmic@3 {
 		#address-cells = <1>;
 		#size-cells = <0>;
 
+		pmi8950_pwm: pwm@b000 {
+			compatible = "qcom,pmi8950-pwm";
+			reg = <0xb000 0x100>;
+			#pwm-cells = <2>;
+
+			status = "disabled";
+		};
+
 		pmi8950_wled: leds@d800 {
 			compatible = "qcom,pmi8950-wled";
 			reg = <0xd800>, <0xd900>;
Signature · 1 line
2.44.0