aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/power
diff options
context:
space:
mode:
authorKim, Milo <Milo.Kim@ti.com>2012-08-31 05:24:09 -0400
committerAnton Vorontsov <anton.vorontsov@linaro.org>2012-09-20 21:00:38 -0400
commit638555d2769b7dfb8654bae513cff295ea9a3837 (patch)
treec09a15530b99484f99e21c463c53bc48a867fab6 /drivers/power
parentd71fda01610269e3aaedd451f8d3e34cdf550036 (diff)
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')
-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 @@
17#include <linux/power_supply.h> 17#include <linux/power_supply.h>
18#include <linux/platform_data/lp8727.h> 18#include <linux/platform_data/lp8727.h>
19 19
20#define LP8788_NUM_INTREGS 2
20#define DEFAULT_DEBOUNCE_MSEC 270 21#define DEFAULT_DEBOUNCE_MSEC 270
21 22
22/* Registers */ 23/* Registers */
@@ -136,6 +137,13 @@ static int lp8727_init_device(struct lp8727_chg *pchg)
136{ 137{
137 u8 val; 138 u8 val;
138 int ret; 139 int ret;
140 u8 intstat[LP8788_NUM_INTREGS];
141
142 /* clear interrupts */
143 ret = lp8727_read_bytes(pchg, INT1, intstat, LP8788_NUM_INTREGS);
144 if (ret)
145 return ret;
146
139 147
140 val = ID200_EN | ADC_EN | CP_EN; 148 val = ID200_EN | ADC_EN | CP_EN;
141 ret = lp8727_write_byte(pchg, CTRL1, val); 149 ret = lp8727_write_byte(pchg, CTRL1, val);