power: qcom-charger: Add support for software INOV
Hardware autonomous INOV does adapter's output voltage
manipulation only based on the input limited state of main
charger. This works well with MID-MID parallel configuration
but with USBIN-USBIN parallel configuration parallel charger's
input limited state also plays role for INOV manipulations.
Thus disable hardware based autonomous INOV and add support
for software based INOV for USBIN-USBIN configuration.
Note that if authentication is disabled, the hw assumes QC3.0 and
if the autonomous bit is enabled, it issues increment/decrement pulses.
This happens even when QC3.0 has not been actually authenticated.
Change-Id: I397acb558c9ba3b6fc7d7b974d64459f278697fd
Signed-off-by: Ashay Jaiswal <ashayj@codeaurora.org>
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
diff --git a/drivers/power/supply/qcom/smb-reg.h b/drivers/power/supply/qcom/smb-reg.h
index e005a27..54b6b38 100644
--- a/drivers/power/supply/qcom/smb-reg.h
+++ b/drivers/power/supply/qcom/smb-reg.h
@@ -535,6 +535,8 @@
#define USBIN_LT_3P6V_RT_STS_BIT BIT(1)
#define USBIN_COLLAPSE_RT_STS_BIT BIT(0)
+#define QC_PULSE_COUNT_STATUS_1_REG (USBIN_BASE + 0x30)
+
#define USBIN_CMD_IL_REG (USBIN_BASE + 0x40)
#define BAT_2_SYS_FET_DIS_BIT BIT(1)
#define USBIN_SUSPEND_BIT BIT(0)
@@ -544,6 +546,7 @@
#define APSD_RERUN_BIT BIT(0)
#define CMD_HVDCP_2_REG (USBIN_BASE + 0x43)
+#define RESTART_AICL_BIT BIT(7)
#define TRIGGER_AICL_BIT BIT(6)
#define FORCE_12V_BIT BIT(5)
#define FORCE_9V_BIT BIT(4)