Loading drivers/usb/gadget/Kconfig +5 −3 Original line number Diff line number Diff line Loading @@ -96,8 +96,8 @@ config USB_GADGET_DEBUG_FS to conserve kernel memory, say "N". config USB_GADGET_VBUS_DRAW int "Maximum VBUS Power usage (2-500 mA)" range 2 500 int "Maximum VBUS Power usage (2-900 mA)" range 2 900 default 2 help Some devices need to draw power from USB when they are Loading @@ -106,7 +106,9 @@ config USB_GADGET_VBUS_DRAW such as an AC adapter or batteries. Enter the maximum power your device draws through USB, in milliAmperes. The permitted range of values is 2 - 500 mA; milliAmperes. The permitted range of values depends on the connected speed: for SuperSpeed and up it is 2 - 900 mA, but connections at High Speed or slower will be capped at 500 mA; 0 mA would be legal, but can make some hosts misbehave. This value will be used except for system-specific gadget Loading drivers/usb/gadget/composite.c +2 −1 Original line number Diff line number Diff line Loading @@ -539,7 +539,8 @@ static u8 encode_bMaxPower(enum usb_device_speed speed, case USB_SPEED_SUPER: return DIV_ROUND_UP(val, 8); default: return DIV_ROUND_UP(val, 2); /* only SuperSpeed and faster support > 500mA */ return DIV_ROUND_UP(min(val, 500U), 2); } } Loading Loading
drivers/usb/gadget/Kconfig +5 −3 Original line number Diff line number Diff line Loading @@ -96,8 +96,8 @@ config USB_GADGET_DEBUG_FS to conserve kernel memory, say "N". config USB_GADGET_VBUS_DRAW int "Maximum VBUS Power usage (2-500 mA)" range 2 500 int "Maximum VBUS Power usage (2-900 mA)" range 2 900 default 2 help Some devices need to draw power from USB when they are Loading @@ -106,7 +106,9 @@ config USB_GADGET_VBUS_DRAW such as an AC adapter or batteries. Enter the maximum power your device draws through USB, in milliAmperes. The permitted range of values is 2 - 500 mA; milliAmperes. The permitted range of values depends on the connected speed: for SuperSpeed and up it is 2 - 900 mA, but connections at High Speed or slower will be capped at 500 mA; 0 mA would be legal, but can make some hosts misbehave. This value will be used except for system-specific gadget Loading
drivers/usb/gadget/composite.c +2 −1 Original line number Diff line number Diff line Loading @@ -539,7 +539,8 @@ static u8 encode_bMaxPower(enum usb_device_speed speed, case USB_SPEED_SUPER: return DIV_ROUND_UP(val, 8); default: return DIV_ROUND_UP(val, 2); /* only SuperSpeed and faster support > 500mA */ return DIV_ROUND_UP(min(val, 500U), 2); } } Loading