pmaports/device/.shared-patches/linux/qcom/msm8916/smb1360-like-mainline.patch
Minecrell aa1eefc44a
unmaintained/bq-paella-downstream: cleanup, add various debug patches (MR 2081)
These are various debugging related patches that I have used over the time
when attempting to get new features working for the mainline kernel.
Given that the downstream kernel is just intended for debugging in this case,
it seems convenient to add them to pmaports so I don't need to go search for
them in case I need them again in the future.

[ci:skip-build] Already built on CI
2021-03-31 23:49:26 +03:00

16 lines
675 B
Diff

The smb1360 mainline driver does some rounding slightly differently.
Change the downstream driver accordingly, so register dumps can be compared more easily.
diff --git a/drivers/power/smb1360-charger-fg.c b/drivers/power/smb1360-charger-fg.c
index 7931b6df9be..90da1ad93b3 100644
--- a/drivers/power/smb1360-charger-fg.c
+++ b/drivers/power/smb1360-charger-fg.c
@@ -3653,7 +3653,7 @@ disable_fg_reset:
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);