Skip to content

Commit

Permalink
usb: gadget: add dwc2 support to gadget_chips
Browse files Browse the repository at this point in the history
  • Loading branch information
fourkbomb committed Mar 15, 2019
1 parent 27cc22f commit ee03259
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions drivers/usb/gadget/gadget_chips.h
Expand Up @@ -149,6 +149,12 @@
#define gadget_is_dwc3(g) 0
#endif

#ifdef CONFIG_USB_GADGET_DWC2_OTG
#define gadget_is_dwc2(g) (!strcmp("dwc2-udc", (g)->name))
#else
#define gadget_is_dwc2(g) 0
#endif

/**
* usb_gadget_controller_number - support bcdDevice id convention
* @gadget: the controller being driven
Expand Down Expand Up @@ -208,5 +214,7 @@ static inline int usb_gadget_controller_number(struct usb_gadget *gadget)
return 0x22;
else if (gadget_is_dwc3(gadget))
return 0x23;
else if (gadget_is_dwc2(gadget))
return 0x24;
return -ENOENT;
}

0 comments on commit ee03259

Please sign in to comment.