aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/phy
diff options
context:
space:
mode:
authorSakethram Bommisetti <sakethram.bommisetti@stericsson.com>2013-04-03 04:45:05 -0400
committerFelipe Balbi <balbi@ti.com>2013-04-03 05:00:25 -0400
commitc2a0ab6bd5ccf031f87bc678152fb70befea5786 (patch)
tree0a7e8b976f2dd3b96c8286884f8bb5f59fadc4fc /drivers/usb/phy
parent7124631aa892712fc8b317ff34d25c14dee6f63d (diff)
usb: phy: ab8500-usb: fix eye diagram for ab8500 v2.0
AB8500 v2.0 has eye diagram issues when drawing more than 100mA from VBUS. Force charging current to 100mA in case of standard host. Signed-off-by: Sakethram Bommisetti <sakethram.bommisetti@stericsson.com> Acked-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Fabio Baltieri <fabio.baltieri@linaro.org> Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/phy')
-rw-r--r--drivers/usb/phy/phy-ab8500-usb.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/usb/phy/phy-ab8500-usb.c b/drivers/usb/phy/phy-ab8500-usb.c
index 5b92a59804eb..441b2954cffd 100644
--- a/drivers/usb/phy/phy-ab8500-usb.c
+++ b/drivers/usb/phy/phy-ab8500-usb.c
@@ -485,6 +485,19 @@ static void ab8500_usb_phy_disable_work(struct work_struct *work)
485 ab8500_usb_peri_phy_dis(ab); 485 ab8500_usb_peri_phy_dis(ab);
486} 486}
487 487
488static unsigned ab8500_eyediagram_workaroud(struct ab8500_usb *ab, unsigned mA)
489{
490 /*
491 * AB8500 V2 has eye diagram issues when drawing more than 100mA from
492 * VBUS. Set charging current to 100mA in case of standard host
493 */
494 if (is_ab8500_2p0_or_earlier(ab->ab8500))
495 if (mA > 100)
496 mA = 100;
497
498 return mA;
499}
500
488static int ab8500_usb_set_power(struct usb_phy *phy, unsigned mA) 501static int ab8500_usb_set_power(struct usb_phy *phy, unsigned mA)
489{ 502{
490 struct ab8500_usb *ab; 503 struct ab8500_usb *ab;
@@ -494,6 +507,8 @@ static int ab8500_usb_set_power(struct usb_phy *phy, unsigned mA)
494 507
495 ab = phy_to_ab(phy); 508 ab = phy_to_ab(phy);
496 509
510 mA = ab8500_eyediagram_workaroud(ab, mA);
511
497 ab->vbus_draw = mA; 512 ab->vbus_draw = mA;
498 513
499 if (mA) 514 if (mA)