From 103c20e43e8d65e20cca651c61d2db24a5983c45 Mon Sep 17 00:00:00 2001 From: Vic Yang Date: Tue, 28 May 2013 13:41:49 +0800 Subject: Extend TSU6721 BCD timer to 3.6 seconds If the user plug in the charger really slowly, VBUS and GND will make contact before ID pin. Currently timer is set to fire in 0.6 seconds, which means ID pin need to make contact within 0.6 seconds after VBUS make contact. This is causing chargers to be recognized as non-standard charger. Let's extend this to 3.6 seconds. BUG=chrome-os-partner:19765 TEST=Plug in a charger half-way through and see device type 0x20000. Wait for 3.6 seconds, and see it changes to 0x60000. TEST=Plug in a charger half-way through, wait for 2 seconds, and then plug it in all the way. See device type 0x20010. TEST=Plug in a charger to the end. See device type 0x20010 immediately. BRANCH=spring Original-Change-Id: I46c408e7bc733fe4f3655db253f4065a4f12ee1a Signed-off-by: Vic Yang Reviewed-on: https://gerrit.chromium.org/gerrit/56772 Reviewed-by: Vincent Palatin (cherry picked from commit 6759fdc3e6dd7e8901fcf8e25490e4e20273cbcb) Change-Id: I6b72e4a9c6e0ef000aad3e833b47c53fac0005ec Signed-off-by: Vic Yang Reviewed-on: https://gerrit.chromium.org/gerrit/56911 Reviewed-by: Vincent Palatin --- common/tsu6721.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/tsu6721.c b/common/tsu6721.c index 2f6e1f0a36..41a2b9ce11 100644 --- a/common/tsu6721.c +++ b/common/tsu6721.c @@ -136,7 +136,7 @@ void tsu6721_init(void) /* set USB charger detection timeout to 600ms */ settings = tsu6721_read(TSU6721_REG_TIMER); - settings = (settings & ~0x38); + settings = (settings & ~0x38) | 0x28; tsu6721_write(TSU6721_REG_TIMER, settings); tsu6721_set_interrupt_mask(TSU6721_INT_ATTACH | -- cgit v1.2.1