Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

usb: gadget: Update usb_assign_descriptors for SuperSpeedPlus

Add the 'ssp_descriptors' parameter to the usb_assign_descriptors()
function. This allows a function driver to add descriptors for
SuperSpeedPlus speeds if it supports it.

Also update all uses of this function in the gadget subsystem so that
they pass NULL for the ssp_descriptors parameters.

Signed-off-by: John Youn <johnyoun@synopsys.com>
Signed-off-by: Felipe Balbi <balbi@kernel.org>

authored by

John Youn and committed by
Felipe Balbi
eaef50c7 f228a8de

+24 -19
+2 -1
drivers/usb/gadget/config.c
··· 163 163 int usb_assign_descriptors(struct usb_function *f, 164 164 struct usb_descriptor_header **fs, 165 165 struct usb_descriptor_header **hs, 166 - struct usb_descriptor_header **ss) 166 + struct usb_descriptor_header **ss, 167 + struct usb_descriptor_header **ssp) 167 168 { 168 169 struct usb_gadget *g = f->config->cdev->gadget; 169 170
+1 -1
drivers/usb/gadget/function/f_acm.c
··· 685 685 acm_ss_out_desc.bEndpointAddress = acm_fs_out_desc.bEndpointAddress; 686 686 687 687 status = usb_assign_descriptors(f, acm_fs_function, acm_hs_function, 688 - acm_ss_function); 688 + acm_ss_function, NULL); 689 689 if (status) 690 690 goto fail; 691 691
+1 -1
drivers/usb/gadget/function/f_ecm.c
··· 786 786 fs_ecm_notify_desc.bEndpointAddress; 787 787 788 788 status = usb_assign_descriptors(f, ecm_fs_function, ecm_hs_function, 789 - ecm_ss_function); 789 + ecm_ss_function, NULL); 790 790 if (status) 791 791 goto fail; 792 792
+1 -1
drivers/usb/gadget/function/f_eem.c
··· 309 309 eem_ss_out_desc.bEndpointAddress = eem_fs_out_desc.bEndpointAddress; 310 310 311 311 status = usb_assign_descriptors(f, eem_fs_function, eem_hs_function, 312 - eem_ss_function); 312 + eem_ss_function, NULL); 313 313 if (status) 314 314 goto fail; 315 315
+1 -1
drivers/usb/gadget/function/f_hid.c
··· 646 646 hidg_fs_out_ep_desc.bEndpointAddress; 647 647 648 648 status = usb_assign_descriptors(f, hidg_fs_descriptors, 649 - hidg_hs_descriptors, NULL); 649 + hidg_hs_descriptors, NULL, NULL); 650 650 if (status) 651 651 goto fail; 652 652
+1 -1
drivers/usb/gadget/function/f_loopback.c
··· 211 211 ss_loop_sink_desc.bEndpointAddress = fs_loop_sink_desc.bEndpointAddress; 212 212 213 213 ret = usb_assign_descriptors(f, fs_loopback_descs, hs_loopback_descs, 214 - ss_loopback_descs); 214 + ss_loopback_descs, NULL); 215 215 if (ret) 216 216 return ret; 217 217
+1 -1
drivers/usb/gadget/function/f_mass_storage.c
··· 3093 3093 fsg_ss_bulk_out_comp_desc.bMaxBurst = max_burst; 3094 3094 3095 3095 ret = usb_assign_descriptors(f, fsg_fs_function, fsg_hs_function, 3096 - fsg_ss_function); 3096 + fsg_ss_function, NULL); 3097 3097 if (ret) 3098 3098 goto autoconf_fail; 3099 3099
+1 -1
drivers/usb/gadget/function/f_ncm.c
··· 1432 1432 fs_ncm_notify_desc.bEndpointAddress; 1433 1433 1434 1434 status = usb_assign_descriptors(f, ncm_fs_function, ncm_hs_function, 1435 - NULL); 1435 + NULL, NULL); 1436 1436 if (status) 1437 1437 goto fail; 1438 1438
+2 -1
drivers/usb/gadget/function/f_obex.c
··· 364 364 obex_hs_ep_out_desc.bEndpointAddress = 365 365 obex_fs_ep_out_desc.bEndpointAddress; 366 366 367 - status = usb_assign_descriptors(f, fs_function, hs_function, NULL); 367 + status = usb_assign_descriptors(f, fs_function, hs_function, NULL, 368 + NULL); 368 369 if (status) 369 370 goto fail; 370 371
+1 -1
drivers/usb/gadget/function/f_phonet.c
··· 541 541 542 542 /* Do not try to bind Phonet twice... */ 543 543 status = usb_assign_descriptors(f, fs_pn_function, hs_pn_function, 544 - NULL); 544 + NULL, NULL); 545 545 if (status) 546 546 goto err; 547 547
+1 -1
drivers/usb/gadget/function/f_printer.c
··· 1051 1051 ss_ep_out_desc.bEndpointAddress = fs_ep_out_desc.bEndpointAddress; 1052 1052 1053 1053 ret = usb_assign_descriptors(f, fs_printer_function, 1054 - hs_printer_function, ss_printer_function); 1054 + hs_printer_function, ss_printer_function, NULL); 1055 1055 if (ret) 1056 1056 return ret; 1057 1057
+1 -1
drivers/usb/gadget/function/f_rndis.c
··· 783 783 ss_notify_desc.bEndpointAddress = fs_notify_desc.bEndpointAddress; 784 784 785 785 status = usb_assign_descriptors(f, eth_fs_function, eth_hs_function, 786 - eth_ss_function); 786 + eth_ss_function, NULL); 787 787 if (status) 788 788 goto fail; 789 789
+1 -1
drivers/usb/gadget/function/f_serial.c
··· 236 236 gser_ss_out_desc.bEndpointAddress = gser_fs_out_desc.bEndpointAddress; 237 237 238 238 status = usb_assign_descriptors(f, gser_fs_function, gser_hs_function, 239 - gser_ss_function); 239 + gser_ss_function, NULL); 240 240 if (status) 241 241 goto fail; 242 242 dev_dbg(&cdev->gadget->dev, "generic ttyGS%d: %s speed IN/%s OUT/%s\n",
+1 -1
drivers/usb/gadget/function/f_sourcesink.c
··· 437 437 ss_iso_sink_desc.bEndpointAddress = fs_iso_sink_desc.bEndpointAddress; 438 438 439 439 ret = usb_assign_descriptors(f, fs_source_sink_descs, 440 - hs_source_sink_descs, ss_source_sink_descs); 440 + hs_source_sink_descs, ss_source_sink_descs, NULL); 441 441 if (ret) 442 442 return ret; 443 443
+1 -1
drivers/usb/gadget/function/f_subset.c
··· 362 362 fs_subset_out_desc.bEndpointAddress; 363 363 364 364 status = usb_assign_descriptors(f, fs_eth_function, hs_eth_function, 365 - ss_eth_function); 365 + ss_eth_function, NULL); 366 366 if (status) 367 367 goto fail; 368 368
+1 -1
drivers/usb/gadget/function/f_tcm.c
··· 2098 2098 uasp_fs_cmd_desc.bEndpointAddress = uasp_ss_cmd_desc.bEndpointAddress; 2099 2099 2100 2100 ret = usb_assign_descriptors(f, uasp_fs_function_desc, 2101 - uasp_hs_function_desc, uasp_ss_function_desc); 2101 + uasp_hs_function_desc, uasp_ss_function_desc, NULL); 2102 2102 if (ret) 2103 2103 goto ep_fail; 2104 2104
+2 -1
drivers/usb/gadget/function/f_uac1.c
··· 721 721 status = -ENOMEM; 722 722 723 723 /* copy descriptors, and track endpoint copies */ 724 - status = usb_assign_descriptors(f, f_audio_desc, f_audio_desc, NULL); 724 + status = usb_assign_descriptors(f, f_audio_desc, f_audio_desc, NULL, 725 + NULL); 725 726 if (status) 726 727 goto fail; 727 728 return 0;
+2 -1
drivers/usb/gadget/function/f_uac2.c
··· 1100 1100 hs_epout_desc.bEndpointAddress = fs_epout_desc.bEndpointAddress; 1101 1101 hs_epin_desc.bEndpointAddress = fs_epin_desc.bEndpointAddress; 1102 1102 1103 - ret = usb_assign_descriptors(fn, fs_audio_desc, hs_audio_desc, NULL); 1103 + ret = usb_assign_descriptors(fn, fs_audio_desc, hs_audio_desc, NULL, 1104 + NULL); 1104 1105 if (ret) 1105 1106 goto err; 1106 1107
+2 -1
include/linux/usb/gadget.h
··· 1204 1204 int usb_assign_descriptors(struct usb_function *f, 1205 1205 struct usb_descriptor_header **fs, 1206 1206 struct usb_descriptor_header **hs, 1207 - struct usb_descriptor_header **ss); 1207 + struct usb_descriptor_header **ss, 1208 + struct usb_descriptor_header **ssp); 1208 1209 void usb_free_all_descriptors(struct usb_function *f); 1209 1210 1210 1211 struct usb_descriptor_header *usb_otg_descriptor_alloc(