mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-23 12:43:55 +08:00
usb: gadget: composite: Count configs for SuperSpeedPlus
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>
This commit is contained in:
parent
554eead543
commit
a4afd012f4
@ -511,18 +511,24 @@ static int count_configs(struct usb_composite_dev *cdev, unsigned type)
|
|||||||
unsigned count = 0;
|
unsigned count = 0;
|
||||||
int hs = 0;
|
int hs = 0;
|
||||||
int ss = 0;
|
int ss = 0;
|
||||||
|
int ssp = 0;
|
||||||
|
|
||||||
if (gadget_is_dualspeed(gadget)) {
|
if (gadget_is_dualspeed(gadget)) {
|
||||||
if (gadget->speed == USB_SPEED_HIGH)
|
if (gadget->speed == USB_SPEED_HIGH)
|
||||||
hs = 1;
|
hs = 1;
|
||||||
if (gadget->speed == USB_SPEED_SUPER)
|
if (gadget->speed == USB_SPEED_SUPER)
|
||||||
ss = 1;
|
ss = 1;
|
||||||
|
if (gadget->speed == USB_SPEED_SUPER_PLUS)
|
||||||
|
ssp = 1;
|
||||||
if (type == USB_DT_DEVICE_QUALIFIER)
|
if (type == USB_DT_DEVICE_QUALIFIER)
|
||||||
hs = !hs;
|
hs = !hs;
|
||||||
}
|
}
|
||||||
list_for_each_entry(c, &cdev->configs, list) {
|
list_for_each_entry(c, &cdev->configs, list) {
|
||||||
/* ignore configs that won't work at this speed */
|
/* ignore configs that won't work at this speed */
|
||||||
if (ss) {
|
if (ssp) {
|
||||||
|
if (!c->superspeed_plus)
|
||||||
|
continue;
|
||||||
|
} else if (ss) {
|
||||||
if (!c->superspeed)
|
if (!c->superspeed)
|
||||||
continue;
|
continue;
|
||||||
} else if (hs) {
|
} else if (hs) {
|
||||||
|
Loading…
Reference in New Issue
Block a user