mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-29 10:01:25 +00:00
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>
This commit is contained in:
parent
1904f83d56
commit
86eb7748ce
2 changed files with 18 additions and 2 deletions
|
@ -687,6 +687,13 @@ static void lp5521_unregister_sysfs(struct i2c_client *client)
|
||||||
&lp5521_led_attribute_group);
|
&lp5521_led_attribute_group);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void lp5521_reset_device(struct lp5521_chip *chip)
|
||||||
|
{
|
||||||
|
struct i2c_client *client = chip->client;
|
||||||
|
|
||||||
|
lp5521_write(client, LP5521_REG_RESET, 0xff);
|
||||||
|
}
|
||||||
|
|
||||||
static int lp5521_init_device(struct lp5521_chip *chip)
|
static int lp5521_init_device(struct lp5521_chip *chip)
|
||||||
{
|
{
|
||||||
struct lp5521_platform_data *pdata = chip->pdata;
|
struct lp5521_platform_data *pdata = chip->pdata;
|
||||||
|
@ -707,7 +714,8 @@ static int lp5521_init_device(struct lp5521_chip *chip)
|
||||||
usleep_range(1000, 2000); /* 500us abs min. */
|
usleep_range(1000, 2000); /* 500us abs min. */
|
||||||
}
|
}
|
||||||
|
|
||||||
lp5521_write(client, LP5521_REG_RESET, 0xff);
|
lp5521_reset_device(chip);
|
||||||
|
|
||||||
usleep_range(10000, 20000); /*
|
usleep_range(10000, 20000); /*
|
||||||
* Exact value is not available. 10 - 20ms
|
* Exact value is not available. 10 - 20ms
|
||||||
* appears to be enough for reset.
|
* appears to be enough for reset.
|
||||||
|
|
|
@ -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)
|
static int lp5523_init_device(struct lp5523_chip *chip)
|
||||||
{
|
{
|
||||||
struct lp5523_platform_data *pdata = chip->pdata;
|
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. */
|
usleep_range(1000, 2000); /* 500us abs min. */
|
||||||
}
|
}
|
||||||
|
|
||||||
lp5523_write(client, LP5523_REG_RESET, 0xff);
|
lp5523_reset_device(chip);
|
||||||
|
|
||||||
usleep_range(10000, 20000); /*
|
usleep_range(10000, 20000); /*
|
||||||
* Exact value is not available. 10 - 20ms
|
* Exact value is not available. 10 - 20ms
|
||||||
* appears to be enough for reset.
|
* appears to be enough for reset.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue