Hi all,

There is already a light HAL in Gecko for enabling the LEDs.

Here shows that how many types of light we can use.
http://mxr.mozilla.org/mozilla-central/source/hal/HalTypes.h#28

Here is a sample of we try to light a LED for use case of battery.
http://mxr.mozilla.org/mozilla-central/source/hal/gonk/GonkHal.cpp#283

Sincerely yours.
----- 原始郵件 -----
寄件者: "Alexandre Lissy" <[email protected]>
收件者: [email protected]
寄件備份: 2013 8 月 6 星期二 下午 5:10:46
主旨: Re: [b2g] LED API?

Le 06/08/2013 10:47, Jonas Sicking a écrit :
> On Aug 6, 2013 12:54 AM, "Jordano Francisco (UK)" <
> [email protected]> wrote:
>>
>> Hi all,
>>
>>
>> On 06/08/2013 07:43, "Jonas Sicking" <[email protected]> wrote:
>>
>>> On Aug 5, 2013 11:07 PM, "Karim Geiger" <[email protected]> wrote:
>>>>
>>>> On 08/05/2013 07:26 PM, Jonas Sicking wrote:
>>>>> No. Do we need any?
>>>>
>>>> I think that's an important point. There are some cases you want to
>>>> control the LED separately.
>>>
>>> I think we need a bit more detail than that in order to spend time on
> this
>>> :-)
>>>
>>> / Jonas
>>
>> Typical use case for this api could be notifications, like FB
>> notifications in android,
>> use this API to setup the led blue.
>>
>> Other use cases (in samsung android phones):
>>
>> Red when plugged in - Charging
>> Green when plugged in - Charging complete.
>> Red when not plugged in - Low battery warning
>> Blue - Audio is recording or you have a notification waiting.
> 
> Is the LED usually in control of system level logic, or is it more commonly
> handled by drivers?
> 
> I.e. would we be able to implement a LED API on most platforms?

On a kernel level they appear to be part of the 'leds' class.

For example, on Inari, you have:
# ls -l /sys/class/leds/
lrwxrwxrwx root     root              2013-08-06 10:45 button-backlight
-> ../../devices/platform/leds-gpio/leds/button-backlight
lrwxrwxrwx root     root              2013-08-06 10:45 green ->
../../devices/platform/pmic-leds/leds/green
lrwxrwxrwx root     root              2013-08-06 10:45 lcd-backlight ->
../../devices/platform/msm_fb.524801/leds/lcd-backlight
lrwxrwxrwx root     root              2013-08-06 10:45 red ->
../../devices/platform/pmic-leds/leds/red

If you echo 1 to /sys/class/leds/green/brightness and to
/sys/class/leds/red/brightness, you get an orange led notification on
Inari :)

Cross checking, I get similar behavior on Desire Z running Android 2.3.3.

> 
> Either way, implementing an API which is exposed to only the system app
> sounds like it would make sense. Though we would likely need the API to
> expose which colors the hardware is able to support.
> 
> / Jonas
> _______________________________________________
> dev-b2g mailing list
> [email protected]
> https://lists.mozilla.org/listinfo/dev-b2g
> 

_______________________________________________
dev-b2g mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-b2g
_______________________________________________
dev-b2g mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-b2g

Reply via email to