Commit fa7cc725 authored by David Heidelberg's avatar David Heidelberg Committed by Sebastian Reichel

power: supply: smb347-charger: Add delay before getting IRQSTAT

This delay-fix is picked up from downstream driver,
we measured that 25 - 35 ms delay ensure that we get required data.

Tested on SMB347 on Nexus 7 2012. Otherwise IRQSTAT_E fails to provide
correct information.
Signed-off-by: default avatarDmitry Osipenko <digetx@gmail.com>
Signed-off-by: default avatarDavid Heidelberg <david@ixit.cz>
Signed-off-by: default avatarSebastian Reichel <sebastian.reichel@collabora.com>
parent c32ea07a
......@@ -8,6 +8,7 @@
* Mika Westerberg <mika.westerberg@linux.intel.com>
*/
#include <linux/delay.h>
#include <linux/err.h>
#include <linux/gpio.h>
#include <linux/kernel.h>
......@@ -708,6 +709,9 @@ static irqreturn_t smb347_interrupt(int irq, void *data)
bool handled = false;
int ret;
/* SMB347 it needs at least 20ms for setting IRQSTAT_E_*IN_UV_IRQ */
usleep_range(25000, 35000);
ret = regmap_read(smb->regmap, STAT_C, &stat_c);
if (ret < 0) {
dev_warn(smb->dev, "reading STAT_C failed\n");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment