提交 21aae9d0 编写于 作者: Y Yauhen Kharuzhy 提交者: Zheng Zengkai

power: bq25890: Enable continuous conversion for ADC at charging

stable inclusion
from stable-v5.10.91
commit 5a7d650bb181c658719dcabb25702d502530092f
bugzilla: 186187 https://gitee.com/openeuler/kernel/issues/I4SI2C

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=5a7d650bb181c658719dcabb25702d502530092f

--------------------------------

commit 80211be1 upstream.

Instead of one shot run of ADC at beginning of charging, run continuous
conversion to ensure that all charging-related values are monitored
properly (input voltage, input current, themperature etc.).
Signed-off-by: NYauhen Kharuzhy <jekhor@gmail.com>
Reviewed-by: NHans de Goede <hdegoede@redhat.com>
Signed-off-by: NSebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: NChen Jun <chenjun102@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 bc85ada4
...@@ -581,12 +581,12 @@ static irqreturn_t __bq25890_handle_irq(struct bq25890_device *bq) ...@@ -581,12 +581,12 @@ static irqreturn_t __bq25890_handle_irq(struct bq25890_device *bq)
if (!new_state.online && bq->state.online) { /* power removed */ if (!new_state.online && bq->state.online) { /* power removed */
/* disable ADC */ /* disable ADC */
ret = bq25890_field_write(bq, F_CONV_START, 0); ret = bq25890_field_write(bq, F_CONV_RATE, 0);
if (ret < 0) if (ret < 0)
goto error; goto error;
} else if (new_state.online && !bq->state.online) { /* power inserted */ } else if (new_state.online && !bq->state.online) { /* power inserted */
/* enable ADC, to have control of charge current/voltage */ /* enable ADC, to have control of charge current/voltage */
ret = bq25890_field_write(bq, F_CONV_START, 1); ret = bq25890_field_write(bq, F_CONV_RATE, 1);
if (ret < 0) if (ret < 0)
goto error; goto error;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册