[PATCH v4 09/12] arm64: dts: qcom: sdm845-lg-common: Add camera flash

Paul Sajna posted 12 patches 6 days, 15 hours ago
[PATCH v4 09/12] arm64: dts: qcom: sdm845-lg-common: Add camera flash
Posted by Paul Sajna 6 days, 15 hours ago
Camera doesn't work yet (imx351), but we can use the flash as a flashlight.

Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Signed-off-by: Paul Sajna <sajattack@postmarketos.org>
---
 arch/arm64/boot/dts/qcom/sdm845-lg-common.dtsi | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/sdm845-lg-common.dtsi b/arch/arm64/boot/dts/qcom/sdm845-lg-common.dtsi
index 93b9a0246510..fa664b5120d2 100644
--- a/arch/arm64/boot/dts/qcom/sdm845-lg-common.dtsi
+++ b/arch/arm64/boot/dts/qcom/sdm845-lg-common.dtsi
@@ -494,6 +494,19 @@ &pm8998_resin {
 	status = "okay";
 };
 
+&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 = <500000>;
+		flash-max-timeout-us = <500000>;
+	};
+};
+
 &pmi8998_lpg {
 	status = "okay";
 

-- 
2.52.0
Re: [PATCH v4 09/12] arm64: dts: qcom: sdm845-lg-common: Add camera flash
Posted by Paul Sajna 3 days, 3 hours ago
I did more testing on this, and the led only comes on if it's brightness is set to approx 150/255 or lower. In that case, should I set led-max-microamp to 60mA?



November 25, 2025 at 8:12 AM, "Paul Sajna" <sajattack@postmarketos.org mailto:sajattack@postmarketos.org?to=%22Paul%20Sajna%22%20%3Csajattack%40postmarketos.org%3E > wrote:


> 
> Camera doesn't work yet (imx351), but we can use the flash as a flashlight.
> 
> Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
> Signed-off-by: Paul Sajna <sajattack@postmarketos.org>
> ---
>  arch/arm64/boot/dts/qcom/sdm845-lg-common.dtsi | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/qcom/sdm845-lg-common.dtsi b/arch/arm64/boot/dts/qcom/sdm845-lg-common.dtsi
> index 93b9a0246510..fa664b5120d2 100644
> --- a/arch/arm64/boot/dts/qcom/sdm845-lg-common.dtsi
> +++ b/arch/arm64/boot/dts/qcom/sdm845-lg-common.dtsi
> @@ -494,6 +494,19 @@ &pm8998_resin {
>  status = "okay";
>  };
>  
> +&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 = <500000>;
> + flash-max-timeout-us = <500000>;
> + };
> +};
> +
>  &pmi8998_lpg {
>  status = "okay";
>  
> 
> -- 
> 2.52.0
>
Re: [PATCH v4 09/12] arm64: dts: qcom: sdm845-lg-common: Add camera flash
Posted by Konrad Dybcio 12 hours ago
On 11/28/25 9:20 PM, Paul Sajna wrote:
> I did more testing on this, and the led only comes on if it's brightness is set to approx 150/255 or lower. In that case, should I set led-max-microamp to 60mA?

FWIW your downstream kernel sets up channels 0 and 1, here you only
enabled 1. Taking a look at a picture of the phone, I only see a single
LED on the back, so perhaps you're (over)driving a single power line?

I'm not a milion percent sure, but I would assume the current draw
*limiting* register applies to the sum of the current going through
the three channels because there's only a single instance of it.

Konrad