Skip to contentSkip to conversation

Samsung Expressatt: Camera Flash

PATCH Superseded Rudraksha Gupta 4 participants 12 messages Mar 7 – Mar 18

Subsystems (4)

v1 of 7 Superseded Latest is v7 →

lore
Share & tools
lore
#0 lore raw

cover Samsung Expressatt: Camera Flash

This small series adds camera flash to an existing similar mainline driver and adds it the the Samsung Expressatt's DTS

Downstream reference:

---
Rudraksha Gupta (3):
dt-bindings: leds: rt8515: Support single-GPIO flash ICs with unlock gate
leds: flash: rt8515: Support single-GPIO flash ICs with unlock gate
ARM: dts: qcom: msm8960: expressatt: Add camera flash

 .../devicetree/bindings/leds/richtek,rt8515.yaml   | 36 +++++++++++++++++++-
 .../dts/qcom/qcom-msm8960-samsung-expressatt.dts   | 31 ++++++++++++++++++
 drivers/leds/flash/leds-rt8515.c                   | 38 ++++++++++++++++++----
 3 files changed, 98 insertions(+), 7 deletions(-)

---
base-commit: e9ec05addd1a067fc7cb218f20ecdc1b1b0898c0
change-id: 20260306-expressatt_camera_flash-13c15a7427aa
prerequisite-message-id: <[email protected]>
prerequisite-patch-id: 8de4de7909722ccaf385c4224f25a623eaa72c28

Best regards,

Signature · 1 line
Rudraksha Gupta <[email protected]>
#1 lore raw

PATCH 1/3 dt-bindings: leds: rt8515: Support single-GPIO flash ICs with unlock gate

Some flash ICs use the same one-wire pulse-count protocol as the RT8515 but have only a single GPIO line for both flash and torch modes, plus an optional unlock gate (e.g. a PMIC MPP) that must be driven high before the chip responds to the enable GPIO.

Make ent-gpios optional and add an unlock-gpios property to support these variants. Add a oneOf constraint requiring exactly one of ent-gpios or unlock-gpios. Add a binding example showing the single-GPIO configuration.

---
 .../devicetree/bindings/leds/richtek,rt8515.yaml   | 36 +++++++++++++++++++++-
 1 file changed, 35 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/leds/richtek,rt8515.yaml +35 -1
index 0356371a6b01..820cf8c55090 100644
@@ -15,6 +15,10 @@ description: |
   current for each mode is defined in hardware using two resistors
   RFS and RTS.
 
+  This driver also supports single-GPIO flash ICs that use the same
+  one-wire pulse-count protocol on one line for both flash and torch.
+  For these, only enf-gpios is required.
+
 properties:
   compatible:
     const: richtek,rt8515
@@ -26,6 +30,14 @@ properties:
   ent-gpios:
     maxItems: 1
     description: A connection to the 'ENT' (enable torch) pin.
+      Optional for single-GPIO flash ICs where enf-gpios is used for
+      both flash and torch modes.
+
+  unlock-gpios:
+    maxItems: 1
+    description: Optional GPIO to unlock the flash LED circuit. Some
+      boards use a PMIC MPP pin that must be driven high before the
+      flash IC will respond to the enable GPIOs.
 
   richtek,rfs-ohms:
     minimum: 7680
@@ -81,10 +93,15 @@ properties:
 
 required:
   - compatible
-  - ent-gpios
   - enf-gpios
   - led
 
+oneOf:
+  - required:
+      - ent-gpios
+  - required:
+      - unlock-gpios
+
 additionalProperties: false
 
 examples:
@@ -108,4 +125,21 @@ examples:
         };
     };
 
+  - |
+    /* Single-GPIO flash IC with unlock gate */
+    #include <dt-bindings/gpio/gpio.h>
+    #include <dt-bindings/leds/common.h>
+
+    led-controller {
+        compatible = "richtek,rt8515";
+        enf-gpios = <&tlmm 3 GPIO_ACTIVE_HIGH>;
+        unlock-gpios = <&pm8921_mpps 4 GPIO_ACTIVE_HIGH>;
+
+        led {
+            function = LED_FUNCTION_FLASH;
+            color = <LED_COLOR_ID_WHITE>;
+            flash-max-timeout-us = <250000>;
+        };
+    };
+
 ...
