提交 3b4df57b 编写于 作者: M Michał Mirosław 提交者: Sebastian Reichel

power: bq25890: update state on property read

Edge interrupts from the charger may be lost or stuck in fault mode
since probe(). Check if something changed everytime userspace wants
some data.
Signed-off-by: NMichał Mirosław <mirq-linux@rere.qmqm.pl>
Signed-off-by: NSebastian Reichel <sebastian.reichel@collabora.com>
上级 21d90eda
......@@ -387,6 +387,8 @@ static bool bq25890_is_adc_property(enum power_supply_property psp)
}
}
static irqreturn_t __bq25890_handle_irq(struct bq25890_device *bq);
static int bq25890_power_supply_get_property(struct power_supply *psy,
enum power_supply_property psp,
union power_supply_propval *val)
......@@ -397,6 +399,8 @@ static int bq25890_power_supply_get_property(struct power_supply *psy,
int ret;
mutex_lock(&bq->lock);
/* update state in case we lost an interrupt */
__bq25890_handle_irq(bq);
state = bq->state;
do_adc_conv = !state.online && bq25890_is_adc_property(psp);
if (do_adc_conv)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册