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

From: Linus Walleij

Date: Sun Mar 08 2026 - 19:24:26 EST


Hi Rudraksha,

thanks for your patch!

Overall this looks fine but:

On Sat, Mar 7, 2026 at 1:58 AM Rudraksha Gupta via B4 Relay
<devnull+guptarud.gmail.com@xxxxxxxxxx> wrote:

> struct regulator *reg;

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

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

> + if (rt->unlock_gpio)
> + gpiod_set_value_cansleep(rt->unlock_gpio, 0);

Add code to disable the vin regulator instead.

> + /* 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.

> if (state) {
> + /* 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