Re: [PATCH 3/3] devicetree: Add led-backlight binding

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

 




On 26/08/15 10:07, Jacek Anaszewski wrote:
> On 08/25/2015 05:41 PM, Tomi Valkeinen wrote:
>>
>>
>> On 25/08/15 16:39, Jacek Anaszewski wrote:
>>
>>>> +Example:
>>>> +
>>>> +    backlight {
>>>> +        compatible = "led-backlight";
>>>> +        leds = <&backlight_led>;
>>>> +
>>>> +        brightness-levels = <0 4 8 16 32 64 128 255>;
>>>
>>> brightness level is not a suitable unit for describing LED brightness
>>> in a Device Tree, as it is not a physical unit. We have led-max-microamp
>>> property for this, expressed in microamperes, please refer to [0] from
>>> linux-next.
>>
>> Hmm, ok, but what should the driver do with microamperes? As far as I
>> see, "enum led_brightness" (which is between 0-255) is used to set the
>> brightness to LEDs. I don't see any function accepting microamperes.
> 
> This is implementation detail. You can convert microamperes to
> enum led_brightness in the driver. Please refer to the discussion [1].

The led_set_brightness() takes "enum led_brightness", so I don't
understand what this driver would do with the microampere value. It
could, of course, do an arbitrary conversion, say, direct mapping of the
mA value to brightness, but that would just confuse things further.

If there was a led_set_microampere(), supported by all led devices, then
yes, the above should be microamperes.

Or are you saying that I should have the binding use microamperes, and
just do a naive microampere -> brightness conversion in this driver, and
hope that in the future this driver can be changes to pass the
micrompere value directly to the underlying LED driver?

And speaking of microamperes for LED drivers, what's a meaningful
microampere conversion for LED drivers that don't deal with microamperes
at all? For example, the LED chip we're using, TLC59108, is basically a
PWM chip. Can we somehow calculate microamperes if we know duty cycle
and period?

 Tomi

Attachment: signature.asc
Description: OpenPGP digital signature


[Index of Archives]     [Video for Linux]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Tourism]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux