[PATCH v2 2/2] usb: gadget: dfu: add SuperSpeed descriptor support
Thinh Nguyen
Thinh.Nguyen at synopsys.com
Thu Jul 9 20:19:36 CEST 2026
From: Dan Tran <trandan at synopsys.com>
Populate ss_descriptors to support SuperSpeed connections. DFU is
control-only so no separate SS descriptor set is needed; reuse the
same descriptors across all speeds.
Signed-off-by: Dan Tran <trandan at synopsys.com>
Signed-off-by: Thinh Nguyen <Thinh.Nguyen at synopsys.com>
---
Changes in v2:
- Removed internal Reviewed-by tags
drivers/usb/gadget/f_dfu.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/usb/gadget/f_dfu.c b/drivers/usb/gadget/f_dfu.c
index ca8b36e077bc..68d2ec7ebbe8 100644
--- a/drivers/usb/gadget/f_dfu.c
+++ b/drivers/usb/gadget/f_dfu.c
@@ -227,6 +227,7 @@ static inline void to_dfu_mode(struct f_dfu *f_dfu)
f_dfu->usb_function.strings = dfu_strings;
f_dfu->usb_function.hs_descriptors = f_dfu->function;
f_dfu->usb_function.descriptors = f_dfu->function;
+ f_dfu->usb_function.ss_descriptors = f_dfu->function;
f_dfu->dfu_state = DFU_STATE_dfuIDLE;
}
@@ -235,6 +236,7 @@ static inline void to_runtime_mode(struct f_dfu *f_dfu)
f_dfu->usb_function.strings = NULL;
f_dfu->usb_function.hs_descriptors = dfu_runtime_descs;
f_dfu->usb_function.descriptors = dfu_runtime_descs;
+ f_dfu->usb_function.ss_descriptors = dfu_runtime_descs;
}
static int handle_upload(struct usb_request *req, u16 len)
@@ -752,6 +754,9 @@ static int dfu_bind(struct usb_configuration *c, struct usb_function *f)
if (s)
g_dnl_set_serialnumber((char *)s);
+ if (gadget_is_superspeed(cdev->gadget))
+ f_dfu->usb_function.ss_descriptors = f_dfu->function;
+
error:
return rv;
}
@@ -826,6 +831,7 @@ static int dfu_bind_config(struct usb_configuration *c)
f_dfu->usb_function.name = "dfu";
f_dfu->usb_function.hs_descriptors = dfu_runtime_descs;
f_dfu->usb_function.descriptors = dfu_runtime_descs;
+ f_dfu->usb_function.ss_descriptors = dfu_runtime_descs;
f_dfu->usb_function.bind = dfu_bind;
f_dfu->usb_function.unbind = dfu_unbind;
f_dfu->usb_function.set_alt = dfu_set_alt;
--
2.53.0
More information about the U-Boot
mailing list