N900 Hardware LED

(New page: =Hardware= The N900 has a LP5521<ref name="lp5521-spec">http://www.national.com/pf/LP/LP5521.html</ref> <ref name="lp5521-driver">http://mxr.maemo.org/fremantle/source/kernel/drivers/i2c/...)
(Hardware)
Line 1: Line 1:
=Hardware=
=Hardware=
-
The N900 has a LP5521<ref name="lp5521-spec">http://www.national.com/pf/LP/LP5521.html</ref>  <ref name="lp5521-driver">http://mxr.maemo.org/fremantle/source/kernel/drivers/i2c/chips/lp5521.c</ref> programmable three channel controller LED Driver which handles the leds.
+
The N900 has a LP5521<ref name="lp5521-spec">http://www.national.com/pf/LP/LP5521.html</ref>  <ref name="lp5521-driver">http://mxr.maemo.org/fremantle/source/kernel/drivers/i2c/chips/lp5521.c</ref> programmable three channel controller LED Driver which handles the keyboard and notification LED. (not the [[N900 Hardware Flash Torch|flash LEDs])
(actually it has a LP5523 it seems <ref name="lp5523-spec">http://www.national.com/pf/LP/LP5523.html</ref> <ref name="leds-lp5523-driver">http://mxr.maemo.org/fremantle/source/kernel/drivers/leds/leds-lp5523.c</ref>, which has 3 engines like LP5521 but can drive 9 LEDs via a multiplexer)
(actually it has a LP5523 it seems <ref name="lp5523-spec">http://www.national.com/pf/LP/LP5523.html</ref> <ref name="leds-lp5523-driver">http://mxr.maemo.org/fremantle/source/kernel/drivers/leds/leds-lp5523.c</ref>, which has 3 engines like LP5521 but can drive 9 LEDs via a multiplexer)
Line 7: Line 7:
* disabled: The channel is disabled - not running
* disabled: The channel is disabled - not running
* load: In that state, there are two more files in that directory:  
* load: In that state, there are two more files in that directory:  
-
** engine1_leds is in the form "0000rgb00" (9 digits, "1" or "0"), where rgb control which leds should participate. The 6 "0" in the above pattern correspond to the 6 kbd white leds controlled by mce via engine3, so readout of engine3_leds gives 111100011 ;-)
+
** engine1_LEDs is in the form "0000rgb00" (9 digits, "1" or "0"), where rgb control which LEDs should participate. The 6 "0" in the above pattern correspond to the 6 kbd white LEDs controlled by MCE via engine3, so readout of engine3_leds gives 111100011 ;-)
** engine1_load accepts a string as specified above (e.g. 9d804000427f0d7f7f007f0042000000). LP5523 has an absolute storage of 96 steps a 16bits, which can dynamically partitioned between the three engines. (ToDo: check if driver supports >16 instructions / machine)
** engine1_load accepts a string as specified above (e.g. 9d804000427f0d7f7f007f0042000000). LP5523 has an absolute storage of 96 steps a 16bits, which can dynamically partitioned between the three engines. (ToDo: check if driver supports >16 instructions / machine)
After that, when the state is changed to "run", the program will be ran by the controller.  
After that, when the state is changed to "run", the program will be ran by the controller.  
-
In order for the leds to work, the led_current of the appropriate leds need to be set to non-zero values. This is accomplished by writing to files leds:lp5523:[bgr]/led_current under the same directory. Perhaps (?) not or values are suitable.
+
In order for the LEDs to work, the led_current of the appropriate LEDs need to be set to non-zero values. This is accomplished by writing to files LEDs:lp5523:[bgr]/led_current under the same directory. Perhaps (?) not or values are suitable.
NOTE: There must be a delay (how much? The specs of LP5521 mentions it) between writes to sysfs files.
NOTE: There must be a delay (how much? The specs of LP5521 mentions it) between writes to sysfs files.

Revision as of 23:40, 7 June 2010

Hardware

The N900 has a LP5521[1] [2] programmable three channel controller LED Driver which handles the keyboard and notification LED. (not the [[N900 Hardware Flash Torch|flash LEDs]) (actually it has a LP5523 it seems [3] [4], which has 3 engines like LP5521 but can drive 9 LEDs via a multiplexer)

The controller can be programmed via "/sys/class/i2c-adapter/i2c-2/2-0032" (FIXME: is this stable?). In that directory there are three files corresponding to the three channels: engine1_mode, engine2_mode and engine3_mode. Each file "stores" one of "run", "load", "disabled" (it seems that there is another mode "direct" but it doesn't work):

  • run: The program runs
  • disabled: The channel is disabled - not running
  • load: In that state, there are two more files in that directory:
    • engine1_LEDs is in the form "0000rgb00" (9 digits, "1" or "0"), where rgb control which LEDs should participate. The 6 "0" in the above pattern correspond to the 6 kbd white LEDs controlled by MCE via engine3, so readout of engine3_leds gives 111100011 ;-)
    • engine1_load accepts a string as specified above (e.g. 9d804000427f0d7f7f007f0042000000). LP5523 has an absolute storage of 96 steps a 16bits, which can dynamically partitioned between the three engines. (ToDo: check if driver supports >16 instructions / machine)

After that, when the state is changed to "run", the program will be ran by the controller.

In order for the LEDs to work, the led_current of the appropriate LEDs need to be set to non-zero values. This is accomplished by writing to files LEDs:lp5523:[bgr]/led_current under the same directory. Perhaps (?) not or values are suitable.

NOTE: There must be a delay (how much? The specs of LP5521 mentions it) between writes to sysfs files.

Software


Cite error: <ref> tags exist, but no <references/> tag was found