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

From: Shreshtha Kumar SAHU
Date: Wed Dec 14 2011 - 09:03:01 EST


On Wed, Dec 14, 2011 at 12:37:15 +0100, Mark Brown wrote:
> On Wed, Dec 14, 2011 at 11:23:58AM +0100, Shreshtha Kumar SAHU wrote:
>
> > The actual amount of current flowing hence brightness variation can then be
> > altered using PWM, which is also the case in present driver.
>
> > Hence the idea of current control sysfs interface is provided to further
> > decrease the max current through the LED(s) if required for saving power
> > (but can never exceed the max current set by the platform).
> > After fixing the current, "brightness" interface can be used to control
> > brightness which internally cofigures the PWM register.
>
> The above basically sounds like you're using the current limit as a way
> of adjusting the maximum brightness dynamically for power saving
> reasons. This doesn't sound like something that individual drivers
> should be doing, it sounds like something that either the subsystem or
> userspace code ought to be implementing.

As far as I know some boost converters can be controlled dynamically for
power optimized operation by PMIC. Yes exactly as you stated, I wanted to
provide something similar as done to boost converters by exposing current
control via sysfs. Otherwise this current control from sysfs can be
completely ignored by the user and simply use brightness for LED control.

> It'd seem more natural for the driver to scale both the PWM and current
> settings with brightness.
I will try to implement this. In AB5500, PWM provides 1024 steps from 0 to
full current, and current 16 steps from 2.5mA to 40mA. I need to derive a
way to optmially change both PWM and current to get requested brigtness in
range of 0-255 (i.e. LED_OFF to LED_FULL).
Bur I fear that changing both PWM and current may lead to non linear
variation and equation needs to be derived to get it correct which will
add complexity to ab5500_led_brightness_set and hence API brightness.
In addition if platform sets max current to 10mA then brightness_set()
will have only 4 steps for current variation and in thus an overhead if
we combined current and PWM control calculation.
Please suggest.

Regards,
Shreshtha



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