Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6903ccbd authored by qctecmdr Service's avatar qctecmdr Service Committed by Gerrit - the friendly Code Review server
Browse files

Merge "usb: gadget: Allow up to 900mA current draw for SuperSpeed"

parents a127acdb c17588ee
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -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
@@ -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
+2 −1
Original line number Diff line number Diff line
@@ -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);
	}
}