aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/leds/leds-lp55xx-common.c
diff options
context:
space:
mode:
authorMilo(Woogyom) Kim <milo.kim@ti.com>2013-02-05 04:57:36 -0500
committerBryan Wu <cooloney@gmail.com>2013-02-06 18:59:27 -0500
commitffbdccdbbaee814963a09d25b1cc598cfe131366 (patch)
treeed487c6e89fb106fd7de798d166ee4342efac85e /drivers/leds/leds-lp55xx-common.c
parente3a700d8aae190e09fb06abe0ddd2e172a682508 (diff)
leds-lp55xx: use lp55xx common init function - post int
LP5521/5523 chip configuration is replaced with lp55xx common function, lp55xx_post_init_device(). Name change: lp5521/5523_configure() to lp5521/5523_post_init_device() These are called in init function. Register access function Argument type is changed from 'i2c_client' to 'lp55xx_chip'. Use exported R/W functions of lp55xx common driver. Temporary variables in lp5521/5523_init_device() These functions will be removed but temporary variables are needed for blocking build warnings - incompatible pointer. 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.c')
-rw-r--r--drivers/leds/leds-lp55xx-common.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/leds/leds-lp55xx-common.c b/drivers/leds/leds-lp55xx-common.c
index 6fede0b96715..74beb363b787 100644
--- a/drivers/leds/leds-lp55xx-common.c
+++ b/drivers/leds/leds-lp55xx-common.c
@@ -53,6 +53,16 @@ static int lp55xx_detect_device(struct lp55xx_chip *chip)
53 return 0; 53 return 0;
54} 54}
55 55
56static int lp55xx_post_init_device(struct lp55xx_chip *chip)
57{
58 struct lp55xx_device_config *cfg = chip->cfg;
59
60 if (!cfg->post_init_device)
61 return 0;
62
63 return cfg->post_init_device(chip);
64}
65
56int lp55xx_write(struct lp55xx_chip *chip, u8 reg, u8 val) 66int lp55xx_write(struct lp55xx_chip *chip, u8 reg, u8 val)
57{ 67{
58 return i2c_smbus_write_byte_data(chip->cl, reg, val); 68 return i2c_smbus_write_byte_data(chip->cl, reg, val);
@@ -132,6 +142,11 @@ int lp55xx_init_device(struct lp55xx_chip *chip)
132 goto err; 142 goto err;
133 } 143 }
134 144
145 /* chip specific initialization */
146 ret = lp55xx_post_init_device(chip);
147
148 return 0;
149
135err: 150err:
136 return ret; 151 return ret;
137} 152}