Re: [PATCH v3 2/3] leds: flash: rt8515: Support single-GPIO flash ICs with vin supply

Linus Walleij
2026-03-26T10:11:33Z

Hi Rudraksha,

this is starting to look good, some remaining snags below:

On Thu, Mar 26, 2026 at 8:57 AM Rudraksha Gupta via B4 Relay
<devnull+guptarud.gmail.com@kernel.org> wrote:

> -static void rt8515_gpio_brightness_commit(struct gpio_desc *gpiod,
> - int brightness)
> +static int rt8515_set_flash_brightness(struct rt8515 *rt,
> + struct gpio_desc *gpiod,
> + int brightness)

Do not change the name of the function, it's confusing.
This is also used for setting the brightness of the torch, and after
this change it looks like the function is just for the flash.

> } 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);
> + /* Step it up to movie mode brightness */
> + ret = rt8515_set_flash_brightness(rt, rt->enable_torch ?
> + rt->enable_torch : rt->enable_flash, brightness);
> + if (ret)
> + goto out;

Add a comment befor this that if we don't have a separate torch
enable pin connected, we use the flash pin also for the torch.

Yours,
Linus Walleij