Re: [PATCH] leds: driver for ab5500 high voltage leds

From: Mark Brown
Date: Wed Dec 07 2011 - 20:19:07 EST


On Wed, Dec 07, 2011 at 04:00:02PM -0800, Andrew Morton wrote:
> Denis Kuzmenko <linux@xxxxxxxxxxxxxx> wrote:

Hrm, for some reason lots of the mails here didn't reach my inbox...
anyway.

> > > My naive understanding is that you set the current limit and then
> > > the HV transformer (I guess this is a buck converter of some kind)

Boost convertor. A buck is always step down I beleive.

> > > will raise the voltage level until it either (A) cannot raise it any more
> > > at c:a 20V or (b) the current limit is reached.

> > > I suspect this is because for LEDs of this type you get a
> > > specified current but the voltage just has to be "high enough"
> > > to break through some diode barrier threshold or so. After
> > > that intensity is controlled by limiting the current.

> > > Does this suffice as explanation...?

OK, that's exactly the sort of hardware I thought you were driving.
There's several drivers for this type of LED in the kernel already.

> I won't do anything with this patch yet - I'm waiting to see if Mark
> stops being surprised ;)

I'm still surprised I'm afraid. The voltage is generally fixed by the
platform (approximately anyway) to be whatever is needed to get the LEDs
to start doing something and the current is varied to control the
brightness with an upper limit configured based on what the LEDs can
carry and what is sane for the physical design (blinding users tends not
to be popular). The funciton of the current regulator in the system is
to constrain the brightness of the LED so that it doesn't just go to
maximum brightness without burning power on a resistive load.

This means that usually the current control does map fairly directly
onto the LED API brightness, normally with a scaling as the eye
percieves things on a log scale but we expect brightness to be linear.
This scaling may be pre-done by the choice of current limits in the
current regulator.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/