Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 93fa73a8 authored by David Keitel's avatar David Keitel Committed by Stephen Boyd
Browse files

power: pm8921-charger: add USB soft trim procedure



To improve accuracy of USB input current limits add
a soft trim procedure. This procedure subtracts codes
from the original trim value in the USB_OVP_TRIM
register based on the selected USB input current limit.

Note that the USB_OVP_TRIM is not reset if there is
a watchdog restart. In such cases we don't want to
overwrite a already corrected trim value. The trick
is to update the boot loader to save the original trim
value in register 0x10A and 0x09C and the kernel driver
to use that as the starting point instead of the
USB_OVP_TRIM.

Also note that we choose the value of 0xFF to indicate that
the driver has not yet read the trim value. The trim value
is only 6 bits and so 0xFF serves as an uninitialized value.

CRs-Fixed: 389937
CRs-Fixed: 418033
Change-Id: I445676d558e05a6c5e9dd1e76e80ba2f5e8cd6c1
Signed-off-by: default avatarDavid Keitel <dkeitel@codeaurora.org>
parent 701afb53
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment