leds: add new LP5562 LED driver

LP5562 can drive up to 4 channels, RGB and White.
LEDs can be controlled directly via the led class control interface.

 LP55xx common driver
  LP5562 is one of LP55xx family device, so LP55xx common code are used.
  On the other hand, chip specific configuration is defined in the structure
  'lp55xx_device_config'

 LED pattern data
  LP5562 has also internal program memory which is used for running various LED
  patterns. LP5562 driver supports the firmware interface and the predefined
  pattern data as well.

 LP5562 device attributes: 'led_pattern' and 'engine_mux'
  A 'led_pattern' is an index code which runs the predefined pattern data.
  And 'engine_mux' is updated with the firmware interface is activated.
  Detailed description has been updated in the documentation files,
  'leds-lp55xx.txt' and 'leds-lp5562.txt'.

 Changes on the header file
  LP5562 configurable definitions are added.
  Pattern RGB data is fixed as constant value.
  (No side effect on other devices, LP5521 or LP5523.)

(cooloney@gmail.com: remove redundant mutex_unlock(). Reported by Dan
Carpenter <dan.carpenter@oracle.com>)

Signed-off-by: Milo(Woogyom) Kim <milo.kim@ti.com>
Signed-off-by: Bryan Wu <cooloney@gmail.com>
This commit is contained in:
Kim, Milo
2013-02-18 21:10:14 -08:00
committed by Bryan Wu
parent 07961ac7c0
commit ff45262a85
8 changed files with 799 additions and 7 deletions

View File

@@ -32,6 +32,13 @@
#define LP5521_CLK_INT 1 /* Internal clock */
#define LP5521_CLK_AUTO 2 /* Automatic clock selection */
/* Bits in LP5562 CONFIG register */
#define LP5562_PWM_HF LP5521_PWM_HF
#define LP5562_PWRSAVE_EN LP5521_PWRSAVE_EN
#define LP5562_CLK_SRC_EXT LP5521_CLK_SRC_EXT
#define LP5562_CLK_INT LP5521_CLK_INT
#define LP5562_CLK_AUTO LP5521_CLK_AUTO
struct lp55xx_led_config {
const char *name;
u8 chan_nr;
@@ -40,9 +47,9 @@ struct lp55xx_led_config {
};
struct lp55xx_predef_pattern {
u8 *r;
u8 *g;
u8 *b;
const u8 *r;
const u8 *g;
const u8 *b;
u8 size_r;
u8 size_g;
u8 size_b;