Signature · 1 line
2.53.0
#2 lore raw

Re: [PATCH 1/3] dt-bindings: leds: rt8515: Support single-GPIO flash ICs with unlock gate

Quoted 20 lines · Rudraksha Gupta

Some flash ICs use the same one-wire pulse-count protocol as the RT8515 but have only a single GPIO line for both flash and torch modes, plus an optional unlock gate (e.g. a PMIC MPP) that must be driven high before the chip responds to the enable GPIO.

Make ent-gpios optional and add an unlock-gpios property to support these variants. Add a oneOf constraint requiring exactly one of ent-gpios or unlock-gpios. Add a binding example showing the single-GPIO configuration.

---
 .../devicetree/bindings/leds/richtek,rt8515.yaml   | 36 +++++++++++++++++++++-
 1 file changed, 35 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/leds/richtek,rt8515.yaml +0 -0
index 0356371a6b01..820cf8c55090 100644

Documentation/devicetree/bindings/leds/richtek,rt8515.yaml description: | · line 18

Quoted 4 lines
Documentation/devicetree/bindings/leds/richtek,rt8515.yaml +1 -0
@@ -15,6 +15,10 @@ description: |
   current for each mode is defined in hardware using two resistors
   RFS and RTS.
 
+  This driver also supports single-GPIO flash ICs that use the same

Drop reference to driver and explain the hardware here.

Documentation/devicetree/bindings/leds/richtek,rt8515.yaml properties: · line 34

Quoted 12 lines
Documentation/devicetree/bindings/leds/richtek,rt8515.yaml +5 -0
+  one-wire pulse-count protocol on one line for both flash and torch.
+  For these, only enf-gpios is required.
+
 properties:
   compatible:
     const: richtek,rt8515
@@ -26,6 +30,14 @@ properties:
   ent-gpios:
     maxItems: 1
     description: A connection to the 'ENT' (enable torch) pin.
+      Optional for single-GPIO flash ICs where enf-gpios is used for
+      both flash and torch modes.

So what happens with ENT GPIO on such boards? How is it connected?

Best regards,
Krzysztof

#3 lore raw

Re: [PATCH 1/3] dt-bindings: leds: rt8515: Support single-GPIO flash ICs with unlock gate

Quoted 27 lines · Krzysztof Kozlowski
Quoted 20 lines · Rudraksha Gupta

Some flash ICs use the same one-wire pulse-count protocol as the RT8515 but have only a single GPIO line for both flash and torch modes, plus an optional unlock gate (e.g. a PMIC MPP) that must be driven high before the chip responds to the enable GPIO.

Make ent-gpios optional and add an unlock-gpios property to support these variants. Add a oneOf constraint requiring exactly one of ent-gpios or unlock-gpios. Add a binding example showing the single-GPIO configuration.

---
  .../devicetree/bindings/leds/richtek,rt8515.yaml   | 36 +++++++++++++++++++++-
  1 file changed, 35 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/leds/richtek,rt8515.yaml +0 -0
index 0356371a6b01..820cf8c55090 100644

Documentation/devicetree/bindings/leds/richtek,rt8515.yaml description: | · line 18

Quoted 4 lines
Documentation/devicetree/bindings/leds/richtek,rt8515.yaml +1 -0
@@ -15,6 +15,10 @@ description: |
    current for each mode is defined in hardware using two resistors
    RFS and RTS.
 
+  This driver also supports single-GPIO flash ICs that use the same

Drop reference to driver and explain the hardware here.

Quoted 13 lines

Documentation/devicetree/bindings/leds/richtek,rt8515.yaml properties: · line 34

Quoted 12 lines
Documentation/devicetree/bindings/leds/richtek,rt8515.yaml +5 -0
+  one-wire pulse-count protocol on one line for both flash and torch.
+  For these, only enf-gpios is required.
+
  properties:
    compatible:
      const: richtek,rt8515
