devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/3] arm64: dts: qcom: pmi8998: add and enable flash LED controller
@ 2023-05-18  6:13 Dylan Van Assche
  2023-05-18  6:13 ` [PATCH v2 1/3] dt-bindings: leds: qcom,spmi-flash-led: add PMI8998 Dylan Van Assche
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Dylan Van Assche @ 2023-05-18  6:13 UTC (permalink / raw)
  To: agross, andersson, konrad.dybcio, robh+dt, krzysztof.kozlowski+dt,
	conor+dt
  Cc: linux-arm-msm, devicetree, linux-kernel,
	~postmarketos/upstreaming, phone-devel, amartinz,
	Dylan Van Assche

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/20230507172941.364852-1-me@dylanvanassche.be
[2] https://lore.kernel.org/all/20230516150202.188655-1-krzysztof.kozlowski@linaro.org/

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(+)

-- 
2.40.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH v2 1/3] dt-bindings: leds: qcom,spmi-flash-led: add PMI8998
  2023-05-18  6:13 [PATCH v2 0/3] arm64: dts: qcom: pmi8998: add and enable flash LED controller Dylan Van Assche
@ 2023-05-18  6:13 ` Dylan Van Assche
  2023-05-18  7:19   ` Krzysztof Kozlowski
  2023-05-18  6:13 ` [PATCH v2 2/3] arm64: dts: qcom: pmi8998: add flash LED controller Dylan Van Assche
  2023-05-18  6:13 ` [PATCH v2 3/3] arm64: dts: qcom: sdm845-shift-axolotl: enable flash LEDs Dylan Van Assche
  2 siblings, 1 reply; 7+ messages in thread
From: Dylan Van Assche @ 2023-05-18  6:13 UTC (permalink / raw)
  To: agross, andersson, konrad.dybcio, robh+dt, krzysztof.kozlowski+dt,
	conor+dt
  Cc: linux-arm-msm, devicetree, linux-kernel,
	~postmarketos/upstreaming, phone-devel, amartinz,
	Dylan Van Assche

Document compatible for PMI8998 Torch and Flash LED controller.

Signed-off-by: Dylan Van Assche <me@dylanvanassche.be>
---
 Documentation/devicetree/bindings/leds/qcom,spmi-flash-led.yaml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/leds/qcom,spmi-flash-led.yaml b/Documentation/devicetree/bindings/leds/qcom,spmi-flash-led.yaml
index ffacf703d9f9..4b42b6950c88 100644
--- a/Documentation/devicetree/bindings/leds/qcom,spmi-flash-led.yaml
+++ b/Documentation/devicetree/bindings/leds/qcom,spmi-flash-led.yaml
@@ -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:
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH v2 2/3] arm64: dts: qcom: pmi8998: add flash LED controller
  2023-05-18  6:13 [PATCH v2 0/3] arm64: dts: qcom: pmi8998: add and enable flash LED controller Dylan Van Assche
  2023-05-18  6:13 ` [PATCH v2 1/3] dt-bindings: leds: qcom,spmi-flash-led: add PMI8998 Dylan Van Assche
@ 2023-05-18  6:13 ` Dylan Van Assche
  2023-05-18  7:19   ` Krzysztof Kozlowski
  2023-05-18  6:13 ` [PATCH v2 3/3] arm64: dts: qcom: sdm845-shift-axolotl: enable flash LEDs Dylan Van Assche
  2 siblings, 1 reply; 7+ messages in thread
From: Dylan Van Assche @ 2023-05-18  6:13 UTC (permalink / raw)
  To: agross, andersson, konrad.dybcio, robh+dt, krzysztof.kozlowski+dt,
	conor+dt
  Cc: linux-arm-msm, devicetree, linux-kernel,
	~postmarketos/upstreaming, phone-devel, amartinz,
	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.

Signed-off-by: Dylan Van Assche <me@dylanvanassche.be>
---
 arch/arm64/boot/dts/qcom/pmi8998.dtsi | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/pmi8998.dtsi b/arch/arm64/boot/dts/qcom/pmi8998.dtsi
index ffe587f281d8..08e00819b39d 100644
--- a/arch/arm64/boot/dts/qcom/pmi8998.dtsi
+++ b/arch/arm64/boot/dts/qcom/pmi8998.dtsi
@@ -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>;
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH v2 3/3] arm64: dts: qcom: sdm845-shift-axolotl: enable flash LEDs
  2023-05-18  6:13 [PATCH v2 0/3] arm64: dts: qcom: pmi8998: add and enable flash LED controller Dylan Van Assche
  2023-05-18  6:13 ` [PATCH v2 1/3] dt-bindings: leds: qcom,spmi-flash-led: add PMI8998 Dylan Van Assche
  2023-05-18  6:13 ` [PATCH v2 2/3] arm64: dts: qcom: pmi8998: add flash LED controller Dylan Van Assche
@ 2023-05-18  6:13 ` Dylan Van Assche
  2023-05-18 10:44   ` Konrad Dybcio
  2 siblings, 1 reply; 7+ messages in thread
From: Dylan Van Assche @ 2023-05-18  6:13 UTC (permalink / raw)
  To: agross, andersson, konrad.dybcio, robh+dt, krzysztof.kozlowski+dt,
	conor+dt
  Cc: linux-arm-msm, devicetree, linux-kernel,
	~postmarketos/upstreaming, phone-devel, amartinz,
	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.

Signed-off-by: Dylan Van Assche <me@dylanvanassche.be>
---
 .../boot/dts/qcom/sdm845-shift-axolotl.dts    | 22 +++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/sdm845-shift-axolotl.dts b/arch/arm64/boot/dts/qcom/sdm845-shift-axolotl.dts
index 0ad891348e0c..e7fc0c3cae58 100644
--- a/arch/arm64/boot/dts/qcom/sdm845-shift-axolotl.dts
+++ b/arch/arm64/boot/dts/qcom/sdm845-shift-axolotl.dts
@@ -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;
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH v2 1/3] dt-bindings: leds: qcom,spmi-flash-led: add PMI8998
  2023-05-18  6:13 ` [PATCH v2 1/3] dt-bindings: leds: qcom,spmi-flash-led: add PMI8998 Dylan Van Assche
