Re: [PATCH 2/2 v3] leds: rt8515: Add Richtek RT8515 LED driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Linus,

On Wed, Nov 11, 2020 at 05:34:58PM +0100, Linus Walleij wrote:
> On Wed, Nov 11, 2020 at 12:40 PM Sakari Ailus <sakari.ailus@xxxxxx> wrote:
> > On Wed, Nov 11, 2020 at 02:14:17AM +0100, Linus Walleij wrote:
> 
> > > +     } else if (brightness < RT8515_TORCH_MAX) {
> > > +             /* Step it up to movie mode brightness using the flash pin */
> > > +             rt8515_gpio_brightness_commit(rt->ent, brightness);
> >
> > What's the unit of brightness here? If you don't know the unit, you could
> > still assume something and fix it later if needed. Or the current could be
> > just measured.
> >
> > It's usually linear but if the number of steps is small then logarithmic
> > scale is also not unforeseen.
> 
> I will try to come up with something...
> 
> > > +     } else {
> > > +             /* Max torch brightness requested */
> > > +             gpiod_set_value(rt->ent, 1);
> >
> > What's the current in this case? The maximum really should come from DT to
> > avoid frying components.
> 
> The way I understand it is that this component contains its own
> current regulation electronic. You request a brightness
> between 1-100 and it will support this range (no external
> current boost). And as a user that is "all you need to know".
> 
> Isn't this problem more prevalent when you have some kind of
> external current-regulator that you need to program?
> 
> This component draws its power directly from VBAT (the main
> battery) so regulating how much of that it takes is up to the
> component.
> 
> I could think of the component brightness being a problem if
> the flash is embedded in some kind of plastic that cannot
> take the heat though, but I haven't seen any code trying to
> hold it down for this reason. I suppose the component
> datasheet (that I don't have) specifies all these things...

The LED is different from the LED driver. If you happen to have a LED with
smaller maximum current than the LED driver can provide, the software has
to limit the current the driver provides, or hardware damage will result.

This is why virtually all flash LED drivers have these properties.

I guess you could use the maximum as it is known the driver uses the
maximum current on those devices? How about the torch mode, does that use
maximum as well?

A (safe) way forward now, without knowing the current in various
configurations, could be to document the said properties in DT bindings,
but the driver would only work if it gets the maximum values from the DT.
Or use the lowest setting otherwise.

-- 
Kind regards,

Sakari Ailus



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux