linux/Documentation/leds/leds-lp5521.txt
<<
>>
Prefs
   1Kernel driver for lp5521
   2========================
   3
   4* National Semiconductor LP5521 led driver chip
   5* Datasheet: http://www.national.com/pf/LP/LP5521.html
   6
   7Authors: Mathias Nyman, Yuri Zaporozhets, Samu Onkalo
   8Contact: Samu Onkalo (samu.p.onkalo-at-nokia.com)
   9
  10Description
  11-----------
  12
  13LP5521 can drive up to 3 channels. Leds can be controlled directly via
  14the led class control interface. Channels have generic names:
  15lp5521:channelx, where x is 0 .. 2
  16
  17All three channels can be also controlled using the engine micro programs.
  18More details of the instructions can be found from the public data sheet.
  19
  20LP5521 has the internal program memory for running various LED patterns.
  21For the details, please refer to 'firmware' section in leds-lp55xx.txt
  22
  23sysfs contains a selftest entry.
  24The test communicates with the chip and checks that
  25the clock mode is automatically set to the requested one.
  26
  27Each channel has its own led current settings.
  28/sys/class/leds/lp5521:channel0/led_current - RW
  29/sys/class/leds/lp5521:channel0/max_current - RO
  30Format: 10x mA i.e 10 means 1.0 mA
  31
  32example platform data:
  33
  34Note: chan_nr can have values between 0 and 2.
  35The name of each channel can be configurable.
  36If the name field is not defined, the default name will be set to 'xxxx:channelN'
  37(XXXX : pdata->label or i2c client name, N : channel number)
  38
  39static struct lp55xx_led_config lp5521_led_config[] = {
  40        {
  41                .name = "red",
  42                .chan_nr        = 0,
  43                .led_current    = 50,
  44                .max_current    = 130,
  45        }, {
  46                .name = "green",
  47                .chan_nr        = 1,
  48                .led_current    = 0,
  49                .max_current    = 130,
  50        }, {
  51                .name = "blue",
  52                .chan_nr        = 2,
  53                .led_current    = 0,
  54                .max_current    = 130,
  55        }
  56};
  57
  58static int lp5521_setup(void)
  59{
  60        /* setup HW resources */
  61}
  62
  63static void lp5521_release(void)
  64{
  65        /* Release HW resources */
  66}
  67
  68static void lp5521_enable(bool state)
  69{
  70        /* Control of chip enable signal */
  71}
  72
  73static struct lp55xx_platform_data lp5521_platform_data = {
  74        .led_config     = lp5521_led_config,
  75        .num_channels   = ARRAY_SIZE(lp5521_led_config),
  76        .clock_mode     = LP55XX_CLOCK_EXT,
  77        .setup_resources   = lp5521_setup,
  78        .release_resources = lp5521_release,
  79        .enable            = lp5521_enable,
  80};
  81
  82If the current is set to 0 in the platform data, that channel is
  83disabled and it is not visible in the sysfs.
  84
lxr.linux.no kindly hosted by Redpill Linpro AS, provider of Linux consulting and operations services since 1995.