diff options
| author | Patrick Delaunay <[email protected]> | 2019-06-18 16:57:18 +0200 |
|---|---|---|
| committer | Patrice Chotard <[email protected]> | 2019-06-19 16:56:11 +0200 |
| commit | 7c654683464dc4cd89f9a8198e26336263390b57 (patch) | |
| tree | 864cd0a8a0d81ed5c9a542424f27ba89270be10f /drivers | |
| parent | de6e4a6f5c3cd12ccda8d408ea60079211346e5e (diff) | |
usb: dwc2: allow peripheral mode for OTG configuration
Allow device mode in DWC2 driver when device tree select the dr_mode
"peripheral" or "otg".
The device mode is not allowed when dr_mode = "host" in device tree.
Signed-off-by: Patrick Delaunay <[email protected]>
Reviewed-by: Marek Vasut <[email protected]>
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/usb/gadget/dwc2_udc_otg.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/usb/gadget/dwc2_udc_otg.c b/drivers/usb/gadget/dwc2_udc_otg.c index 023439cdacc..35f4147840e 100644 --- a/drivers/usb/gadget/dwc2_udc_otg.c +++ b/drivers/usb/gadget/dwc2_udc_otg.c @@ -1041,7 +1041,8 @@ static int dwc2_udc_otg_ofdata_to_platdata(struct udevice *dev) void (*set_params)(struct dwc2_plat_otg_data *data); int ret; - if (usb_get_dr_mode(node) != USB_DR_MODE_PERIPHERAL) { + if (usb_get_dr_mode(node) != USB_DR_MODE_PERIPHERAL && + usb_get_dr_mode(node) != USB_DR_MODE_OTG) { dev_dbg(dev, "Invalid mode\n"); return -ENODEV; } |
