Skip to contentSkip to conversation

arm64: dts: qcom: pmi8998: add and enable flash LED controller

PATCH Superseded Dylan Van Assche 3 participants 7 messages May 18, 2023

Subsystems (4)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

v2 cover arm64: dts: qcom: pmi8998: add and enable flash LED controller

Qualcomm PMI8998 has support for 3 flash LEDs which got support in [1]. Add this driver to the PMI8998 DTS and enable 2 flash LEDs in the SHIFTPHONES SHIFT6mq smartphone. This smartphone has a white and yellow flash LED.

* Changelog *

Changes in v2:
- Document compatible for PMI8998 to fix missing compatible in DTS.
- Improved commit messages, following [2]

[1] https://lore.kernel.org/all/[email protected]
[2] https://lore.kernel.org/all/[email protected]/

Kind regards,
Dylan Van Assche

Dylan Van Assche (3):
dt-bindings: leds: qcom,spmi-flash-led: add PMI8998
arm64: dts: qcom: pmi8998: add flash LED controller
arm64: dts: qcom: sdm845-shift-axolotl: enable flash LEDs

 .../bindings/leds/qcom,spmi-flash-led.yaml    |  1 +
 arch/arm64/boot/dts/qcom/pmi8998.dtsi         |  6 +++++
 .../boot/dts/qcom/sdm845-shift-axolotl.dts    | 22 +++++++++++++++++++
 3 files changed, 29 insertions(+)
Signature · 1 line
2.40.1
#1 lore raw

PATCH v2 1/3 dt-bindings: leds: qcom,spmi-flash-led: add PMI8998

Document compatible for PMI8998 Torch and Flash LED controller.

---
 Documentation/devicetree/bindings/leds/qcom,spmi-flash-led.yaml | 1 +
 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/leds/qcom,spmi-flash-led.yaml +1 -0
index ffacf703d9f9..4b42b6950c88 100644
@@ -26,6 +26,7 @@ properties:
           - qcom,pm8150c-flash-led
           - qcom,pm8150l-flash-led
           - qcom,pm8350c-flash-led
+          - qcom,pmi8998-flash-led
       - const: qcom,spmi-flash-led
 
   reg:
Signature · 1 line
2.40.1
#3 lore raw

PATCH v2 2/3 arm64: dts: qcom: pmi8998: add flash LED controller

In reply to Dylan Van Assche

Qualcomm PMIC PMI8998 has a 3 channel flash LED driver which is used by many phones for 1 or 2 flash LEDs. Each LED can be used in flash mode or torch mode. Add the flash LED controller node to PMI8998 DTS.

---
 arch/arm64/boot/dts/qcom/pmi8998.dtsi | 6 ++++++
 1 file changed, 6 insertions(+)
arch/arm64/boot/dts/qcom/pmi8998.dtsi +6 -0
index ffe587f281d8..08e00819b39d 100644
@@ -60,6 +60,12 @@ pmi8998_lpg: pwm {
 			status = "disabled";
 		};
 
+		pmi8998_flash: led-controller@d300 {
+			compatible = "qcom,pmi8998-flash-led", "qcom,spmi-flash-led";
+			reg = <0xd300>;
+			status = "disabled";
+		};
+
 		pmi8998_wled: leds@d800 {
 			compatible = "qcom,pmi8998-wled";
 			reg = <0xd800>, <0xd900>;
Signature · 1 line
2.40.1
Reviewed-by on v2 2/3
#4 lore raw

Re: [PATCH v2 2/3] arm64: dts: qcom: pmi8998: add flash LED controller

Quoted 6 lines · Dylan Van Assche

Qualcomm PMIC PMI8998 has a 3 channel flash LED driver which is used by many phones for 1 or 2 flash LEDs. Each LED can be used in flash mode or torch mode. Add the flash LED controller node to PMI8998 DTS.

---

Best regards,
Krzysztof

#5 lore raw

PATCH v2 3/3 arm64: dts: qcom: sdm845-shift-axolotl: enable flash LEDs

In reply to Dylan Van Assche

The SHIFT6mq (axolotl) is an SDM845-based smartphone with 2 flash LEDs. One LED is white, the other one is yellow. Define both LEDs in the DTS so they can be used as flash or torch and enable the flash LED controller to control them in PMI8998.

---
 .../boot/dts/qcom/sdm845-shift-axolotl.dts    | 22 +++++++++++++++++++
 1 file changed, 22 insertions(+)
arch/arm64/boot/dts/qcom/sdm845-shift-axolotl.dts +22 -0
index 0ad891348e0c..e7fc0c3cae58 100644
@@ -554,6 +554,28 @@ led@5 {
 	};
 };
 
+&pmi8998_flash {
+	status = "okay";
+
+	led-0 {
+		function = LED_FUNCTION_FLASH;
+		color = <LED_COLOR_ID_WHITE>;
+		led-sources = <1>;
+		led-max-microamp = <180000>;
+		flash-max-microamp = <1000000>;
+		flash-max-timeout-us = <1280000>;
+	};
+
+	led-1 {
+		function = LED_FUNCTION_FLASH;
+		color = <LED_COLOR_ID_YELLOW>;
+		led-sources = <2>;
+		led-max-microamp = <180000>;
+		flash-max-microamp = <1000000>;
+		flash-max-timeout-us = <1280000>;
+	};
+};
+
 &qup_uart9_rx {
 	drive-strength = <2>;
 	bias-pull-up;
Signature · 1 line
2.40.1
Reviewed-by on v2 3/3
#6 lore raw

Re: [PATCH v2 3/3] arm64: dts: qcom: sdm845-shift-axolotl: enable flash LEDs

Quoted 7 lines · Dylan Van Assche

The SHIFT6mq (axolotl) is an SDM845-based smartphone with 2 flash LEDs. One LED is white, the other one is yellow. Define both LEDs in the DTS so they can be used as flash or torch and enable the flash LED controller to control them in PMI8998.

---

Konrad

Quoted 36 lines
 .../boot/dts/qcom/sdm845-shift-axolotl.dts    | 22 +++++++++++++++++++
 1 file changed, 22 insertions(+)
arch/arm64/boot/dts/qcom/sdm845-shift-axolotl.dts +22 -0
index 0ad891348e0c..e7fc0c3cae58 100644
@@ -554,6 +554,28 @@ led@5 {
 	};
 };
 
+&pmi8998_flash {
+	status = "okay";
+
+	led-0 {
+		function = LED_FUNCTION_FLASH;
+		color = <LED_COLOR_ID_WHITE>;
+		led-sources = <1>;
+		led-max-microamp = <180000>;
+		flash-max-microamp = <1000000>;
+		flash-max-timeout-us = <1280000>;
+	};
+
+	led-1 {
+		function = LED_FUNCTION_FLASH;
+		color = <LED_COLOR_ID_YELLOW>;
+		led-sources = <2>;
+		led-max-microamp = <180000>;
+		flash-max-microamp = <1000000>;
+		flash-max-timeout-us = <1280000>;
+	};
+};
+
 &qup_uart9_rx {
 	drive-strength = <2>;
 	bias-pull-up;