summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSakethram Bommisetti <sakethram.bommisetti@stericsson.com>2011-06-28 14:04:56 +0530
committerRobert Marklund <robert.marklund@stericsson.com>2011-10-05 12:17:16 +0200
commit3143f39c1f8dacfb2b34b0ca17deb0b9d5d3252f (patch)
tree0288856123040118a4cd114c9c2d31263ad8f222
parent03fc00bf3c512bd1c28f0d8d1b1670a82a370a52 (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,