All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] Add PM6150L flash LED to Fairphone 4
@ 2022-12-09 13:54 Luca Weiss
  2022-12-09 13:54 ` [PATCH 1/3] dt-bindings: leds: spmi-flash-led: Add pm6150l compatible Luca Weiss
                   ` (3 more replies)
  0 siblings, 4 replies; 19+ messages in thread
From: Luca Weiss @ 2022-12-09 13:54 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson, Konrad Dybcio, Pavel Machek,
	Rob Herring, Krzysztof Kozlowski
  Cc: Fenglin Wu, linux-arm-msm, linux-leds, devicetree, linux-kernel,
	Luca Weiss

These patches add the necessary nodes and configuration for supporting the
flash LED found on the Fairphone 4 that's powered by the pm6150l flash led
block.

This depends on the patches by Fenglin Wu adding the driver, the latest
revision can be found at [0].

[0] https://lore.kernel.org/linux-arm-msm/20221110065420.2451436-1-quic_fenglinw@quicinc.com/

To: Andy Gross <agross@kernel.org>
To: Bjorn Andersson <andersson@kernel.org>
To: Konrad Dybcio <konrad.dybcio@linaro.org>
To: Pavel Machek <pavel@ucw.cz>
To: Rob Herring <robh+dt@kernel.org>
To: Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>
Cc: Fenglin Wu <quic_fenglinw@quicinc.com>
Cc: linux-arm-msm@vger.kernel.org
Cc: linux-leds@vger.kernel.org
Cc: devicetree@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>

---
Luca Weiss (3):
      dt-bindings: leds: spmi-flash-led: Add pm6150l compatible
      arm64: dts: qcom: pm6150l: add spmi-flash-led node
      arm64: dts: qcom: sm7225-fairphone-fp4: configure flash LED

 .../bindings/leds/qcom,spmi-flash-led.yaml         |  1 +
 arch/arm64/boot/dts/qcom/pm6150l.dtsi              |  6 ++++++
 arch/arm64/boot/dts/qcom/sm7225-fairphone-fp4.dts  | 23 ++++++++++++++++++++++
 3 files changed, 30 insertions(+)
---
base-commit: 0392f3ea67781a215382d2dba7d172d83d4aa37b
change-id: 20221209-fp4-pm6150l-flash-c450e8f6c568

Best regards,
-- 
Luca Weiss <luca.weiss@fairphone.com>

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

* [PATCH 1/3] dt-bindings: leds: spmi-flash-led: Add pm6150l compatible
  2022-12-09 13:54 [PATCH 0/3] Add PM6150L flash LED to Fairphone 4 Luca Weiss
@ 2022-12-09 13:54 ` Luca Weiss
  2022-12-09 15:01   ` Krzysztof Kozlowski
                     ` (2 more replies)
  2022-12-09 13:54 ` [PATCH 2/3] arm64: dts: qcom: pm6150l: add spmi-flash-led node Luca Weiss
                   ` (2 subsequent siblings)
  3 siblings, 3 replies; 19+ messages in thread
From: Luca Weiss @ 2022-12-09 13:54 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson, Konrad Dybcio, Pavel Machek,
	Rob Herring, Krzysztof Kozlowski
  Cc: Fenglin Wu, linux-arm-msm, linux-leds, devicetree, linux-kernel,
	Luca Weiss

Add the compatible for the flash-led block found on pm6150l PMIC.

Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
---
 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 1b273aecaaec..ffacf703d9f9 100644
--- a/Documentation/devicetree/bindings/leds/qcom,spmi-flash-led.yaml
+++ b/Documentation/devicetree/bindings/leds/qcom,spmi-flash-led.yaml
@@ -22,6 +22,7 @@ properties:
   compatible:
     items:
       - enum:
+          - qcom,pm6150l-flash-led
           - qcom,pm8150c-flash-led
           - qcom,pm8150l-flash-led
           - qcom,pm8350c-flash-led

-- 
2.38.1

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

* [PATCH 2/3] arm64: dts: qcom: pm6150l: add spmi-flash-led node
  2022-12-09 13:54 [PATCH 0/3] Add PM6150L flash LED to Fairphone 4 Luca Weiss
  2022-12-09 13:54 ` [PATCH 1/3] dt-bindings: leds: spmi-flash-led: Add pm6150l compatible Luca Weiss
