Commit 554eead5 authored by John Youn's avatar John Youn Committed by Felipe Balbi

usb: gadget: Update config for SuperSpeedPlus

When a function is added to a configuration with usb_add_function(), the
configuration speed flags are updated. These flags indicate for which
speeds the configuration is valid for.

This patch adds a flag in the configuration for SuperSpeedPlus and
also updates this based on the existence of ssp_descriptors.
Signed-off-by: default avatarJohn Youn <johnyoun@synopsys.com>
Signed-off-by: default avatarFelipe Balbi <balbi@kernel.org>
parent f5c61225
...@@ -237,6 +237,8 @@ int usb_add_function(struct usb_configuration *config, ...@@ -237,6 +237,8 @@ int usb_add_function(struct usb_configuration *config,
config->highspeed = true; config->highspeed = true;
if (!config->superspeed && function->ss_descriptors) if (!config->superspeed && function->ss_descriptors)
config->superspeed = true; config->superspeed = true;
if (!config->superspeed_plus && function->ssp_descriptors)
config->superspeed_plus = true;
done: done:
if (value) if (value)
......
...@@ -1229,6 +1229,7 @@ static void purge_configs_funcs(struct gadget_info *gi) ...@@ -1229,6 +1229,7 @@ static void purge_configs_funcs(struct gadget_info *gi)
} }
c->next_interface_id = 0; c->next_interface_id = 0;
memset(c->interface, 0, sizeof(c->interface)); memset(c->interface, 0, sizeof(c->interface));
c->superspeed_plus = 0;
c->superspeed = 0; c->superspeed = 0;
c->highspeed = 0; c->highspeed = 0;
c->fullspeed = 0; c->fullspeed = 0;
......
...@@ -322,6 +322,7 @@ struct usb_configuration { ...@@ -322,6 +322,7 @@ struct usb_configuration {
unsigned superspeed:1; unsigned superspeed:1;
unsigned highspeed:1; unsigned highspeed:1;
unsigned fullspeed:1; unsigned fullspeed:1;
unsigned superspeed_plus:1;
struct usb_function *interface[MAX_CONFIG_INTERFACES]; struct usb_function *interface[MAX_CONFIG_INTERFACES];
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment