lkml.org 
[lkml]   [2020]   [May]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH V2 2/8] usb: gadget: tegra-xudc: Add vbus_draw support
From
Date


On 28-04-2020 15:29, Thierry Reding wrote:
>> @@ -2042,6 +2044,19 @@ static int tegra_xudc_gadget_stop(struct usb_gadget *gadget)
>> return 0;
>> }
>>
>> +static int tegra_xudc_gadget_vbus_draw(struct usb_gadget *gadget,
>> + unsigned int m_a)
>> +{
>> + struct tegra_xudc *xudc = to_xudc(gadget);
>> +
>> + dev_dbg(xudc->dev, "%s: %u mA\n", __func__, m_a);
>> +
>> + if (xudc->curr_usbphy->chg_type == SDP_TYPE)
>> + usb_phy_set_power(xudc->curr_usbphy, m_a);
> Do we need to propagate the error code here in case the USB PHY for some
> reason doesn't support the given current? Or is it guaranteed that we
> always do support whatever is passed in here?
>
> Regardless of whether we support it or not, it might still be useful to
> add proper handling, if for nothing else but to set a good example.
>
> Thierry
Will update accordingly, propagate the return the code to caller.

\
 
 \ /
  Last update: 2020-05-04 06:09    [W:0.178 / U:0.472 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site