power: qpnp-charger: change USB debounce time to 20ms
To avoid spurious USBIN_VALID interrupts increase the
debounce time on the USB peripheral to 20ms.
CRs-Fixed: 433617
Change-Id: I312c8643709bc4dec3e5924b6108e934cb528680
Signed-off-by: David Keitel <dkeitel@codeaurora.org>
diff --git a/drivers/power/qpnp-charger.c b/drivers/power/qpnp-charger.c
index 510071a..7b53038 100644
--- a/drivers/power/qpnp-charger.c
+++ b/drivers/power/qpnp-charger.c
@@ -81,6 +81,7 @@
#define CHGR_MISC_BOOT_DONE 0x42
#define CHGR_BUCK_COMPARATOR_OVRIDE_3 0xED
#define MISC_REVISION2 0x01
+#define USB_OVP_CTL 0x42
#define SEC_ACCESS 0xD0
/* SMBB peripheral subtype values */
@@ -99,6 +100,7 @@
#define CHGR_BOOT_DONE BIT(7)
#define CHGR_CHG_EN BIT(7)
#define CHGR_ON_BAT_FORCE_BIT BIT(0)
+#define USB_VALID_DEB_20MS 0x03
/* Interrupt definitions */
/* smbb_chg_interrupts */
@@ -1189,6 +1191,11 @@
}
rc = qpnp_chg_masked_write(chip,
+ chip->usb_chgpth_base + USB_OVP_CTL,
+ USB_VALID_DEB_20MS,
+ USB_VALID_DEB_20MS, 1);
+
+ rc = qpnp_chg_masked_write(chip,
chip->usb_chgpth_base + CHGR_USB_ENUM_T_STOP,
ENUM_T_STOP_BIT,
ENUM_T_STOP_BIT, 1);