aboutsummaryrefslogtreecommitdiff
path: root/drivers/leds/leds-lp5523.c
diff options
context:
space:
mode:
authorMilo(Woogyom) Kim <milo.kim@ti.com>2013-02-05 17:57:02 +0900
committerBryan Wu <cooloney@gmail.com>2013-02-06 15:59:26 -0800
commit86eb7748cef00faa3eaefc8fc450ed30281a09e7 (patch)
tree9304bdfbaf9d762de9f7686f1554cda549ca4be5 /drivers/leds/leds-lp5523.c
parent1904f83d568dba794be9de1311bafb5a4424812a (diff)
leds-lp55xx: add device reset function in lp5521/5523
Use explicit each driver function rather than raw command. These function will be merged into the lp55xx common driver. Signed-off-by: Milo(Woogyom) Kim <milo.kim@ti.com> Signed-off-by: Bryan Wu <cooloney@gmail.com>
Diffstat (limited to 'drivers/leds/leds-lp5523.c')
-rw-r--r--drivers/leds/leds-lp5523.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/leds/leds-lp5523.c b/drivers/leds/leds-lp5523.c
index 2fc19bbddb7..cac492b0abf 100644
--- a/drivers/leds/leds-lp5523.c
+++ b/drivers/leds/leds-lp5523.c
@@ -946,6 +946,13 @@ static void lp5523_unregister_leds(struct lp5523_chip *chip)
}
}
+static void lp5523_reset_device(struct lp5523_chip *chip)
+{
+ struct i2c_client *client = chip->client;
+
+ lp5523_write(client, LP5523_REG_RESET, 0xff);
+}
+
static int lp5523_init_device(struct lp5523_chip *chip)
{
struct lp5523_platform_data *pdata = chip->pdata;
@@ -965,7 +972,8 @@ static int lp5523_init_device(struct lp5523_chip *chip)
usleep_range(1000, 2000); /* 500us abs min. */
}
- lp5523_write(client, LP5523_REG_RESET, 0xff);
+ lp5523_reset_device(chip);
+
usleep_range(10000, 20000); /*
* Exact value is not available. 10 - 20ms
* appears to be enough for reset.