aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/leds/leds-lp55xx-common.h
diff options
context:
space:
mode:
authorMilo(Woogyom) Kim <milo.kim@ti.com>2013-02-05 05:06:27 -0500
committerBryan Wu <cooloney@gmail.com>2013-02-06 18:59:28 -0500
commit9e9b3db1b2f725bacaf1b7e8708a0c78265bde97 (patch)
tree498353c79883feb33c7ea93dda7742eb7c1b7dcc /drivers/leds/leds-lp55xx-common.h
parent6ce6176263393dd80b9a537c1e1462b8529f240b (diff)
leds-lp55xx: use lp55xx common led registration function
LED class devices are registered in lp5521_register_leds() and lp5523_register_leds(). Two separate functions are merged into consolidated lp55xx function, lp55xx_register_leds(). Error handling fix: Unregistering LEDS are handled in lp55xx_register_leds() when LED registration failure occurs. So each driver error handler is changed to 'err_register_leds' Chip dependency: 'brightness_work_fn' and 'set_led_current' To make the structure abstract, both functions are configured in each driver. Those functions should be done by each driver because register control is chip-dependant work. lp55xx_init_led: skeleton Will be filled in next patch Signed-off-by: Milo(Woogyom) Kim <milo.kim@ti.com> Signed-off-by: Bryan Wu <cooloney@gmail.com>
Diffstat (limited to 'drivers/leds/leds-lp55xx-common.h')
-rw-r--r--drivers/leds/leds-lp55xx-common.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/leds/leds-lp55xx-common.h b/drivers/leds/leds-lp55xx-common.h
index 908b00a56b7e..219780a2d4eb 100644
--- a/drivers/leds/leds-lp55xx-common.h
+++ b/drivers/leds/leds-lp55xx-common.h
@@ -33,6 +33,8 @@ struct lp55xx_reg {
33 * @reset : Chip specific reset command 33 * @reset : Chip specific reset command
34 * @enable : Chip specific enable command 34 * @enable : Chip specific enable command
35 * @post_init_device : Chip specific initialization code 35 * @post_init_device : Chip specific initialization code
36 * @brightness_work_fn : Brightness work function
37 * @set_led_current : LED current set function
36 */ 38 */
37struct lp55xx_device_config { 39struct lp55xx_device_config {
38 const struct lp55xx_reg reset; 40 const struct lp55xx_reg reset;
@@ -40,6 +42,12 @@ struct lp55xx_device_config {
40 42
41 /* define if the device has specific initialization process */ 43 /* define if the device has specific initialization process */
42 int (*post_init_device) (struct lp55xx_chip *chip); 44 int (*post_init_device) (struct lp55xx_chip *chip);
45
46 /* access brightness register */
47 void (*brightness_work_fn)(struct work_struct *work);
48
49 /* current setting function */
50 void (*set_led_current) (struct lp55xx_led *led, u8 led_current);
43}; 51};
44 52
45/* 53/*
@@ -88,4 +96,7 @@ extern int lp55xx_update_bits(struct lp55xx_chip *chip, u8 reg,
88extern int lp55xx_init_device(struct lp55xx_chip *chip); 96extern int lp55xx_init_device(struct lp55xx_chip *chip);
89extern void lp55xx_deinit_device(struct lp55xx_chip *chip); 97extern void lp55xx_deinit_device(struct lp55xx_chip *chip);
90 98
99/* common LED class device functions */
100extern int lp55xx_register_leds(struct lp55xx_led *led,
101 struct lp55xx_chip *chip);
91#endif /* _LEDS_LP55XX_COMMON_H */ 102#endif /* _LEDS_LP55XX_COMMON_H */