summaryrefslogtreecommitdiff
path: root/drivers/power/lp8727_charger.c
diff options
context:
space:
mode:
authorKim, Milo <Milo.Kim@ti.com>2012-08-31 09:24:09 +0000
committerAnton Vorontsov <anton.vorontsov@linaro.org>2012-09-20 18:00:38 -0700
commit638555d2769b7dfb8654bae513cff295ea9a3837 (patch)
treec09a15530b99484f99e21c463c53bc48a867fab6 /drivers/power/lp8727_charger.c
parentd71fda01610269e3aaedd451f8d3e34cdf550036 (diff)
downloadlwn-638555d2769b7dfb8654bae513cff295ea9a3837.tar.gz
lwn-638555d2769b7dfb8654bae513cff295ea9a3837.zip
lp8727_charger: Clear interrrupts at inital time
To initialize the device, previous interrupts need to be cleared while loading the driver. Signed-off-by: Milo(Woogyom) Kim <milo.kim@ti.com> Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
Diffstat (limited to 'drivers/power/lp8727_charger.c')
-rw-r--r--drivers/power/lp8727_charger.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/power/lp8727_charger.c b/drivers/power/lp8727_charger.c
index 134ed5c7dde5..b5567bc99000 100644
--- a/drivers/power/lp8727_charger.c
+++ b/drivers/power/lp8727_charger.c
@@ -17,6 +17,7 @@
#include <linux/power_supply.h>
#include <linux/platform_data/lp8727.h>
+#define LP8788_NUM_INTREGS 2
#define DEFAULT_DEBOUNCE_MSEC 270
/* Registers */
@@ -136,6 +137,13 @@ static int lp8727_init_device(struct lp8727_chg *pchg)
{
u8 val;
int ret;
+ u8 intstat[LP8788_NUM_INTREGS];
+
+ /* clear interrupts */
+ ret = lp8727_read_bytes(pchg, INT1, intstat, LP8788_NUM_INTREGS);
+ if (ret)
+ return ret;
+
val = ID200_EN | ADC_EN | CP_EN;
ret = lp8727_write_byte(pchg, CTRL1, val);