mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 18:41:58 +09:00
FROMGIT: 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:99288de360("usb: dwc3: add an alternate path in vbus_draw callback") Reported-by: Sebastian Reichel <sre@kernel.org> Signed-off-by: Ray Chi <raychi@google.com> Link: https://lore.kernel.org/r/20210327182809.1814480-2-raychi@google.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> ( cherry picked from commit8a5b5c3c16https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-next) Signed-off-by: Greg Kroah-Hartman <gregkh@google.com> Change-Id: Icc81f33d00221d33bd3ac0ec775ec02cad5079a4
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
76284302b6
commit
b015d2efa1
@@ -2553,7 +2553,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;
|
||||
|
||||
Reference in New Issue
Block a user