@ 2022-12-09 13:54 ` Luca Weiss
  2022-12-10 12:32   ` Konrad Dybcio
  2022-12-10 17:14   ` Pavel Machek
  2022-12-09 13:54 ` [PATCH 3/3] arm64: dts: qcom: sm7225-fairphone-fp4: configure flash LED Luca Weiss
  2022-12-28  4:36 ` (subset) [PATCH 0/3] Add PM6150L flash LED to Fairphone 4 Bjorn Andersson
  3 siblings, 2 replies; 19+ messages in thread
From: Luca Weiss @ 2022-12-09 13:54 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson, Konrad Dybcio, Pavel Machek,
	Rob Herring, Krzysztof Kozlowski
  Cc: Fenglin Wu, linux-arm-msm, linux-leds, devicetree, linux-kernel,
	Luca Weiss

Add a node describing the flash block found on pm6150l.

Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
---
 arch/arm64/boot/dts/qcom/pm6150l.dtsi | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/pm6150l.dtsi b/arch/arm64/boot/dts/qcom/pm6150l.dtsi
index 90aac61ad264..86e659fcbba6 100644
--- a/arch/arm64/boot/dts/qcom/pm6150l.dtsi
+++ b/arch/arm64/boot/dts/qcom/pm6150l.dtsi
@@ -112,6 +112,12 @@ pm6150l_lsid5: pmic@5 {
 		#address-cells = <1>;
 		#size-cells = <0>;
 
+		pm6150l_flash: led-controller@d300 {
+			compatible = "qcom,pm6150l-flash-led", "qcom,spmi-flash-led";
+			reg = <0xd300>;
+			status = "disabled";
+		};
+
 		pm6150l_wled: leds@d800 {
 			compatible = "qcom,pm6150l-wled";
 			reg = <0xd800>, <0xd900>;

-- 
2.38.1

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

* [PATCH 3/3] arm64: dts: qcom: sm7225-fairphone-fp4: configure flash LED
  2022-12-09 13:54 [PATCH 0/3] Add PM6150L flash LED to Fairphone 4 Luca Weiss
  2022-12-09 13:54 ` [PATCH 1/3] dt-bindings: leds: spmi-flash-led: Add pm6150l compatible Luca Weiss
  2022-12-09 13:54 ` [PATCH 2/3] arm64: dts: qcom: pm6150l: add spmi-flash-led node Luca Weiss
@ 2022-12-09 13:54 ` Luca Weiss
  2022-12-10 12:33   ` Konrad Dybcio
  2022-12-10 17:16   ` Pavel Machek
  2022-12-28  4:36 ` (subset) [PATCH 0/3] Add PM6150L flash LED to Fairphone 4 Bjorn Andersson
  3 siblings, 2 replies; 19+ messages in thread
From: Luca Weiss @ 2022-12-09 13:54 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson, Konrad Dybcio, Pavel Machek,
	Rob Herring, Krzysztof Kozlowski
  Cc: Fenglin Wu, linux-arm-msm, linux-leds, devicetree, linux-kernel,
	Luca Weiss

Configure the pm6150l flash node for the dual flash LEDs found on FP4.

Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
---
 arch/arm64/boot/dts/qcom/sm7225-fairphone-fp4.dts | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/sm7225-fairphone-fp4.dts b/arch/arm64/boot/dts/qcom/sm7225-fairphone-fp4.dts
index c456e9594ea5..fef7d1d02925 100644
--- a/arch/arm64/boot/dts/qcom/sm7225-fairphone-fp4.dts
+++ b/arch/arm64/boot/dts/qcom/sm7225-fairphone-fp4.dts
@@ -7,6 +7,7 @@
 
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/input/input.h>
+#include <dt-bindings/leds/common.h>
 #include <dt-bindings/pinctrl/qcom,pmic-gpio.h>
 #include <dt-bindings/regulator/qcom,rpmh-regulator.h>
 #include "sm7225.dtsi"
@@ -367,6 +368,28 @@ &mpss {
 	firmware-name = "qcom/sm7225/fairphone4/modem.mdt";
 };
 
+&pm6150l_flash {
+	status = "okay";
+
+	led-0 {
+		function = LED_FUNCTION_FLASH;
+		color = <LED_COLOR_ID_YELLOW>;
+		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_WHITE>;
+		led-sources = <2>;
+		led-max-microamp = <180000>;
+		flash-max-microamp = <1000000>;
+		flash-max-timeout-us = <1280000>;
+	};
+};
+
 &pm6150l_wled {
 	status = "okay";
 

-- 
2.38.1

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

* Re: [PATCH 1/3] dt-bindings: leds: spmi-flash-led: Add pm6150l compatible
  2022-12-09 13:54 ` [PATCH 1/3] dt-bindings: leds: spmi-flash-led: Add pm6150l compatible Luca Weiss
@ 2022-12-09 15:01   ` Krzysztof Kozlowski
  2022-12-23 12:42   ` Lee Jones
  2023-03-17  7:51   ` Lee Jones
  2 siblings, 0 replies; 19+ messages in thread
From: Krzysztof Kozlowski @ 2022-12-09 15:01 UTC (permalink / raw)
  To: Luca Weiss, Andy Gross, Bjorn Andersson, Konrad Dybcio,
	Pavel Machek, Rob Herring, Krzysztof Kozlowski
  Cc: Fenglin Wu, linux-arm-msm, linux-leds, devicetree, linux-kernel

On 09/12/2022 14:54, Luca Weiss wrote:
> Add the compatible for the flash-led block found on pm6150l PMIC.
> 
> Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
> ---
>  Documentation/devicetree/bindings/leds/qcom,spmi-flash-led.yaml | 1 +
>  1 file changed, 1 insertion(+)


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

Best regards,
Krzysztof


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

* Re: [PATCH 2/3] arm64: dts: qcom: pm6150l: add spmi-flash-led node
  2022-12-09 13:54 ` [PATCH 2/3] arm64: dts: qcom: pm6150l: add spmi-flash-led node Luca Weiss
@ 2022-12-10 12:32   ` Konrad Dybcio
  2022-12-10 17:14   ` Pavel Machek
  1 sibling, 0 replies; 19+ messages in thread
From: Konrad Dybcio @ 2022-12-10 12:32 UTC (permalink / raw)
  To: Luca Weiss, Andy Gross, Bjorn Andersson, Pavel Machek,
	Rob Herring, Krzysztof Kozlowski
  Cc: Fenglin Wu, linux-arm-msm, linux-leds, devicetree, linux-kernel



On 9.12.2022 14:54, Luca Weiss wrote:
> Add a node describing the flash block found on pm6150l.
> 
> Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
> ---
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>

