power: smb5-lib: Modify max USBIN voltage seen by userspace
Non-QC2.0-compliant adaptors, as the name suggests, support only a subset of the three voltage levels (5, 9 and 12V). For example, a non-compliant adaptor might support only up to 9V and not 12V (5V is supported as a bare minimum). Thus, when a request for 12V is made, it will collapse and unexpected behaviour will ensue. Therefore for such adaptors, modify the maximum USBIN voltage provided to userspace as follows: return the voltage that is the next lesser value than the voltage that has been determined to be unsupported by the adaptor. Also, reject all requests from userspace for these unsupported voltage levels. NOTE: This is only applicable to platforms that use SW INOV. The existing MAX_PULSES based solution works only for platforms that use HW INOV. To be clear, modifying the MAX_PULSES register happens in both HW and SW INOV modes, but only produces the desired effect in SW INOV mode. These two solutions do not interfere with each other and can coexist. Change-Id: I99abea1651c5c89d5d895eb51587e30c0d5c52ea Signed-off-by:Guru Das Srinagesh <gurus@codeaurora.org> Signed-off-by:
Ashish Chavan <ashichav@codeaurora.org>
Loading
Please register or sign in to comment