power: pm8921-charger: replace BTM with ADC algorithm
The battery temperature module has a bug where when it is disabled
during suspend and re-enabled during resume it locks up and cannot
accept anymore conversion requests.
When the BTM's End of Conversion (EOC) is complete the Request bit (REQ)
bit needs to go low. The bug prevents the REQ bit going low during a
scenario when the EOC bit is set and any of the banks on the
(USRP, SECP or MDM) is enabled. When the next conversion request is
issued and if the REQ bit still remains high it renders the request
ineffective. The REQ bit goes low only when all the banks in the arbiter
is disabled. This cannot be guaranteed on the device and hence BTM
cannot be used.
Fix this by implementing a Jeita compliant check routine which
reads the battery temperature readings via the ADC and checks
the corresponding thersholds.
This is only done while charging is active. When the battery
temperature changes drastically while not charging the
BATT_TEMP_HOT/COLD interrupts.
Change-Id: Icef2b7fa70f274f671bd1b9469eb6a333ab462f9
Signed-off-by:
Abhijeet Dharmapurikar <adharmap@codeaurora.org>
Loading
Please register or sign in to comment