summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSakethram Bommisetti <sakethram.bommisetti@stericsson.com>2011-06-28 14:04:56 +0530
committerPhilippe Langlais <philippe.langlais@stericsson.com>2012-05-22 11:03:05 +0200
commita1caf5d2763762637f79559bd83b9f9511bec990 (patch)
tree88f136834cb4860f72caf47a20652faba8e2a0ff
parent0512675b3f3eb1925f0d28b53b313b3c876aa578 (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 afa93a4bd59..cf537da1aa2 100644
--- a/drivers/usb/otg/ab8500-usb.c
+++ b/drivers/usb/otg/ab8500-usb.c
@@ -357,6 +357,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 usb_phy *phy, unsigned mA)
{
struct ab8500_usb *ab;
@@ -366,6 +381,8 @@ static int ab8500_usb_set_power(struct usb_phy *phy, unsigned mA)
ab = phy_to_ab(phy);
+ mA = ab8500_eyediagram_workaroud(ab, mA);
+
ab->vbus_draw = mA;
atomic_notifier_call_chain(&ab->phy.notifier,