提交 638555d2 编写于 作者: K Kim, Milo 提交者: Anton Vorontsov

lp8727_charger: Clear interrrupts at inital time

To initialize the device, previous interrupts need to be cleared while
loading the driver.
Signed-off-by: NMilo(Woogyom) Kim <milo.kim@ti.com>
Signed-off-by: NAnton Vorontsov <anton.vorontsov@linaro.org>
上级 d71fda01
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册