power: smb5: Reorder steps to change USBIN voltage for Type-C adaptors
Currently while changing USBIN voltage for QC2.0, QC3.0 and USB-PD
adaptors, the inductor ripple current sometimes rises to a magnitude
that results in damage of the SMB5 peripheral. This patch fixes this
issue by keeping inductor ripple current low and within sane limits.
Fixing this issue requires in general the re-ordering of the two main
steps involved in changing voltage - changing the DC-DC switcher's
frequency (FSW) and setting USBIN voltage as follows:
- When increasing input voltage: increase FSW first, then increase
input voltage;
- When decreasing input voltage: decrease input voltage first,
then decrease FSW.
This is implemented slightly differently in the case of each adaptor
type as duly recorded below.
For QC2.0:
- For 9V and 12V requests, first determine if the voltage change is an
increase from a lower voltage or not.
- If so, then set the FSW first.
- Set the voltage afterwards.
- There is no change required to the way 5V requests are handled because
5V being the lowest possible voltage, requests are made from a higher
voltage, so the voltage change will always be a decrease.
For QC3.0 and USB-PD both:
- While increasing the voltage, increase the FSW first and only then set
the voltage.
- There is no change required to the way voltage decrease currently occurs.
CRs-Fixed: 2296976
Change-Id: Ic6d9e79610e605ac6979e6dd29c425e1eb5aab17
Signed-off-by:
Guru Das Srinagesh <gurus@codeaurora.org>
Loading
Please register or sign in to comment