From 9ea8b0ee0096724fac2597c7c36656490fe2a98a Mon Sep 17 00:00:00 2001 From: Sakethram Bommisetti Date: Tue, 28 Jun 2011 14:04:56 +0530 Subject: 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 Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/25958 Reviewed-by: Praveena NADAHALLY Reviewed-by: Philippe LANGLAIS --- drivers/usb/otg/ab8500-usb.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'drivers') 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, -- cgit v1.2.3