From ceaafc02e99e2b0e3189e0802f1713ba4df73d37 Mon Sep 17 00:00:00 2001 From: Pandey Raj Date: Mon, 21 May 2012 17:15:43 +0530 Subject: [PATCH] EM/Charger: Fix the VBUS disconnect after 30s issue on CLV 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 Reviewed-on: http://android.intel.com:8080/49524 Reviewed-by: Hegde Kota, VinayX Reviewed-by: Wu, Hao Reviewed-by: Tc, Jenny Reviewed-by: Prasad, Lakshmi G Reviewed-by: Meng, Zhe Tested-by: Meng, Zhe Tested-by: Kallappa Manjanna, MadhukumarX Reviewed-by: buildbot Tested-by: buildbot --- drivers/power/bq24192_charger.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/drivers/power/bq24192_charger.c b/drivers/power/bq24192_charger.c index fe2a168..f3ecd75 100644 --- a/drivers/power/bq24192_charger.c +++ b/drivers/power/bq24192_charger.c @@ -1463,6 +1463,21 @@ static int turn_otg_vbus(struct bq24192_chip *chip, bool votg_on) 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, -- 2.7.4