File tree Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -2041,15 +2041,21 @@ static int udc_dwc2_init_controller(const struct device *dev)
2041
2041
case USB_DWC2_GHWCFG2_HSPHYTYPE_ULPI :
2042
2042
gusbcfg |= USB_DWC2_GUSBCFG_PHYSEL_USB20 |
2043
2043
USB_DWC2_GUSBCFG_ULPI_UTMI_SEL_ULPI ;
2044
- dcfg |= USB_DWC2_DCFG_DEVSPD_USBHS20
2045
- << USB_DWC2_DCFG_DEVSPD_POS ;
2044
+ if (IS_ENABLED (CONFIG_UDC_DRIVER_HIGH_SPEED_SUPPORT_ENABLED )) {
2045
+ dcfg |= usb_dwc2_set_dcfg_devspd (USB_DWC2_DCFG_DEVSPD_USBHS20 );
2046
+ } else {
2047
+ dcfg |= usb_dwc2_set_dcfg_devspd (USB_DWC2_DCFG_DEVSPD_USBFS20 );
2048
+ }
2046
2049
hs_phy = true;
2047
2050
break ;
2048
2051
case USB_DWC2_GHWCFG2_HSPHYTYPE_UTMIPLUS :
2049
2052
gusbcfg |= USB_DWC2_GUSBCFG_PHYSEL_USB20 |
2050
2053
USB_DWC2_GUSBCFG_ULPI_UTMI_SEL_UTMI ;
2051
- dcfg |= USB_DWC2_DCFG_DEVSPD_USBHS20
2052
- << USB_DWC2_DCFG_DEVSPD_POS ;
2054
+ if (IS_ENABLED (CONFIG_UDC_DRIVER_HIGH_SPEED_SUPPORT_ENABLED )) {
2055
+ dcfg |= usb_dwc2_set_dcfg_devspd (USB_DWC2_DCFG_DEVSPD_USBHS20 );
2056
+ } else {
2057
+ dcfg |= usb_dwc2_set_dcfg_devspd (USB_DWC2_DCFG_DEVSPD_USBFS20 );
2058
+ }
2053
2059
hs_phy = true;
2054
2060
break ;
2055
2061
case USB_DWC2_GHWCFG2_HSPHYTYPE_NO_HS :
@@ -2060,8 +2066,7 @@ static int udc_dwc2_init_controller(const struct device *dev)
2060
2066
gusbcfg |= USB_DWC2_GUSBCFG_PHYSEL_USB11 ;
2061
2067
}
2062
2068
2063
- dcfg |= USB_DWC2_DCFG_DEVSPD_USBFS1148
2064
- << USB_DWC2_DCFG_DEVSPD_POS ;
2069
+ dcfg |= usb_dwc2_set_dcfg_devspd (USB_DWC2_DCFG_DEVSPD_USBFS1148 );
2065
2070
hs_phy = false;
2066
2071
}
2067
2072
You can’t perform that action at this time.
0 commit comments