Skip to content

Commit

Permalink
usb: gadget: Update config for SuperSpeedPlus
Browse files Browse the repository at this point in the history
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: 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 f5c6122 commit 554eead
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/usb/gadget/composite.c
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,8 @@ int usb_add_function(struct usb_configuration *config,
config->highspeed = true;
if (!config->superspeed && function->ss_descriptors)
config->superspeed = true;
if (!config->superspeed_plus && function->ssp_descriptors)
config->superspeed_plus = true;

done:
if (value)
Expand Down
1 change: 1 addition & 0 deletions drivers/usb/gadget/configfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -1229,6 +1229,7 @@ static void purge_configs_funcs(struct gadget_info *gi)
}
c->next_interface_id = 0;
memset(c->interface, 0, sizeof(c->interface));
c->superspeed_plus = 0;
c->superspeed = 0;
c->highspeed = 0;
c->fullspeed = 0;
Expand Down
1 change: 1 addition & 0 deletions include/linux/usb/composite.h
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,7 @@ struct usb_configuration {
unsigned superspeed:1;
unsigned highspeed:1;
unsigned fullspeed:1;
unsigned superspeed_plus:1;
struct usb_function *interface[MAX_CONFIG_INTERFACES];
};

Expand Down

0 comments on commit 554eead

Please sign in to comment.