power: smb1360: Add logic to update the battery profile
SMB1360 supports two battery profiles which are autonomously
selected based on the RID (batt-ID) connected on the BMD pin.
Due to a design constraint on the PM8916 + SMB1360 platform,
the battery-ID is not connected to SMB1360's BMD pin but to
the PM8916 BID pin. This prevents SMB from autonomously
selecting the battery profile.
Implement a logic to force selecting a battery profile by reading
the RID from PMIC (VADC channel) and then using the value to compare
it with the pre-defined profile-RID pairs of the supported SMB1360's
battery profiles. If the current battery-profile does not match the
RID, switch the battery-profile. For the above logic to work
add new DT properties to specify the battery-ID reference voltage
(vref), resistor-pullup on the battery-ID line (rpull-up) and the
battery profile-RID pairs for the pre-loaded SMB1360 profiles.
While at it, fix the battery-ID detection interrupt decode logic.
qcom,batt-profile-select - Enables the battery switch logic
qcom,smb1360-vadc - ADC handle to read the BID
qcom,batt-id-vref-uv - BID Vref volatge
qcom,batt-id-rpullup-kohm - Rpull-up on the BID line
qcom,profile-a-rid-kohm - Profile-A RID
qcom,profile-b-rid-kohm - Profile-B RID
Change-Id: I68f1967fca8620696900fb362919d5f87284b32a
Signed-off-by:
Anirudh Ghayal <aghayal@codeaurora.org>
Loading
Please register or sign in to comment