@@ -26,6 +30,14 @@ properties:
    ent-gpios:
      maxItems: 1
      description: A connection to the 'ENT' (enable torch) pin.
+      Optional for single-GPIO flash ICs where enf-gpios is used for
+      both flash and torch modes.

So what happens with ENT GPIO on such boards? How is it connected?

Hello Krzysztof,

Thanks for these comments. I have addressed these in v2

Rudraksha

Quoted 4 lines

Best regards,
Krzysztof

#4 lore raw

Re: [PATCH 1/3] dt-bindings: leds: rt8515: Support single-GPIO flash ICs with unlock gate

In reply to Rudraksha Gupta

Hi Rudraksha,

thanks for your patch!

Documentation/devicetree/bindings/leds/richtek,rt8515.yaml properties: · line 34

Quoted 5 lines · On Sat, Mar 7, 2026 at 1:58 AM Rudraksha Gupta via B4 Relay…

ent-gpios:
maxItems: 1
description: A connection to the 'ENT' (enable torch) pin.

Documentation/devicetree/bindings/leds/richtek,rt8515.yaml +2 -0
+      Optional for single-GPIO flash ICs where enf-gpios is used for
+      both flash and torch modes.

Fair enough, that can be done.

Documentation/devicetree/bindings/leds/richtek,rt8515.yaml properties: · line 40

Quoted 5 lines
Documentation/devicetree/bindings/leds/richtek,rt8515.yaml +5 -0
+  unlock-gpios:
+    maxItems: 1
+    description: Optional GPIO to unlock the flash LED circuit. Some
+      boards use a PMIC MPP pin that must be driven high before the
+      flash IC will respond to the enable GPIOs.

But this IC has no pin named "unlock". This is something else.

Given the way it works it looks like a regulator enable signal.

If you don't have any better idea about what this is, I would suggest adding

vin-supply

to the RT8615 bindings instead and then use a GPIO regulator in your device tree to provide the voltage to it from that GPIO.

Yours,
Linus Walleij

#5 lore raw

Re: [PATCH 1/3] dt-bindings: leds: rt8515: Support single-GPIO flash ICs with unlock gate

Quoted 23 lines · Linus Walleij

Hi Rudraksha,

thanks for your patch!

Documentation/devicetree/bindings/leds/richtek,rt8515.yaml properties: · line 34

Quoted 5 lines · On Sat, Mar 7, 2026 at 1:58 AM Rudraksha Gupta via B4 Relay…

ent-gpios:
maxItems: 1
description: A connection to the 'ENT' (enable torch) pin.

Documentation/devicetree/bindings/leds/richtek,rt8515.yaml +2 -0
+      Optional for single-GPIO flash ICs where enf-gpios is used for
+      both flash and torch modes.

Fair enough, that can be done.

Documentation/devicetree/bindings/leds/richtek,rt8515.yaml properties: · line 40

Quoted 5 lines
Documentation/devicetree/bindings/leds/richtek,rt8515.yaml +5 -0
+  unlock-gpios:
+    maxItems: 1
+    description: Optional GPIO to unlock the flash LED circuit. Some
+      boards use a PMIC MPP pin that must be driven high before the
+      flash IC will respond to the enable GPIOs.

But this IC has no pin named "unlock". This is something else.

Given the way it works it looks like a regulator enable signal.

Quoted 7 lines

If you don't have any better idea about what this is, I would suggest adding

vin-supply

to the RT8615 bindings instead and then use a GPIO regulator in your device tree to provide the voltage to it from that GPIO.

Hello Linus,

Thanks for your comments (both in this email and others)! I have addressed these in v2.

Rudraksha

Quoted 3 lines

Yours,
Linus Walleij

#6 lore raw

PATCH 2/3 leds: flash: rt8515: Support single-GPIO flash ICs with unlock gate

In reply to Rudraksha Gupta

Extend the RT8515 driver to support flash ICs that use only a single GPIO for both flash and torch modes (no separate ENT pin), with an optional unlock GPIO that gates the flash circuit.

