summaryrefslogtreecommitdiff
path: root/drivers/power
diff options
context:
space:
mode:
authorDavid Heidelberg <david@ixit.cz>2020-03-29 18:15:45 +0200
committerSebastian Reichel <sebastian.reichel@collabora.com>2020-05-10 18:23:50 +0200
commitfa7cc725a343e305bef78e8d65be48f37d3f7720 (patch)
treedabc90406524e243a294f357c6cbedbec80fae00 /drivers/power
parentc32ea07a30630ace950e07ffe7a18bdcc25898e1 (diff)
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: Dmitry Osipenko <digetx@gmail.com> Signed-off-by: David Heidelberg <david@ixit.cz> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Diffstat (limited to 'drivers/power')
-rw-r--r--drivers/power/supply/smb347-charger.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/power/supply/smb347-charger.c b/drivers/power/supply/smb347-charger.c
index d102921b3ab2..f99026d81f2a 100644
--- a/drivers/power/supply/smb347-charger.c
+++ b/drivers/power/supply/smb347-charger.c
@@ -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");