summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSakethram Bommisetti <sakethram.bommisetti@stericsson.com>2011-06-28 14:04:56 +0530
committerPhilippe Langlais <philippe.langlais@linaro.org>2011-07-22 15:51:19 +0200
commiteee0f27225a23c8b1c9f74ed2f4605a2986fdbb6 (patch)
tree2776ccf38fca55578634b6d7532dc17328ad9262
parentaf90184784e601433a30a0a684130bb7328bb392 (diff)
USB:Software fix for usb eye diagram issue when drawing more than 100mA
AB V2 has eye diagram issues when drawing more than 100mA from VBUS.So setting charging current to 100mA in case of standard host Change-Id: Iaa5eb5751a4b0665fbe6f6148b712ffa9f96a06b Signed-off-by: Sakethram Bommisetti <sakethram.bommisetti@stericsson.com> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/25958 Reviewed-by: Praveena NADAHALLY <praveen.nadahally@stericsson.com> Reviewed-by: Philippe LANGLAIS <philippe.langlais@stericsson.com>
-rw-r--r--drivers/usb/otg/ab8500-usb.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/usb/otg/ab8500-usb.c b/drivers/usb/otg/ab8500-usb.c
index 25de231a012..fd5943b7d38 100644
--- a/drivers/usb/otg/ab8500-usb.c
+++ b/drivers/usb/otg/ab8500-usb.c
@@ -356,6 +356,21 @@ static void ab8500_usb_phy_disable_work(struct work_struct *work)
ab8500_usb_peri_phy_dis(ab);
}
+static unsigned ab8500_eyediagram_workaroud(struct ab8500_usb *ab, unsigned mA)
+{
+ if (mA > 100) {
+ /* AB V2 has eye diagram issues when drawing more
+ * than 100mA from VBUS.So setting charging current
+ * to 100mA in case of standard host
+ */
+ if (ab->rev < 0x30)
+ mA = 100;
+ else
+ mA = 300;
+ }
+ return mA;
+}
+
static int ab8500_usb_set_power(struct otg_transceiver *otg, unsigned mA)
{
struct ab8500_usb *ab;
@@ -365,6 +380,8 @@ static int ab8500_usb_set_power(struct otg_transceiver *otg, unsigned mA)
ab = xceiv_to_ab(otg);
+ mA = ab8500_eyediagram_workaroud(ab, mA);
+
ab->vbus_draw = mA;
atomic_notifier_call_chain(&ab->otg.notifier,