diff options
| author | John Youn <John.Youn@synopsys.com> | 2016-02-05 20:06:21 -0500 |
|---|---|---|
| committer | Felipe Balbi <balbi@kernel.org> | 2016-03-04 08:14:23 -0500 |
| commit | f5c61225cf29c4f97e544ad7bd088256303acf97 (patch) | |
| tree | c5a20af1ed93c04bbc11fb831155784148a1cd53 | |
| parent | eaef50c760576bca70b87fdc26eb87a3660529f8 (diff) | |
usb: gadget: Update function for SuperSpeedPlus
Add a ssp_descriptors member to struct usb_function and handle the
initialization and cleanup of it. This holds the SuperSpeedPlus
descriptors for a function that supports SuperSpeedPlus. This is added
by usb_assign_descriptors().
Signed-off-by: John Youn <johnyoun@synopsys.com>
Signed-off-by: Felipe Balbi <balbi@kernel.org>
| -rw-r--r-- | drivers/usb/gadget/config.c | 6 | ||||
| -rw-r--r-- | include/linux/usb/composite.h | 5 |
2 files changed, 11 insertions, 0 deletions
diff --git a/drivers/usb/gadget/config.c b/drivers/usb/gadget/config.c index 62ba4c1b69ec..e6c0542a063b 100644 --- a/drivers/usb/gadget/config.c +++ b/drivers/usb/gadget/config.c | |||
| @@ -183,6 +183,11 @@ int usb_assign_descriptors(struct usb_function *f, | |||
| 183 | if (!f->ss_descriptors) | 183 | if (!f->ss_descriptors) |
| 184 | goto err; | 184 | goto err; |
| 185 | } | 185 | } |
| 186 | if (ssp && gadget_is_superspeed_plus(g)) { | ||
| 187 | f->ssp_descriptors = usb_copy_descriptors(ssp); | ||
| 188 | if (!f->ssp_descriptors) | ||
| 189 | goto err; | ||
| 190 | } | ||
| 186 | return 0; | 191 | return 0; |
| 187 | err: | 192 | err: |
| 188 | usb_free_all_descriptors(f); | 193 | usb_free_all_descriptors(f); |
| @@ -195,6 +200,7 @@ void usb_free_all_descriptors(struct usb_function *f) | |||
| 195 | usb_free_descriptors(f->fs_descriptors); | 200 | usb_free_descriptors(f->fs_descriptors); |
| 196 | usb_free_descriptors(f->hs_descriptors); | 201 | usb_free_descriptors(f->hs_descriptors); |
| 197 | usb_free_descriptors(f->ss_descriptors); | 202 | usb_free_descriptors(f->ss_descriptors); |
| 203 | usb_free_descriptors(f->ssp_descriptors); | ||
| 198 | } | 204 | } |
| 199 | EXPORT_SYMBOL_GPL(usb_free_all_descriptors); | 205 | EXPORT_SYMBOL_GPL(usb_free_all_descriptors); |
| 200 | 206 | ||
diff --git a/include/linux/usb/composite.h b/include/linux/usb/composite.h index 1074b8921a5d..9ff1e465d307 100644 --- a/include/linux/usb/composite.h +++ b/include/linux/usb/composite.h | |||
| @@ -126,6 +126,10 @@ struct usb_os_desc_table { | |||
| 126 | * string identifiers assigned during @bind(). If this | 126 | * string identifiers assigned during @bind(). If this |
| 127 | * pointer is null after initiation, the function will not | 127 | * pointer is null after initiation, the function will not |
| 128 | * be available at super speed. | 128 | * be available at super speed. |
| 129 | * @ssp_descriptors: Table of super speed plus descriptors, using | ||
| 130 | * interface and string identifiers assigned during @bind(). If | ||
| 131 | * this pointer is null after initiation, the function will not | ||
| 132 | * be available at super speed plus. | ||
| 129 | * @config: assigned when @usb_add_function() is called; this is the | 133 | * @config: assigned when @usb_add_function() is called; this is the |
| 130 | * configuration with which this function is associated. | 134 | * configuration with which this function is associated. |
| 131 | * @os_desc_table: Table of (interface id, os descriptors) pairs. The function | 135 | * @os_desc_table: Table of (interface id, os descriptors) pairs. The function |
| @@ -186,6 +190,7 @@ struct usb_function { | |||
| 186 | struct usb_descriptor_header **fs_descriptors; | 190 | struct usb_descriptor_header **fs_descriptors; |
| 187 | struct usb_descriptor_header **hs_descriptors; | 191 | struct usb_descriptor_header **hs_descriptors; |
| 188 | struct usb_descriptor_header **ss_descriptors; | 192 | struct usb_descriptor_header **ss_descriptors; |
| 193 | struct usb_descriptor_header **ssp_descriptors; | ||
| 189 | 194 | ||
| 190 | struct usb_configuration *config; | 195 | struct usb_configuration *config; |
| 191 | 196 | ||
