BZ: 34940
This patch fixes the VBUS disconnect issue on CLV platform by disabling the
WD timer as soon as host mode cable is inserted to the platform. This issue
happens only if the user connects the host mode cable before the charger cable.
Change-Id: I26c97af48bf366a2132f80e6cebc8acb92c9a480
Signed-off-by: Pandey Raj <raj.pandey@intel.com>
Reviewed-on: http://android.intel.com:8080/49524
Reviewed-by: Hegde Kota, VinayX <vinayx.hegde.kota@intel.com>
Reviewed-by: Wu, Hao <hao.wu@intel.com>
Reviewed-by: Tc, Jenny <jenny.tc@intel.com>
Reviewed-by: Prasad, Lakshmi G <lakshmi.g.prasad@intel.com>
Reviewed-by: Meng, Zhe <zhe.meng@intel.com>
Tested-by: Meng, Zhe <zhe.meng@intel.com>
Tested-by: Kallappa Manjanna, MadhukumarX <madhukumarx.kallappa.manjanna@intel.com>
Reviewed-by: buildbot <buildbot@intel.com>
Tested-by: buildbot <buildbot@intel.com>
int ret = 0;
if (votg_on) {
+ /*
+ * Disable WD timer to make sure the WD timer doesn't
+ * expire and put the charger chip into default state
+ * which will bring down the VBUS. The issue will arise
+ * only when the host mode cable is plugged in before
+ * USB charging cable (SDP/DCP/CDP/ACA).
+ */
+ ret = program_wdt_timer(chip,
+ CHRG_TIMER_EXP_CNTL_WDTDISABLE);
+ if (ret < 0) {
+ dev_warn(&chip->client->dev,
+ "I2C write failed:%s\n", __func__);
+ goto i2c_write_fail;
+ }
+
/* Configure the charger in OTG mode */
ret = bq24192_reg_read_modify(chip->client,
BQ24192_POWER_ON_CFG_REG,