summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamu Onkalo <samu.p.onkalo@nokia.com>2010-11-24 12:57:05 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2010-11-25 06:50:44 +0900
commit11e7946f196e5fdde20584e3e58c60335ee3b3bc (patch)
tree81a1ee57bd8bc9a434af718a0769cf609fc7356f
parent95ea8eec341c1fc881407c96114de7e4173c1b7c (diff)
downloadop-kernel-dev-11e7946f196e5fdde20584e3e58c60335ee3b3bc.zip
op-kernel-dev-11e7946f196e5fdde20584e3e58c60335ee3b3bc.tar.gz
drivers/leds/leds-lp5523.c: perform SW reset before detection
Chip detection may fail if the chip is in some odd state for example after system restart. Chip doesn't have HW reset line. Signed-off-by: Samu Onkalo <samu.p.onkalo@nokia.com> Cc: Richard Purdie <rpurdie@rpsys.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--drivers/leds/leds-lp5523.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/drivers/leds/leds-lp5523.c b/drivers/leds/leds-lp5523.c
index 4248d78..0cc4ead 100644
--- a/drivers/leds/leds-lp5523.c
+++ b/drivers/leds/leds-lp5523.c
@@ -203,13 +203,6 @@ static int lp5523_configure(struct i2c_client *client)
{ 0x9c, 0x50, 0x9c, 0xd0, 0x9d, 0x80, 0xd8, 0x00, 0},
};
- lp5523_write(client, LP5523_REG_RESET, 0xff);
-
- usleep_range(10000, 20000); /*
- * Exact value is not available. 10 - 20ms
- * appears to be enough for reset.
- */
-
ret |= lp5523_write(client, LP5523_REG_ENABLE, LP5523_ENABLE);
/* Chip startup time is 500 us, 1 - 2 ms gives some margin */
usleep_range(1000, 2000);
@@ -941,6 +934,11 @@ static int lp5523_probe(struct i2c_client *client,
usleep_range(1000, 2000); /* 500us abs min. */
}
+ lp5523_write(client, LP5523_REG_RESET, 0xff);
+ usleep_range(10000, 20000); /*
+ * Exact value is not available. 10 - 20ms
+ * appears to be enough for reset.
+ */
ret = lp5523_detect(client);
if (ret)
goto fail2;
OpenPOWER on IntegriCloud