pmaports/device/unmaintained/linux-alcatel-idol347-downstream/smb1360-like-mainline-idol347.patch
Vincent Knecht e76f4df119
unmaintained/alcatel-idol347-downstream: new device (Alcatel Idol 3 4.7) (MR 2319)
Based on Minecrell work at:
https://gitlab.com/Minecrell/pmaports/-/tree/alcatel-idol347-downstream
adapted smb1360 shared patches for idol347 downstream tree,
and added his idol347-like-mainline.patch gist which changes downstream DT
to mimic sane mainline settings for easy battery driver dump comparison.
2021-07-08 22:38:45 +02:00

13 lines
547 B
Diff

diff --git a/drivers/power/idol347/smb1360-charger-fg.c b/drivers/power/idol347/smb1360-charger-fg.c
index bc8859cd9a2..5ae109b9ff2 100644
--- a/drivers/power/idol347/smb1360-charger-fg.c
+++ b/drivers/power/idol347/smb1360-charger-fg.c
@@ -3408,7 +3408,7 @@ disable_access:
if (chip->soc_min != -EINVAL) {
if (is_between(chip->soc_min, 0, 100)) {
- reg = DIV_ROUND_UP(chip->soc_min * MAX_8_BITS,
+ reg = DIV_ROUND_CLOSEST(chip->soc_min * MAX_8_BITS,
100);
pr_debug("soc_min=%d reg=%x\n",
chip->soc_min, reg);