Skip to content

Commit

Permalink
usb: gadget: composite: Count configs for SuperSpeedPlus
Browse files Browse the repository at this point in the history
If enumerated in SuperSpeedPlus, count the configurations that support
it.

Signed-off-by: John Youn <johnyoun@synopsys.com>
Signed-off-by: Felipe Balbi <balbi@kernel.org>
  • Loading branch information
John Youn authored and Felipe Balbi committed Mar 4, 2016
1 parent 554eead commit a4afd01
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion drivers/usb/gadget/composite.c
Original file line number Diff line number Diff line change
Expand Up @@ -511,18 +511,24 @@ static int count_configs(struct usb_composite_dev *cdev, unsigned type)
unsigned count = 0;
int hs = 0;
int ss = 0;
int ssp = 0;

if (gadget_is_dualspeed(gadget)) {
if (gadget->speed == USB_SPEED_HIGH)
hs = 1;
if (gadget->speed == USB_SPEED_SUPER)
ss = 1;
if (gadget->speed == USB_SPEED_SUPER_PLUS)
ssp = 1;
if (type == USB_DT_DEVICE_QUALIFIER)
hs = !hs;
}
list_for_each_entry(c, &cdev->configs, list) {
/* ignore configs that won't work at this speed */
if (ss) {
if (ssp) {
if (!c->superspeed_plus)
continue;
} else if (ss) {
if (!c->superspeed)
continue;
} else if (hs) {
Expand Down

0 comments on commit a4afd01

Please sign in to comment.