Konrad
>  arch/arm64/boot/dts/qcom/pm6150l.dtsi | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/qcom/pm6150l.dtsi b/arch/arm64/boot/dts/qcom/pm6150l.dtsi
> index 90aac61ad264..86e659fcbba6 100644
> --- a/arch/arm64/boot/dts/qcom/pm6150l.dtsi
> +++ b/arch/arm64/boot/dts/qcom/pm6150l.dtsi
> @@ -112,6 +112,12 @@ pm6150l_lsid5: pmic@5 {
>  		#address-cells = <1>;
>  		#size-cells = <0>;
>  
> +		pm6150l_flash: led-controller@d300 {
> +			compatible = "qcom,pm6150l-flash-led", "qcom,spmi-flash-led";
> +			reg = <0xd300>;
> +			status = "disabled";
> +		};
> +
>  		pm6150l_wled: leds@d800 {
>  			compatible = "qcom,pm6150l-wled";
>  			reg = <0xd800>, <0xd900>;
> 

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

* Re: [PATCH 3/3] arm64: dts: qcom: sm7225-fairphone-fp4: configure flash LED
  2022-12-09 13:54 ` [PATCH 3/3] arm64: dts: qcom: sm7225-fairphone-fp4: configure flash LED Luca Weiss
@ 2022-12-10 12:33   ` Konrad Dybcio
  2022-12-10 17:16   ` Pavel Machek
  1 sibling, 0 replies; 19+ messages in thread
From: Konrad Dybcio @ 2022-12-10 12:33 UTC (permalink / raw)
  To: Luca Weiss, Andy Gross, Bjorn Andersson, Pavel Machek,
	Rob Herring, Krzysztof Kozlowski
  Cc: Fenglin Wu, linux-arm-msm, linux-leds, devicetree, linux-kernel



On 9.12.2022 14:54, Luca Weiss wrote:
> Configure the pm6150l flash node for the dual flash LEDs found on FP4.
> 
> Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
> ---
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>

Konrad
>  arch/arm64/boot/dts/qcom/sm7225-fairphone-fp4.dts | 23 +++++++++++++++++++++++
>  1 file changed, 23 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/qcom/sm7225-fairphone-fp4.dts b/arch/arm64/boot/dts/qcom/sm7225-fairphone-fp4.dts
> index c456e9594ea5..fef7d1d02925 100644
> --- a/arch/arm64/boot/dts/qcom/sm7225-fairphone-fp4.dts
> +++ b/arch/arm64/boot/dts/qcom/sm7225-fairphone-fp4.dts
> @@ -7,6 +7,7 @@
>  
>  #include <dt-bindings/gpio/gpio.h>
>  #include <dt-bindings/input/input.h>
> +#include <dt-bindings/leds/common.h>
>  #include <dt-bindings/pinctrl/qcom,pmic-gpio.h>
>  #include <dt-bindings/regulator/qcom,rpmh-regulator.h>
>  #include "sm7225.dtsi"
> @@ -367,6 +368,28 @@ &mpss {
>  	firmware-name = "qcom/sm7225/fairphone4/modem.mdt";
>  };
>  
> +&pm6150l_flash {
> +	status = "okay";
> +
> +	led-0 {
> +		function = LED_FUNCTION_FLASH;
> +		color = <LED_COLOR_ID_YELLOW>;
> +		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_WHITE>;
> +		led-sources = <2>;
> +		led-max-microamp = <180000>;
> +		flash-max-microamp = <1000000>;
> +		flash-max-timeout-us = <1280000>;
> +	};
> +};
> +
>  &pm6150l_wled {
>  	status = "okay";
>  
> 

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

* Re: [PATCH 2/3] arm64: dts: qcom: pm6150l: add spmi-flash-led node
  2022-12-09 13:54 ` [PATCH 2/3] arm64: dts: qcom: pm6150l: add spmi-flash-led node Luca Weiss
  2022-12-10 12:32   ` Konrad Dybcio
@ 2022-12-10 17:14   ` Pavel Machek
  1 sibling, 0 replies; 19+ messages in thread
From: Pavel Machek @ 2022-12-10 17:14 UTC (permalink / raw)
  To: Luca Weiss
  Cc: Andy Gross, Bjorn Andersson, Konrad Dybcio, Rob Herring,
	Krzysztof Kozlowski, Fenglin Wu, linux-arm-msm, linux-leds,
	devicetree, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1011 bytes --]

On Fri 2022-12-09 14:54:07, Luca Weiss wrote:
> Add a node describing the flash block found on pm6150l.
> 
> Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>

Acked-by: Pavel Machek <pavel@ucw.cz>


> ---
>  arch/arm64/boot/dts/qcom/pm6150l.dtsi | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/qcom/pm6150l.dtsi b/arch/arm64/boot/dts/qcom/pm6150l.dtsi
> index 90aac61ad264..86e659fcbba6 100644
> --- a/arch/arm64/boot/dts/qcom/pm6150l.dtsi
> +++ b/arch/arm64/boot/dts/qcom/pm6150l.dtsi
> @@ -112,6 +112,12 @@ pm6150l_lsid5: pmic@5 {
>  		#address-cells = <1>;
>  		#size-cells = <0>;
>  
> +		pm6150l_flash: led-controller@d300 {
> +			compatible = "qcom,pm6150l-flash-led", "qcom,spmi-flash-led";
> +			reg = <0xd300>;
> +			status = "disabled";
> +		};
> +
>  		pm6150l_wled: leds@d800 {
>  			compatible = "qcom,pm6150l-wled";
>  			reg = <0xd800>, <0xd900>;
> 


-- 
People of Russia, stop Putin before his war on Ukraine escalates.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

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

* Re: [PATCH 3/3] arm64: dts: qcom: sm7225-fairphone-fp4: configure flash LED
  2022-12-09 13:54 ` [PATCH 3/3] arm64: dts: qcom: sm7225-fairphone-fp4: configure flash LED Luca Weiss
  2022-12-10 12:33   ` Konrad Dybcio
@ 2022-12-10 17:16   ` Pavel Machek
  2022-12-12 13:59     ` Luca Weiss
  1 sibling, 1 reply; 19+ messages in thread
From: Pavel Machek @ 2022-12-10 17:16 UTC (permalink / raw)
  To: Luca Weiss
  Cc: Andy Gross, Bjorn Andersson, Konrad Dybcio, Rob Herring,
	Krzysztof Kozlowski, Fenglin Wu, linux-arm-msm, linux-leds,
	devicetree, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 683 bytes --]

Hi!

> Configure the pm6150l flash node for the dual flash LEDs found on FP4.

> +&pm6150l_flash {
> +	status = "okay";
> +
> +	led-0 {
> +		function = LED_FUNCTION_FLASH;
> +		color = <LED_COLOR_ID_YELLOW>;
> +		led-sources = <1>;
> +		led-max-microamp = <180000>;
> +		flash-max-microamp = <1000000>;
> +		flash-max-timeout-us = <1280000>;
> +	};

I'm pretty sure the flash is not yellow.

Plus, how is the node in /sys/class/leds called? Can you make an entry
in Documentation/leds/well-known-leds.txt and ensure the name stays
consistent across devices?

Best regards,
								Pavel
-- 
People of Russia, stop Putin before his war on Ukraine escalates.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

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

* Re: [PATCH 3/3] arm64: dts: qcom: sm7225-fairphone-fp4: configure flash LED
  2022-12-10 17:16   ` Pavel Machek
@ 2022-12-12 13:59     ` Luca Weiss
  2023-01-05  3:30       ` Fenglin Wu
  0 siblings, 1 reply; 19+ messages in thread
From: Luca Weiss @ 2022-12-12 13:59 UTC (permalink / raw)
  To: Pavel Machek
  Cc: Andy Gross, Bjorn Andersson, Konrad Dybcio, Rob Herring,
	Krzysztof Kozlowski, Fenglin Wu, linux-arm-msm, linux-leds,
	devicetree, linux-kernel

On Sat Dec 10, 2022 at 6:16 PM CET, Pavel Machek wrote:
> Hi!
>
> > Configure the pm6150l flash node for the dual flash LEDs found on FP4.
>
> > +&pm6150l_flash {
> > +	status = "okay";
> > +
> > +	led-0 {
> > +		function = LED_FUNCTION_FLASH;
> > +		color = <LED_COLOR_ID_YELLOW>;
> > +		led-sources = <1>;
> > +		led-max-microamp = <180000>;
> > +		flash-max-microamp = <1000000>;
> > +		flash-max-timeout-us = <1280000>;
> > +	};

Hi Pavel,

>
> I'm pretty sure the flash is not yellow.

The marketing term is Dual LED flash or Dual-tone flash, one LED is a
blue-ish white and one is a yellow-ish white, but from what I can tell,
in the original code it's always referred to as white and yellow so I
also followed that here.

Also the LEDs are right next to each other so in practise for torch just
both go on, and for camera flash I cannot really tell you but I guess
it's doing something there with the camera tuning.

See also this picture:
https://shop.fairphone.com/media/catalog/product/cache/b752d78484639b19641a8560800d919d/p/_/p_5b_main_camera_back.jpg

>
> Plus, how is the node in /sys/class/leds called? Can you make an entry
> in Documentation/leds/well-known-leds.txt and ensure the name stays
> consistent across devices?

/ # ls -al /sys/class/leds/white:flash/
total 0
drwxr-xr-x    3 0        0                0 Jan  1 00:00 .
drwxr-xr-x    4 0        0                0 Jan  1 00:00 ..
-rw-r--r--    1 0        0             4096 Jan  1 00:00 brightness
lrwxrwxrwx    1 0        0                0 Jan  1 00:00 device -> ../../../c440000.spmi:pmic@5:led-controller@d300
-rw-r--r--    1 0        0             4096 Jan  1 00:00 flash_brightness
-r--r--r--    1 0        0             4096 Jan  1 00:00 flash_fault
-rw-r--r--    1 0        0             4096 Jan  1 00:00 flash_strobe
-rw-r--r--    1 0        0             4096 Jan  1 00:00 flash_timeout
-r--r--r--    1 0        0             4096 Jan  1 00:00 max_brightness
-r--r--r--    1 0        0             4096 Jan  1 00:00 max_flash_brightness
-r--r--r--    1 0        0             4096 Jan  1 00:00 max_flash_timeout
drwxr-xr-x    2 0        0                0 Jan  1 00:00 power
lrwxrwxrwx    1 0        0                0 Jan  1 00:00 subsystem -> ../../../../../../../../../class/leds
-rw-r--r--    1 0        0             4096 Jan  1 00:00 uevent
/ # ls -al /sys/class/leds/yellow:flash/
total 0
drwxr-xr-x    3 0        0                0 Jan  1 00:00 .
drwxr-xr-x    4 0        0                0 Jan  1 00:00 ..
-rw-r--r--    1 0        0             4096 Jan  1 00:00 brightness
lrwxrwxrwx    1 0        0                0 Jan  1 00:00 device -> ../../../c440000.spmi:pmic@5:led-controller@d300
-rw-r--r--    1 0        0             4096 Jan  1 00:00 flash_brightness
-r--r--r--    1 0        0             4096 Jan  1 00:00 flash_fault
-rw-r--r--    1 0        0             4096 Jan  1 00:00 flash_strobe
-rw-r--r--    1 0        0             4096 Jan  1 00:00 flash_timeout
-r--r--r--    1 0        0             4096 Jan  1 00:00 max_brightness
-r--r--r--    1 0        0             4096 Jan  1 00:00 max_flash_brightness
-r--r--r--    1 0        0             4096 Jan  1 00:00 max_flash_timeout
drwxr-xr-x    2 0        0                0 Jan  1 00:00 power
lrwxrwxrwx    1 0        0                0 Jan  1 00:00 subsystem -> ../../../../../../../../../class/leds
-rw-r--r--    1 0        0             4096 Jan  1 00:00 uevent

There's also already flash LED on PinePhone and some MSM8916 devices,
but I think they also have white:flash based on the dt.

>
> Best regards,
> 								Pavel
> -- 
> People of Russia, stop Putin before his war on Ukraine escalates.


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

* Re: [PATCH 1/3] dt-bindings: leds: spmi-flash-led: Add pm6150l compatible
  2022-12-09 13:54 ` [PATCH 1/3] dt-bindings: leds: spmi-flash-led: Add pm6150l compatible Luca Weiss
  2022-12-09 15:01   ` Krzysztof Kozlowski
@ 2022-12-23 12:42   ` Lee Jones
  2022-12-24 14:11     ` Krzysztof Kozlowski
  2023-03-17  7:51   ` Lee Jones
  2 siblings, 1 reply; 19+ messages in thread
From: Lee Jones @ 2022-12-23 12:42 UTC (permalink / raw)
  To: Luca Weiss
  Cc: Andy Gross, Bjorn Andersson, Konrad Dybcio, Pavel Machek,
	Rob Herring, Krzysztof Kozlowski, Fenglin Wu, linux-arm-msm,
	linux-leds, devicetree, linux-kernel

On Fri, 09 Dec 2022, Luca Weiss wrote:

> Add the compatible for the flash-led block found on pm6150l PMIC.
> 
> Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
> ---
>  Documentation/devicetree/bindings/leds/qcom,spmi-flash-led.yaml | 1 +
>  1 file changed, 1 insertion(+)

Who takes LED DT Bindings presently?

> diff --git a/Documentation/devicetree/bindings/leds/qcom,spmi-flash-led.yaml b/Documentation/devicetree/bindings/leds/qcom,spmi-flash-led.yaml
> index 1b273aecaaec..ffacf703d9f9 100644
> --- a/Documentation/devicetree/bindings/leds/qcom,spmi-flash-led.yaml
> +++ b/Documentation/devicetree/bindings/leds/qcom,spmi-flash-led.yaml
> @@ -22,6 +22,7 @@ properties:
>    compatible:
>      items:
>        - enum:
> +          - qcom,pm6150l-flash-led
>            - qcom,pm8150c-flash-led
>            - qcom,pm8150l-flash-led
>            - qcom,pm8350c-flash-led
> 
> -- 
> 2.38.1

-- 
Lee Jones [李琼斯]

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

* Re: [PATCH 1/3] dt-bindings: leds: spmi-flash-led: Add pm6150l compatible
  2022-12-23 12:42   ` Lee Jones
@ 2022-12-24 14:11     ` Krzysztof Kozlowski
  2023-01-03 12:18       ` Lee Jones
  0 siblings, 1 reply; 19+ messages in thread
From: Krzysztof Kozlowski @ 2022-12-24 14:11 UTC (permalink / raw)
  To: Lee Jones, Luca Weiss
  Cc: Andy Gross, Bjorn Andersson, Konrad Dybcio, Pavel Machek,
	Rob Herring, Krzysztof Kozlowski, Fenglin Wu, linux-arm-msm,
	linux-leds, devicetree, linux-kernel

On 23/12/2022 13:42, Lee Jones wrote:
> On Fri, 09 Dec 2022, Luca Weiss wrote:
> 
>> Add the compatible for the flash-led block found on pm6150l PMIC.
>>
>> Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
>> ---
>>  Documentation/devicetree/bindings/leds/qcom,spmi-flash-led.yaml | 1 +
>>  1 file changed, 1 insertion(+)
> 
> Who takes LED DT Bindings presently?

Preferably Pavel and/or you. Rob was taking only on exceptional cases.

Best regards,
Krzysztof


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

* Re: (subset) [PATCH 0/3] Add PM6150L flash LED to Fairphone 4
  2022-12-09 13:54 [PATCH 0/3] Add PM6150L flash LED to Fairphone 4 Luca Weiss
                   ` (2 preceding siblings ...)
  2022-12-09 13:54 ` [PATCH 3/3] arm64: dts: qcom: sm7225-fairphone-fp4: configure flash LED Luca Weiss
@ 2022-12-28  4:36 ` Bjorn Andersson
  3 siblings, 0 replies; 19+ messages in thread
From: Bjorn Andersson @ 2022-12-28  4:36 UTC (permalink / raw)
  To: pavel, krzysztof.kozlowski+dt, konrad.dybcio, luca.weiss,
	robh+dt, agross
  Cc: quic_fenglinw, linux-kernel, devicetree, linux-arm-msm, linux-leds

On Fri, 09 Dec 2022 14:54:05 +0100, Luca Weiss wrote:
> These patches add the necessary nodes and configuration for supporting the
> flash LED found on the Fairphone 4 that's powered by the pm6150l flash led
> block.
> 
> This depends on the patches by Fenglin Wu adding the driver, the latest
> revision can be found at [0].
> 
> [...]

Applied, thanks!

[2/3] arm64: dts: qcom: pm6150l: add spmi-flash-led node
      commit: e48b2f1fb1749e6ceeca13ac80e6e46b954dce41
[3/3] arm64: dts: qcom: sm7225-fairphone-fp4: configure flash LED
      commit: 1c170714490e4d8c0886019145c9d90dfade14f9

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

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

* Re: [PATCH 1/3] dt-bindings: leds: spmi-flash-led: Add pm6150l compatible
  2022-12-24 14:11     ` Krzysztof Kozlowski
@ 2023-01-03 12:18       ` Lee Jones
  2023-03-17  7:48         ` Luca Weiss
  0 siblings, 1 reply; 19+ messages in thread
From: Lee Jones @ 2023-01-03 12:18 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Luca Weiss, Andy Gross, Bjorn Andersson, Konrad Dybcio,
	Pavel Machek, Rob Herring, Krzysztof Kozlowski, Fenglin Wu,
	linux-arm-msm, linux-leds, devicetree, linux-kernel

On Sat, 24 Dec 2022, Krzysztof Kozlowski wrote:

> On 23/12/2022 13:42, Lee Jones wrote:
> > On Fri, 09 Dec 2022, Luca Weiss wrote:
> > 
> >> Add the compatible for the flash-led block found on pm6150l PMIC.
> >>
> >> Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
> >> ---
> >>  Documentation/devicetree/bindings/leds/qcom,spmi-flash-led.yaml | 1 +
> >>  1 file changed, 1 insertion(+)
> > 
> > Who takes LED DT Bindings presently?
> 
> Preferably Pavel and/or you. Rob was taking only on exceptional cases.

Works for me.  That's the case from now on then, thank you.

-- 
Lee Jones [李琼斯]

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

* Re: [PATCH 3/3] arm64: dts: qcom: sm7225-fairphone-fp4: configure flash LED
  2022-12-12 13:59     ` Luca Weiss
@ 2023-01-05  3:30       ` Fenglin Wu
  2023-03-23 19:54         ` Pavel Machek
  0 siblings, 1 reply; 19+ messages in thread
From: Fenglin Wu @ 2023-01-05  3:30 UTC (permalink / raw)
  To: Luca Weiss, Pavel Machek
  Cc: Andy Gross, Bjorn Andersson, Konrad Dybcio, Rob Herring,
	Krzysztof Kozlowski, linux-arm-msm, linux-leds, devicetree,
	linux-kernel



On 2022/12/12 21:59, Luca Weiss wrote:
> On Sat Dec 10, 2022 at 6:16 PM CET, Pavel Machek wrote:
>> Hi!
>>
>>> Configure the pm6150l flash node for the dual flash LEDs found on FP4.
>>
>>> +&pm6150l_flash {
>>> +	status = "okay";
>>> +
>>> +	led-0 {
>>> +		function = LED_FUNCTION_FLASH;
>>> +		color = <LED_COLOR_ID_YELLOW>;
>>> +		led-sources = <1>;
>>> +		led-max-microamp = <180000>;
>>> +		flash-max-microamp = <1000000>;
>>> +		flash-max-timeout-us = <1280000>;
>>> +	};
> 
> Hi Pavel,
> 
>>
>> I'm pretty sure the flash is not yellow.
> 
> The marketing term is Dual LED flash or Dual-tone flash, one LED is a
> blue-ish white and one is a yellow-ish white, but from what I can tell,
> in the original code it's always referred to as white and yellow so I
> also followed that here.
> 
> Also the LEDs are right next to each other so in practise for torch just
> both go on, and for camera flash I cannot really tell you but I guess
> it's doing something there with the camera tuning.
> 
> See also this picture:
> https://shop.fairphone.com/media/catalog/product/cache/b752d78484639b19641a8560800d919d/p/_/p_5b_main_camera_back.jpg
> 
Hi Pavel,

Luca is right. It is normally called dual CCT (Correlated Color 
Temperature) flash LED. It has 2 LEDs, one is with higher CCT (~6000K) 
so it looks like a white LED, another is with lower CCT (~2000K) and it 
looks like a yellow LED. I am not an expert of this but my understanding 
is the camera tuning process normally adjusts the brightness of the two 
LEDs and enables them to get different CCT for different snapshots.
I was thinking to use the "white" and "yellow" to name the flash LEDs 
which should be much better that just using indexes, it implicitly tell 
that the "white" one is having higher CCT and the "yellow" one is having 
lower CCT.

Fenglin
>>
>> Plus, how is the node in /sys/class/leds called? Can you make an entry
>> in Documentation/leds/well-known-leds.txt and ensure the name stays
>> consistent across devices?
> 
> / # ls -al /sys/class/leds/white:flash/
> total 0
> drwxr-xr-x    3 0        0                0 Jan  1 00:00 .
> drwxr-xr-x    4 0        0                0 Jan  1 00:00 ..
> -rw-r--r--    1 0        0             4096 Jan  1 00:00 brightness
> lrwxrwxrwx    1 0        0                0 Jan  1 00:00 device -> ../../../c440000.spmi:pmic@5:led-controller@d300
> -rw-r--r--    1 0        0             4096 Jan  1 00:00 flash_brightness
> -r--r--r--    1 0        0             4096 Jan  1 00:00 flash_fault
> -rw-r--r--    1 0        0             4096 Jan  1 00:00 flash_strobe
> -rw-r--r--    1 0        0             4096 Jan  1 00:00 flash_timeout
> -r--r--r--    1 0        0             4096 Jan  1 00:00 max_brightness
> -r--r--r--    1 0        0             4096 Jan  1 00:00 max_flash_brightness
> -r--r--r--    1 0        0             4096 Jan  1 00:00 max_flash_timeout
> drwxr-xr-x    2 0        0                0 Jan  1 00:00 power
> lrwxrwxrwx    1 0        0                0 Jan  1 00:00 subsystem -> ../../../../../../../../../class/leds
> -rw-r--r--    1 0        0             4096 Jan  1 00:00 uevent
> / # ls -al /sys/class/leds/yellow:flash/
> total 0
> drwxr-xr-x    3 0        0                0 Jan  1 00:00 .
> drwxr-xr-x    4 0        0                0 Jan  1 00:00 ..
> -rw-r--r--    1 0        0             4096 Jan  1 00:00 brightness
> lrwxrwxrwx    1 0        0                0 Jan  1 00:00 device -> ../../../c440000.spmi:pmic@5:led-controller@d300
> -rw-r--r--    1 0        0             4096 Jan  1 00:00 flash_brightness
> -r--r--r--    1 0        0             4096 Jan  1 00:00 flash_fault
> -rw-r--r--    1 0        0             4096 Jan  1 00:00 flash_strobe
> -rw-r--r--    1 0        0             4096 Jan  1 00:00 flash_timeout
> -r--r--r--    1 0        0             4096 Jan  1 00:00 max_brightness
> -r--r--r--    1 0        0             4096 Jan  1 00:00 max_flash_brightness
> -r--r--r--    1 0        0             4096 Jan  1 00:00 max_flash_timeout
> drwxr-xr-x    2 0        0                0 Jan  1 00:00 power
> lrwxrwxrwx    1 0        0                0 Jan  1 00:00 subsystem -> ../../../../../../../../../class/leds
> -rw-r--r--    1 0        0             4096 Jan  1 00:00 uevent
> 
> There's also already flash LED on PinePhone and some MSM8916 devices,
> but I think they also have white:flash based on the dt.
> 
>>
>> Best regards,
>> 								Pavel
>> -- 
>> People of Russia, stop Putin before his war on Ukraine escalates.
> 

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

* Re: [PATCH 1/3] dt-bindings: leds: spmi-flash-led: Add pm6150l compatible
  2023-01-03 12:18       ` Lee Jones
@ 2023-03-17  7:48         ` Luca Weiss
  0 siblings, 0 replies; 19+ messages in thread
From: Luca Weiss @ 2023-03-17  7:48 UTC (permalink / raw)
  To: Lee Jones, Krzysztof Kozlowski
  Cc: Andy Gross, Bjorn Andersson, Konrad Dybcio, Pavel Machek,
	Rob Herring, Krzysztof Kozlowski, Fenglin Wu, linux-arm-msm,
	linux-leds, devicetree, linux-kernel

On Tue Jan 3, 2023 at 1:18 PM CET, Lee Jones wrote:
> On Sat, 24 Dec 2022, Krzysztof Kozlowski wrote:
>
> > On 23/12/2022 13:42, Lee Jones wrote:
> > > On Fri, 09 Dec 2022, Luca Weiss wrote:
> > > 
> > >> Add the compatible for the flash-led block found on pm6150l PMIC.
> > >>
> > >> Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
> > >> ---
> > >>  Documentation/devicetree/bindings/leds/qcom,spmi-flash-led.yaml | 1 +
> > >>  1 file changed, 1 insertion(+)
> > > 
> > > Who takes LED DT Bindings presently?
> > 
> > Preferably Pavel and/or you. Rob was taking only on exceptional cases.
>
> Works for me.  That's the case from now on then, thank you.

Hi Lee,

could you please pick up this patch now since the main schema has been
applied?
The remaining patches (dts & dtsi) from this series have been applied
already.

Regards
Luca

>
> -- 
> Lee Jones [李琼斯]


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

* Re: [PATCH 1/3] dt-bindings: leds: spmi-flash-led: Add pm6150l compatible
  2022-12-09 13:54 ` [PATCH 1/3] dt-bindings: leds: spmi-flash-led: Add pm6150l compatible Luca Weiss
  2022-12-09 15:01   ` Krzysztof Kozlowski
  2022-12-23 12:42   ` Lee Jones
@ 2023-03-17  7:51   ` Lee Jones
  2 siblings, 0 replies; 19+ messages in thread
From: Lee Jones @ 2023-03-17  7:51 UTC (permalink / raw)
  To: Luca Weiss
  Cc: Andy Gross, Bjorn Andersson, Konrad Dybcio, Pavel Machek,
	Rob Herring, Krzysztof Kozlowski, Fenglin Wu, linux-arm-msm,
	linux-leds, devicetree, linux-kernel

On Fri, 09 Dec 2022, Luca Weiss wrote:

> Add the compatible for the flash-led block found on pm6150l PMIC.
>
> Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
> ---
>  Documentation/devicetree/bindings/leds/qcom,spmi-flash-led.yaml | 1 +
>  1 file changed, 1 insertion(+)

Applied, thanks

--
Lee Jones [李琼斯]

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

* Re: [PATCH 3/3] arm64: dts: qcom: sm7225-fairphone-fp4: configure flash LED
  2023-01-05  3:30       ` Fenglin Wu
@ 2023-03-23 19:54         ` Pavel Machek
  2023-03-31  8:59           ` Luca Weiss
  0 siblings, 1 reply; 19+ messages in thread
From: Pavel Machek @ 2023-03-23 19:54 UTC (permalink / raw)
  To: Fenglin Wu
  Cc: Luca Weiss, Andy Gross, Bjorn Andersson, Konrad Dybcio,
	Rob Herring, Krzysztof Kozlowski, linux-arm-msm, linux-leds,
	devicetree, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1483 bytes --]

Hi!


> > > I'm pretty sure the flash is not yellow.
> > 
> > The marketing term is Dual LED flash or Dual-tone flash, one LED is a
> > blue-ish white and one is a yellow-ish white, but from what I can tell,
> > in the original code it's always referred to as white and yellow so I
> > also followed that here.
> > 
> > Also the LEDs are right next to each other so in practise for torch just
> > both go on, and for camera flash I cannot really tell you but I guess
> > it's doing something there with the camera tuning.
> > 
> > See also this picture:
> > https://shop.fairphone.com/media/catalog/product/cache/b752d78484639b19641a8560800d919d/p/_/p_5b_main_camera_back.jpg
> > 
> Hi Pavel,
> 
> Luca is right. It is normally called dual CCT (Correlated Color Temperature)
> flash LED. It has 2 LEDs, one is with higher CCT (~6000K) so it looks like a
> white LED, another is with lower CCT (~2000K) and it looks like a yellow
> LED. I am not an expert of this but my understanding is the camera tuning
> process normally adjusts the brightness of the two LEDs and enables them to
> get different CCT for different snapshots.

I believe this is normally called "warm white" and "cool white", no?
Yellow would be monochromatic light at cca 575nm, see
https://en.wikipedia.org/wiki/Shades_of_yellow .

If we need to add some defines for that, lets do that.

BR,
									Pavel
-- 
People of Russia, stop Putin before his war on Ukraine escalates.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

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

* Re: [PATCH 3/3] arm64: dts: qcom: sm7225-fairphone-fp4: configure flash LED
  2023-03-23 19:54         ` Pavel Machek
@ 2023-03-31  8:59           ` Luca Weiss
  0 siblings, 0 replies; 19+ messages in thread
From: Luca Weiss @ 2023-03-31  8:59 UTC (permalink / raw)
  To: Pavel Machek, Fenglin Wu
  Cc: Andy Gross, Bjorn Andersson, Konrad Dybcio, Rob Herring,
	Krzysztof Kozlowski, linux-arm-msm, linux-leds, devicetree,
	linux-kernel

Hi Pavel,

On Thu Mar 23, 2023 at 8:54 PM CET, Pavel Machek wrote:
> Hi!
>
>
> > > > I'm pretty sure the flash is not yellow.
> > > 
> > > The marketing term is Dual LED flash or Dual-tone flash, one LED is a
> > > blue-ish white and one is a yellow-ish white, but from what I can tell,
> > > in the original code it's always referred to as white and yellow so I
> > > also followed that here.
> > > 
> > > Also the LEDs are right next to each other so in practise for torch just
> > > both go on, and for camera flash I cannot really tell you but I guess
> > > it's doing something there with the camera tuning.
> > > 
> > > See also this picture:
> > > https://shop.fairphone.com/media/catalog/product/cache/b752d78484639b19641a8560800d919d/p/_/p_5b_main_camera_back.jpg
> > > 
> > Hi Pavel,
> > 
> > Luca is right. It is normally called dual CCT (Correlated Color Temperature)
> > flash LED. It has 2 LEDs, one is with higher CCT (~6000K) so it looks like a
> > white LED, another is with lower CCT (~2000K) and it looks like a yellow
> > LED. I am not an expert of this but my understanding is the camera tuning
> > process normally adjusts the brightness of the two LEDs and enables them to
> > get different CCT for different snapshots.
>
> I believe this is normally called "warm white" and "cool white", no?
> Yellow would be monochromatic light at cca 575nm, see
> https://en.wikipedia.org/wiki/Shades_of_yellow .

I don't really have any more information I can provide right now. If you
feel it should be called warm white and cool white, feel free to send a
patch changing it.

I'm personally okay with it being called white & yellow since that seems
to be the term used in (downstream) software for these kinds of leds.

Regards
Luca

>
> If we need to add some defines for that, lets do that.
>
> BR,
> 									Pavel
> -- 
> People of Russia, stop Putin before his war on Ukraine escalates.


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

end of thread, other threads:[~2023-03-31  9:00 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-09 13:54 [PATCH 0/3] Add PM6150L flash LED to Fairphone 4 Luca Weiss
2022-12-09 13:54 ` [PATCH 1/3] dt-bindings: leds: spmi-flash-led: Add pm6150l compatible Luca Weiss
2022-12-09 15:01   ` Krzysztof Kozlowski
2022-12-23 12:42   ` Lee Jones
2022-12-24 14:11     ` Krzysztof Kozlowski
2023-01-03 12:18       ` Lee Jones
2023-03-17  7:48         ` Luca Weiss
2023-03-17  7:51   ` Lee Jones
2022-12-09 13:54 ` [PATCH 2/3] arm64: dts: qcom: pm6150l: add spmi-flash-led node Luca Weiss
2022-12-10 12:32   ` Konrad Dybcio
2022-12-10 17:14   ` Pavel Machek
2022-12-09 13:54 ` [PATCH 3/3] arm64: dts: qcom: sm7225-fairphone-fp4: configure flash LED Luca Weiss
2022-12-10 12:33   ` Konrad Dybcio
2022-12-10 17:16   ` Pavel Machek
2022-12-12 13:59     ` Luca Weiss
2023-01-05  3:30       ` Fenglin Wu
2023-03-23 19:54         ` Pavel Machek
2023-03-31  8:59           ` Luca Weiss
2022-12-28  4:36 ` (subset) [PATCH 0/3] Add PM6150L flash LED to Fairphone 4 Bjorn Andersson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.