@ 2023-05-18  7:19   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 7+ messages in thread
From: Krzysztof Kozlowski @ 2023-05-18  7:19 UTC (permalink / raw)
  To: Dylan Van Assche, agross, andersson, konrad.dybcio, robh+dt,
	krzysztof.kozlowski+dt, conor+dt
  Cc: linux-arm-msm, devicetree, linux-kernel,
	~postmarketos/upstreaming, phone-devel, amartinz

On 18/05/2023 08:13, Dylan Van Assche wrote:
> Document compatible for PMI8998 Torch and Flash LED controller.
> 
> Signed-off-by: Dylan Van Assche <me@dylanvanassche.be>
> ---

Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Best regards,
Krzysztof


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2 2/3] arm64: dts: qcom: pmi8998: add flash LED controller
  2023-05-18  6:13 ` [PATCH v2 2/3] arm64: dts: qcom: pmi8998: add flash LED controller Dylan Van Assche
@ 2023-05-18  7:19   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 7+ messages in thread
From: Krzysztof Kozlowski @ 2023-05-18  7:19 UTC (permalink / raw)
  To: Dylan Van Assche, agross, andersson, konrad.dybcio, robh+dt,
	krzysztof.kozlowski+dt, conor+dt
  Cc: linux-arm-msm, devicetree, linux-kernel,
	~postmarketos/upstreaming, phone-devel, amartinz

On 18/05/2023 08:13, Dylan Van Assche wrote:
> 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.
> 
> Signed-off-by: Dylan Van Assche <me@dylanvanassche.be>
> ---

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Best regards,
Krzysztof


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2 3/3] arm64: dts: qcom: sdm845-shift-axolotl: enable flash LEDs
  2023-05-18  6:13 ` [PATCH v2 3/3] arm64: dts: qcom: sdm845-shift-axolotl: enable flash LEDs Dylan Van Assche
@ 2023-05-18 10:44   ` Konrad Dybcio
  0 siblings, 0 replies; 7+ messages in thread
From: Konrad Dybcio @ 2023-05-18 10:44 UTC (permalink / raw)
  To: Dylan Van Assche, agross, andersson, robh+dt,
	krzysztof.kozlowski+dt, conor+dt
  Cc: linux-arm-msm, devicetree, linux-kernel,
	~postmarketos/upstreaming, phone-devel, amartinz



On 18.05.2023 08:13, Dylan Van Assche wrote:
> 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.
> 
> Signed-off-by: Dylan Van Assche <me@dylanvanassche.be>
> ---
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>

Konrad
>  .../boot/dts/qcom/sdm845-shift-axolotl.dts    | 22 +++++++++++++++++++
>  1 file changed, 22 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/qcom/sdm845-shift-axolotl.dts b/arch/arm64/boot/dts/qcom/sdm845-shift-axolotl.dts
> index 0ad891348e0c..e7fc0c3cae58 100644
> --- a/arch/arm64/boot/dts/qcom/sdm845-shift-axolotl.dts
> +++ b/arch/arm64/boot/dts/qcom/sdm845-shift-axolotl.dts
> @@ -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;

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2023-05-18 10:45 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-18  6:13 [PATCH v2 0/3] arm64: dts: qcom: pmi8998: add and enable flash LED controller Dylan Van Assche
2023-05-18  6:13 ` [PATCH v2 1/3] dt-bindings: leds: qcom,spmi-flash-led: add PMI8998 Dylan Van Assche
2023-05-18  7:19   ` Krzysztof Kozlowski
2023-05-18  6:13 ` [PATCH v2 2/3] arm64: dts: qcom: pmi8998: add flash LED controller Dylan Van Assche
2023-05-18  7:19   ` Krzysztof Kozlowski
2023-05-18  6:13 ` [PATCH v2 3/3] arm64: dts: qcom: sdm845-shift-axolotl: enable flash LEDs Dylan Van Assche
2023-05-18 10:44   ` Konrad Dybcio

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).