usb: gadget: android: Honor CONFIG_USB_GADGET_VBUS_DRAW
authorScott Anderson <saa@google.com>
Wed, 18 Jan 2012 23:56:51 +0000 (15:56 -0800)
committerBenoit Goby <benoit@android.com>
Thu, 26 Jan 2012 01:13:15 +0000 (17:13 -0800)
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: Scott Anderson <saa@google.com>
drivers/usb/gadget/android.c

index 54f80e79de6f657ab9651712c471b2fe478f0e83..8df739c1a84d887c28d5d42c23c08d1898e4361c 100644 (file)
@@ -153,8 +153,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,
-       .bMaxPower      = 0xFA, /* 500ma */
 };
 
 static void android_work(struct work_struct *data)
@@ -1033,7 +1031,6 @@ static int android_bind(struct usb_composite_dev *cdev)
                device_desc.bcdDevice = __constant_cpu_to_le16(0x9999);
        }
 
-       usb_gadget_set_selfpowered(gadget);
        dev->cdev = cdev;
 
        return 0;