linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 07/22] lp8727_charger: clear interrrupts at inital time
@ 2012-08-31  9:24 Kim, Milo
  0 siblings, 0 replies; only message in thread
From: Kim, Milo @ 2012-08-31  9:24 UTC (permalink / raw)
  To: Anton Vorontsov; +Cc: David Woodhouse, linux-kernel

 To initialize the device, previous interrupts need to be cleared
 while loading the driver.

Signed-off-by: Milo(Woogyom) Kim <milo.kim@ti.com>
---
 drivers/power/lp8727_charger.c |    8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/power/lp8727_charger.c b/drivers/power/lp8727_charger.c
index 134ed5c..b5567bc 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);
-- 
1.7.9.5


Best Regards,
Milo



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2012-08-31  9:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-31  9:24 [PATCH 07/22] lp8727_charger: clear interrrupts at inital time Kim, Milo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).