diff options
Diffstat (limited to 'drivers/usb/otg/ab8500-usb.c')
-rw-r--r-- | drivers/usb/otg/ab8500-usb.c | 17 |
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, |