linux-leds.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/3] arm64: dts: qcom: pmi8998: add and enable flash LED controller
@ 2023-05-18 13:31 Dylan Van Assche
  2023-05-18 13:31 ` [PATCH v3 1/3] dt-bindings: leds: qcom,spmi-flash-led: add PMI8998 Dylan Van Assche
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Dylan Van Assche @ 2023-05-18 13:31 UTC (permalink / raw)
  To: agross, andersson, konrad.dybcio, pavel, lee, robh+dt,
	krzysztof.kozlowski+dt, conor+dt, quic_fenglinw
  Cc: linux-arm-msm, linux-leds, 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]

Changes in v3:
- Adjust led-max-microamp and flash-max-microamp to better match downstream.
- Add Acked-by and Reviewed-by tags

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

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

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>
---
 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 v3 3/3] arm64: dts: qcom: sdm845-shift-axolotl: enable flash LEDs
  2023-05-18 13:31 [PATCH v3 0/3] arm64: dts: qcom: pmi8998: add and enable flash LED controller Dylan Van Assche
  2023-05-18 13:31 ` [PATCH v3 1/3] dt-bindings: leds: qcom,spmi-flash-led: add PMI8998 Dylan Van Assche
  2023-05-18 13:31 ` [PATCH v3 2/3] arm64: dts: qcom: pmi8998: add flash LED controller Dylan Van Assche
@ 2023-05-18 13:31 ` Dylan Van Assche
  2023-05-18 14:06   ` Caleb Connolly
  2023-05-25  4:54 ` (subset) [PATCH v3 0/3] arm64: dts: qcom: pmi8998: add and enable flash LED controller Bjorn Andersson
  3 siblings, 1 reply; 7+ messages in thread
From: Dylan Van Assche @ 2023-05-18 13:31 UTC (permalink / raw)
  To: agross, andersson, konrad.dybcio, pavel, lee, robh+dt,
	krzysztof.kozlowski+dt, conor+dt, quic_fenglinw
  Cc: linux-arm-msm, linux-leds, 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>
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
---
 .../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..1eaff964b202 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 = <100000>;
+		flash-max-microamp = <1100000>;
+		flash-max-timeout-us = <1280000>;
+	};
+
+	led-1 {
+		function = LED_FUNCTION_FLASH;
+		color = <LED_COLOR_ID_YELLOW>;
+		led-sources = <2>;
+		led-max-microamp = <100000>;
+		flash-max-microamp = <1100000>;
+		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 v3 3/3] arm64: dts: qcom: sdm845-shift-axolotl: enable flash LEDs
  2023-05-18 13:31 ` [PATCH v3 3/3] arm64: dts: qcom: sdm845-shift-axolotl: enable flash LEDs Dylan Van Assche
@ 2023-05-18 14:06   ` Caleb Connolly
  0 siblings, 0 replies; 7+ messages in thread
From: Caleb Connolly @ 2023-05-18 14:06 UTC (permalink / raw)
  To: Dylan Van Assche, agross, andersson, konrad.dybcio, pavel, lee,
	robh+dt, krzysztof.kozlowski+dt, conor+dt, quic_fenglinw
  Cc: linux-arm-msm, linux-leds, devicetree, linux-kernel,
	~postmarketos/upstreaming, phone-devel, amartinz

On Thu May 18, 2023 at 2:31 PM BST, 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>

Reviewed-by: Caleb Connolly <caleb.connolly@linaro.org>

// Caleb (they/them)

> ---
>  .../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..1eaff964b202 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 = <100000>;
> +		flash-max-microamp = <1100000>;
> +		flash-max-timeout-us = <1280000>;
> +	};
> +
> +	led-1 {
> +		function = LED_FUNCTION_FLASH;
> +		color = <LED_COLOR_ID_YELLOW>;
> +		led-sources = <2>;
> +		led-max-microamp = <100000>;
> +		flash-max-microamp = <1100000>;
> +		flash-max-timeout-us = <1280000>;
> +	};
> +};
> +
>  &qup_uart9_rx {
>  	drive-strength = <2>;
>  	bias-pull-up;


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

* Re: (subset) [PATCH v3 0/3] arm64: dts: qcom: pmi8998: add and enable flash LED controller
  2023-05-18 13:31 [PATCH v3 0/3] arm64: dts: qcom: pmi8998: add and enable flash LED controller Dylan Van Assche
                   ` (2 preceding siblings ...)
  2023-05-18 13:31 ` [PATCH v3 3/3] arm64: dts: qcom: sdm845-shift-axolotl: enable flash LEDs Dylan Van Assche
@ 2023-05-25  4:54 ` Bjorn Andersson
  3 siblings, 0 replies; 7+ messages in thread
From: Bjorn Andersson @ 2023-05-25  4:54 UTC (permalink / raw)
  To: agross, quic_fenglinw, konrad.dybcio, Dylan Van Assche, conor+dt,
	robh+dt, pavel, krzysztof.kozlowski+dt, lee
  Cc: linux-kernel, linux-arm-msm, amartinz, devicetree, linux-leds,
	~postmarketos/upstreaming, phone-devel

On Thu, 18 May 2023 15:31:10 +0200, Dylan Van Assche wrote:
> 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]
> 
> [...]

Applied, thanks!

[2/3] arm64: dts: qcom: pmi8998: add flash LED controller
      commit: 9139bb56734a14c156d3ef736c22a06bd1a9d22c
[3/3] arm64: dts: qcom: sdm845-shift-axolotl: enable flash LEDs
      commit: 8587d217ec3c09268d2023758e5fd6dbc3529c2b

Best regards,
-- 
Bjorn Andersson <andersson@kernel.org>

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

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

On Thu, 18 May 2023, 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>
> ---
>  Documentation/devicetree/bindings/leds/qcom,spmi-flash-led.yaml | 1 +
>  1 file changed, 1 insertion(+)

Applied, thanks

-- 
Lee Jones [李琼斯]

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

end of thread, other threads:[~2023-05-25 11:55 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-18 13:31 [PATCH v3 0/3] arm64: dts: qcom: pmi8998: add and enable flash LED controller Dylan Van Assche
2023-05-18 13:31 ` [PATCH v3 1/3] dt-bindings: leds: qcom,spmi-flash-led: add PMI8998 Dylan Van Assche
2023-05-25 11:54   ` Lee Jones
2023-05-18 13:31 ` [PATCH v3 2/3] arm64: dts: qcom: pmi8998: add flash LED controller Dylan Van Assche
2023-05-18 13:31 ` [PATCH v3 3/3] arm64: dts: qcom: sdm845-shift-axolotl: enable flash LEDs Dylan Van Assche
2023-05-18 14:06   ` Caleb Connolly
2023-05-25  4:54 ` (subset) [PATCH v3 0/3] arm64: dts: qcom: pmi8998: add and enable flash LED controller Bjorn Andersson

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).