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 11:07:53PM +0100, Linus Walleij wrote:
> On Wed, Nov 11, 2020 at 5:56 PM Sakari Ailus <sakari.ailus@xxxxxx> wrote:
> > On Wed, Nov 11, 2020 at 05:34:58PM +0100, Linus Walleij wrote:
> 
> > > 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.
> 
> Hm you're right of course.
> 
> I did some research, the flash driver in the RT8515
> appears to be somewhat clever.
> 
> Here is a schematic picture from the LG P970 service
> manual where you can see the connections from the RT8515
> to the LED:
> https://dflund.se/~triad/images/rt8515.jpg
> 
> On this image you can see that there are two resistors connected
> from the pins "RFS" and "RTS" to ground.
> 
> RFS (resistance flash setting?) is 20 kOhm
> RTS (resistance torch setting?) is 39 kOhm
> 
> Some sleuthing finds us the RT9387A which we have a datasheet for:
> https://static5.arrow.com/pdfs/2014/7/27/8/21/12/794/rtt_/manual/94download_ds.jspprt9387a.jspprt9387a.pdf
> This apparently works the same way so now we have a
> RT9387A driver as well.
> 
> The two resistances control the max current for flash
> and torch, with I = 5500 / R, up to 700 mA.
> For 20 and 39 kOhm this means
> 
> ImaxFlash = 275 mA
> ImaxTorch = 141 mA
> 
> So the max current is actually hardwired into the
> circuit.

Nice; thanks for digging into this! Interesting indeed, I have to admit
I've only seen software limited implementations up to now.

So here it's indeed not necessary to know the limits to operate the device
safely, and the limits would (or could) remain for the user interface's
purpose only (from driver PoV).

> 
> The setting of brightness is done with the pulse train,
> but it is a PWM dimmer setting on top of the max
> current.
> 
> So I'll just put in these max currents (assuming they
> are using the same equation).

Sounds good.

I think it'd be nice to have the limits, but they could be optional --- it
might not be always possible to know them in general case. I wonder if
anyone else has thoughts on this.

Cc'ing also linux-media.

-- 
Kind regards,

Sakari Ailus



[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux