diff options
author | Ray Chi <[email protected]> | 2021-03-28 02:28:08 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <[email protected]> | 2021-03-28 13:35:54 +0200 |
commit | 8a5b5c3c1634f9d7a96ea3b38f3d75333c887bf6 (patch) | |
tree | 76407b883e3c8c3a0d261bce7bc3007bd1bd5615 | |
parent | 24327c478b2fc17a01b21a4721f35f22a51fe12b (diff) |
usb: dwc3: gadget: modify the scale in vbus_draw callback
Currently, vbus_draw callback used wrong scale for power_supply.
The unit of power supply should be uA.
Therefore, this patch will fix this problem.
Fixes: 99288de36020 ("usb: dwc3: add an alternate path in vbus_draw callback")
Reported-by: Sebastian Reichel <[email protected]>
Signed-off-by: Ray Chi <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
-rw-r--r-- | drivers/usb/dwc3/gadget.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index e1442fc763e1..8a361f07e045 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c @@ -2536,7 +2536,7 @@ static int dwc3_gadget_vbus_draw(struct usb_gadget *g, unsigned int mA) if (!dwc->usb_psy) return -EOPNOTSUPP; - val.intval = mA; + val.intval = 1000 * mA; ret = power_supply_set_property(dwc->usb_psy, POWER_SUPPLY_PROP_INPUT_CURRENT_LIMIT, &val); return ret; |