---
 drivers/leds/flash/leds-rt8515.c | 38 ++++++++++++++++++++++++++++++++------
 1 file changed, 32 insertions(+), 6 deletions(-)
drivers/leds/flash/leds-rt8515.c +32 -6
index f6b439674c03..3164bf91e4c9 100644
@@ -52,6 +52,7 @@ struct rt8515 {
 	struct regulator *reg;
 	struct gpio_desc *enable_torch;
 	struct gpio_desc *enable_flash;
+	struct gpio_desc *unlock_gpio;
 	struct timer_list powerdown_timer;
 	u32 max_timeout; /* Flash max timeout */
 	int flash_max_intensity;
@@ -66,7 +67,10 @@ static struct rt8515 *to_rt8515(struct led_classdev_flash *fled)
 static void rt8515_gpio_led_off(struct rt8515 *rt)
 {
 	gpiod_set_value(rt->enable_flash, 0);
-	gpiod_set_value(rt->enable_torch, 0);
+	if (rt->enable_torch)
+		gpiod_set_value(rt->enable_torch, 0);
+	if (rt->unlock_gpio)
+		gpiod_set_value_cansleep(rt->unlock_gpio, 0);
 }
 
 static void rt8515_gpio_brightness_commit(struct gpio_desc *gpiod,
@@ -99,11 +103,19 @@ static int rt8515_led_brightness_set(struct led_classdev *led,
 		/* Off */
 		rt8515_gpio_led_off(rt);
 	} else if (brightness < RT8515_TORCH_MAX) {
-		/* Step it up to movie mode brightness using the flash pin */
-		rt8515_gpio_brightness_commit(rt->enable_torch, brightness);
+		/* Unlock the flash circuit if needed */
+		if (rt->unlock_gpio)
+			gpiod_set_value_cansleep(rt->unlock_gpio, 1);
+		/* Step it up to movie mode brightness */
+		rt8515_gpio_brightness_commit(rt->enable_torch ?
+				rt->enable_torch : rt->enable_flash, brightness);
 	} else {
+		/* Unlock the flash circuit if needed */
+		if (rt->unlock_gpio)
+			gpiod_set_value_cansleep(rt->unlock_gpio, 1);
 		/* Max torch brightness requested */
-		gpiod_set_value(rt->enable_torch, 1);
+		gpiod_set_value(rt->enable_torch ? rt->enable_torch :
+				rt->enable_flash, 1);
 	}
 
 	mutex_unlock(&rt->lock);
@@ -121,6 +133,9 @@ static int rt8515_led_flash_strobe_set(struct led_classdev_flash *fled,
 	mutex_lock(&rt->lock);
 
 	if (state) {
+		/* Unlock the flash circuit if needed */
+		if (rt->unlock_gpio)
+			gpiod_set_value_cansleep(rt->unlock_gpio, 1);
 		/* Enable LED flash mode and set brightness */
 		rt8515_gpio_brightness_commit(rt->enable_flash, brightness);
 		/* Set timeout */
@@ -298,12 +313,23 @@ static int rt8515_probe(struct platform_device *pdev)
 		return dev_err_probe(dev, PTR_ERR(rt->enable_flash),
 				     "cannot get ENF (enable flash) GPIO\n");
 
-	/* ENT - Enable Torch line */
-	rt->enable_torch = devm_gpiod_get(dev, "ent", GPIOD_OUT_LOW);
+	/* ENT - Enable Torch line (optional for single-GPIO flash ICs) */
+	rt->enable_torch = devm_gpiod_get_optional(dev, "ent", GPIOD_OUT_LOW);
 	if (IS_ERR(rt->enable_torch))
 		return dev_err_probe(dev, PTR_ERR(rt->enable_torch),
 				     "cannot get ENT (enable torch) GPIO\n");
 
+	/* Optional unlock GPIO (e.g. PMIC MPP to gate flash circuit) */
+	rt->unlock_gpio = devm_gpiod_get_optional(dev, "unlock", GPIOD_OUT_LOW);
+	if (IS_ERR(rt->unlock_gpio))
+		return dev_err_probe(dev, PTR_ERR(rt->unlock_gpio),
+				     "cannot get unlock GPIO\n");
+
+	/* Exactly one of ENT or unlock must be provided */
+	if (!rt->enable_torch == !rt->unlock_gpio)
+		return dev_err_probe(dev, -EINVAL,
+				     "exactly one of ent-gpios or unlock-gpios is required\n");
+
 	child = device_get_next_child_node(dev, NULL);
 	if (!child) {
 		dev_err(dev,
Signature · 1 line
2.53.0
#7 lore raw

Re: [PATCH 2/3] leds: flash: rt8515: Support single-GPIO flash ICs with unlock gate

Hi Rudraksha,

thanks for your patch!

Overall this looks fine but:

Quoted 1 line · On Sat, Mar 7, 2026 at 1:58 AM Rudraksha Gupta via B4 Relay…
        struct regulator *reg;

struct rt8515 actually has an unused regulator struct that was never implemented, but should represent the vin signal.

Quoted 3 lines
        struct gpio_desc *enable_torch;
        struct gpio_desc *enable_flash;

+ struct gpio_desc *unlock_gpio;

Skip this unless you can explain how it works, use the *reg from vin instead. I think this is just a GPIO-controlled regulator.

drivers/leds/flash/leds-rt8515.c static struct rt8515 *to_rt8515(struct led_classdev_flash *fled) · line 73

Quoted 2 lines
drivers/leds/flash/leds-rt8515.c +2 -0
+       if (rt->unlock_gpio)
+               gpiod_set_value_cansleep(rt->unlock_gpio, 0);

Add code to disable the vin regulator instead.

drivers/leds/flash/leds-rt8515.c static int rt8515_led_brightness_set(struct led_classdev *led, · line 108

Quoted 3 lines
drivers/leds/flash/leds-rt8515.c +3 -0
+               /* Unlock the flash circuit if needed */
+               if (rt->unlock_gpio)
+                       gpiod_set_value_cansleep(rt->unlock_gpio, 1);

Add code to enable and stablize the vin regulator instead.

drivers/leds/flash/leds-rt8515.c static int rt8515_led_brightness_set(struct led_classdev *led, · line 108

Quoted 4 lines
        if (state) {
drivers/leds/flash/leds-rt8515.c +3 -0
+               /* Unlock the flash circuit if needed */
+               if (rt->unlock_gpio)
+                       gpiod_set_value_cansleep(rt->unlock_gpio, 1);

Add code to enable and stablize the vin regulator instead.

Yours,
Linus Walleij

#8 lore raw

PATCH 3/3 ARM: dts: qcom: msm8960: expressatt: Add camera flash

In reply to Rudraksha Gupta

Add camera flash support for the Samsung Galaxy Express (expressatt).

The flash IC uses a one-wire pulse-count protocol on GPIO 3, gated by PMIC MPP 4 which must be driven high to unlock the flash circuit.

Downstream references:

---
 .../dts/qcom/qcom-msm8960-samsung-expressatt.dts   | 31 ++++++++++++++++++++++
 1 file changed, 31 insertions(+)
arch/arm/boot/dts/qcom/qcom-msm8960-samsung-expressatt.dts +31 -0
index c4b98af6955d..96460775a4ec 100644
@@ -1,5 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0
 #include <dt-bindings/input/input.h>
+#include <dt-bindings/leds/common.h>
 #include <dt-bindings/reset/qcom,gcc-msm8960.h>
 
 #include "qcom-msm8960.dtsi"
@@ -61,6 +62,20 @@ touchkey_enable: touchkey-enable {
 		regulator-boot-on;
 	};
 
+	camera_flash: led-controller {
+		compatible = "richtek,rt8515";
+		enf-gpios = <&tlmm 3 GPIO_ACTIVE_HIGH>;
+		unlock-gpios = <&pm8921_mpps 4 GPIO_ACTIVE_HIGH>;
+		pinctrl-names = "default";
+		pinctrl-0 = <&cam_flash_en>;
+
+		led {
+			function = LED_FUNCTION_FLASH;
+			color = <LED_COLOR_ID_WHITE>;
+			flash-max-timeout-us = <250000>;
+		};
+	};
+
 	i2c-gpio-touchkey {
 		compatible = "i2c-gpio";
 		#address-cells = <1>;
@@ -247,6 +262,13 @@ touchkey_irq_pin: touchkey-irq-state {
 		drive-strength = <2>;
 		bias-disable;
 	};
+
+	cam_flash_en: cam-flash-en-state {
+		pins = "gpio3";
+		function = "gpio";
+		drive-strength = <16>;
+		bias-pull-down;
+	};
 };
 
 &pm8921 {
@@ -572,3 +594,12 @@ magnetometer@2e {
 		/* TODO: Figure out Mount Matrix */
 	};
 };
+
+&pm8921_mpps {
+	flash_led_unlock: flash-led-unlock-state {
+		pins = "mpp4";
+		function = "digital";
+		output-low;
+		power-source = <PM8921_GPIO_S4>;
+	};
+};
Signature · 1 line
2.53.0
Reviewed-by on v1 3/3
#9 lore raw

Re: [PATCH 3/3] ARM: dts: qcom: msm8960: expressatt: Add camera flash

Quoted 28 lines · On 07/03/2026 01:58, Rudraksha Gupta via B4 Relay wrote:

From: Rudraksha Gupta <[email protected]>

Add camera flash support for the Samsung Galaxy Express (expressatt).

The flash IC uses a one-wire pulse-count protocol on GPIO 3, gated by PMIC MPP 4 which must be driven high to unlock the flash circuit.

Downstream references:

---
  .../dts/qcom/qcom-msm8960-samsung-expressatt.dts   | 31 ++++++++++++++++++++++
  1 file changed, 31 insertions(+)
arch/arm/boot/dts/qcom/qcom-msm8960-samsung-expressatt.dts +1 -0
index c4b98af6955d..96460775a4ec 100644
@@ -1,5 +1,6 @@
  // SPDX-License-Identifier: GPL-2.0
  #include <dt-bindings/input/input.h>
+#include <dt-bindings/leds/common.h>
  #include <dt-bindings/reset/qcom,gcc-msm8960.h>
 
  #include "qcom-msm8960.dtsi"

arch/arm/boot/dts/qcom/qcom-msm8960-samsung-expressatt.dts touchkey_enable: touchkey-enable { · line 71

Quoted 10 lines
arch/arm/boot/dts/qcom/qcom-msm8960-samsung-expressatt.dts +7 -0
@@ -61,6 +62,20 @@ touchkey_enable: touchkey-enable {
  		regulator-boot-on;
  	};
 
+	camera_flash: led-controller {
+		compatible = "richtek,rt8515";
+		enf-gpios = <&tlmm 3 GPIO_ACTIVE_HIGH>;
+		unlock-gpios = <&pm8921_mpps 4 GPIO_ACTIVE_HIGH>;
+		pinctrl-names = "default";
+		pinctrl-0 = <&cam_flash_en>;
+

LGTM, just please order pinctrl-n before pinctrl-names :)

Nitpick: if you can, add [email protected] for next time, it's easier to distinguish the phone patches in huge linux-arm-msm pile :)

David

Signature · 1 line
David Heidelberg
#10 lore raw

Re: [PATCH 3/3] ARM: dts: qcom: msm8960: expressatt: Add camera flash

Quoted 41 lines · David Heidelberg
Quoted 28 lines · On 07/03/2026 01:58, Rudraksha Gupta via B4 Relay wrote:

From: Rudraksha Gupta <[email protected]>

Add camera flash support for the Samsung Galaxy Express (expressatt).

The flash IC uses a one-wire pulse-count protocol on GPIO 3, gated by PMIC MPP 4 which must be driven high to unlock the flash circuit.

Downstream references:

---
  .../dts/qcom/qcom-msm8960-samsung-expressatt.dts   | 31
++++++++++++++++++++++

  1 file changed, 31 insertions(+)
arch/arm/boot/dts/qcom/qcom-msm8960-samsung-expressatt.dts +1 -0
index c4b98af6955d..96460775a4ec 100644
@@ -1,5 +1,6 @@
   // SPDX-License-Identifier: GPL-2.0
   #include <dt-bindings/input/input.h>
+#include <dt-bindings/leds/common.h>
   #include <dt-bindings/reset/qcom,gcc-msm8960.h>
     #include "qcom-msm8960.dtsi"

arch/arm/boot/dts/qcom/qcom-msm8960-samsung-expressatt.dts touchkey_enable: touchkey-enable { · line 70

Quoted 9 lines
arch/arm/boot/dts/qcom/qcom-msm8960-samsung-expressatt.dts +6 -0
@@ -61,6 +62,20 @@ touchkey_enable: touchkey-enable {
           regulator-boot-on;
       };
   +    camera_flash: led-controller {
+        compatible = "richtek,rt8515";
+        enf-gpios = <&tlmm 3 GPIO_ACTIVE_HIGH>;
+        unlock-gpios = <&pm8921_mpps 4 GPIO_ACTIVE_HIGH>;
+        pinctrl-names = "default";
+        pinctrl-0 = <&cam_flash_en>;
+

LGTM, just please order pinctrl-n before pinctrl-names :)

Quoted 4 lines

Nitpick: if you can, add [email protected] for next time, it's easier to distinguish the phone patches in huge linux-arm-msm pile :)

Hello David,

Thanks for your comments! I have addressed them in v2 :)

Rudraksha

Quoted 3 lines

David

#11 lore raw

Re: [PATCH 3/3] ARM: dts: qcom: msm8960: expressatt: Add camera flash

In reply to Rudraksha Gupta

Hi Rudraksha,

thanks for your patch!

Quoted 12 lines · On Sat, Mar 7, 2026 at 1:58 AM Rudraksha Gupta via B4 Relay…

From: Rudraksha Gupta <[email protected]>

Add camera flash support for the Samsung Galaxy Express (expressatt).

The flash IC uses a one-wire pulse-count protocol on GPIO 3, gated by PMIC MPP 4 which must be driven high to unlock the flash circuit.

Downstream references:

(...)

arch/arm/boot/dts/qcom/qcom-msm8960-samsung-expressatt.dts touchkey_enable: touchkey-enable { · line 67

Quoted 3 lines
arch/arm/boot/dts/qcom/qcom-msm8960-samsung-expressatt.dts +3 -0
+       camera_flash: led-controller {
+               compatible = "richtek,rt8515";
+               enf-gpios = <&tlmm 3 GPIO_ACTIVE_HIGH>;

I think you should ideally define richtek,rfs-ohms, if it's impossible to find this information then use the default, richtek,rfs-ohms = <16000>;

Quoted 1 line

+ unlock-gpios = <&pm8921_mpps 4 GPIO_ACTIVE_HIGH>;

As mentioned I don't think this is right. The chip has no "unlock" signal. I think this is a simple regulator (such as a switch).

I would do:

vin-supply = <&flash_gpio_reg>;

Then something like (better if you reserarch it a bit):

flash_gpio_reg: regulator-gpio-ldo-3v3 {
compatible = "regulator-fixed";
/* Supplied in turn by VBAT? I guess so. It is between 2.8 and 5V */ regulator-name = "FLASH_3V3"; // Or whatever the rail is best called? regulator-min-microvolt = <3300000>; // If you have better guesses, use them regulator-max-microvolt = <3300000>; // If you know VBAT then use
that voltage

    gpio = <&pm8921_mpps 4 GPIO_ACTIVE_HIGH>;
    startup-delay-us = <5000>; // FIXME
    enable-active-high;
    pinctrl-names = "default";
    pinctrl-0 = <&flash_led_unlock>;
};

Notice:

+&pm8921_mpps {
+ flash_led_unlock: flash-led-unlock-state {

+               pins = "mpp4";
+               function = "digital";
+               output-low;
+               power-source = <PM8921_GPIO_S4>;

+ };

This seems completely unused in the current patch, but my addition above uses it.

Yours,
Linus Walleij