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

Commit b7e4e00f authored by Scott Anderson's avatar Scott Anderson Committed by Stephen Boyd
Browse files

usb: gadget: android: Honor CONFIG_USB_GADGET_VBUS_DRAW



The maximum current draw was hard coded to 500 mA.  composite.c
has code that uses CONFIG_USB_GADGET_VBUS_DRAW to set the
bMaxPower and to set whether or not the device is self-powered if
they haven't been set.  This change removes the code in android.c
to allow composite.c to set them.

Change-Id: I9db37922e91ee86e9e5c0e14519e119e5c41ca48
Signed-off-by: default avatarScott Anderson <saa@google.com>
parent 6e342fc7
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -152,8 +152,6 @@ static struct usb_configuration android_config_driver = {
	.label		= "android",
	.unbind		= android_unbind_config,
	.bConfigurationValue = 1,
	.bmAttributes	= USB_CONFIG_ATT_ONE | USB_CONFIG_ATT_SELFPOWER,
	.MaxPower	= 500, /* 500ma */
};

enum android_device_state {
@@ -1490,7 +1488,6 @@ static int android_bind(struct usb_composite_dev *cdev)
	strings_dev[STRING_SERIAL_IDX].id = id;
	device_desc.iSerialNumber = id;

	usb_gadget_set_selfpowered(gadget);
	dev->cdev = cdev;

	return 0;