diff options
author | Milo(Woogyom) Kim <milo.kim@ti.com> | 2013-02-05 03:57:02 -0500 |
---|---|---|
committer | Bryan Wu <cooloney@gmail.com> | 2013-02-06 18:59:26 -0500 |
commit | 86eb7748cef00faa3eaefc8fc450ed30281a09e7 (patch) | |
tree | 9304bdfbaf9d762de9f7686f1554cda549ca4be5 /drivers/leds/leds-lp5521.c | |
parent | 1904f83d568dba794be9de1311bafb5a4424812a (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-lp5521.c')
-rw-r--r-- | drivers/leds/leds-lp5521.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/leds/leds-lp5521.c b/drivers/leds/leds-lp5521.c index ec1ffe6316c1..ec89ed641005 100644 --- a/drivers/leds/leds-lp5521.c +++ b/drivers/leds/leds-lp5521.c | |||
@@ -687,6 +687,13 @@ static void lp5521_unregister_sysfs(struct i2c_client *client) | |||
687 | &lp5521_led_attribute_group); | 687 | &lp5521_led_attribute_group); |
688 | } | 688 | } |
689 | 689 | ||
690 | static void lp5521_reset_device(struct lp5521_chip *chip) | ||
691 | { | ||
692 | struct i2c_client *client = chip->client; | ||
693 | |||
694 | lp5521_write(client, LP5521_REG_RESET, 0xff); | ||
695 | } | ||
696 | |||
690 | static int lp5521_init_device(struct lp5521_chip *chip) | 697 | static int lp5521_init_device(struct lp5521_chip *chip) |
691 | { | 698 | { |
692 | struct lp5521_platform_data *pdata = chip->pdata; | 699 | struct lp5521_platform_data *pdata = chip->pdata; |
@@ -707,7 +714,8 @@ static int lp5521_init_device(struct lp5521_chip *chip) | |||
707 | usleep_range(1000, 2000); /* 500us abs min. */ | 714 | usleep_range(1000, 2000); /* 500us abs min. */ |
708 | } | 715 | } |
709 | 716 | ||
710 | lp5521_write(client, LP5521_REG_RESET, 0xff); | 717 | lp5521_reset_device(chip); |
718 | |||
711 | usleep_range(10000, 20000); /* | 719 | usleep_range(10000, 20000); /* |
712 | * Exact value is not available. 10 - 20ms | 720 | * Exact value is not available. 10 - 20ms |
713 | * appears to be enough for reset. | 721 | * appears to be enough for reset. |