From 4f792714a83e7a0c6c140f24220ad85f3f8aa73c Mon Sep 17 00:00:00 2001 From: Daniel DeGrasse Date: Thu, 24 Feb 2022 12:41:00 -0600 Subject: [PATCH] drivers: usb_dc_mcux: Enable second USB EHCI Enable second usb EHCI if usb2 node has status="okay" Note that this driver is still an single instance driver, this change simply enables the driver to work with the usb2 peripheral if that one is enabled, and usb1 is disabled. Signed-off-by: Daniel DeGrasse --- drivers/usb/device/usb_dc_mcux.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/usb/device/usb_dc_mcux.c b/drivers/usb/device/usb_dc_mcux.c index 0a1bda0f034..8fa73e4d2bc 100644 --- a/drivers/usb/device/usb_dc_mcux.c +++ b/drivers/usb/device/usb_dc_mcux.c @@ -88,7 +88,12 @@ static const usb_device_controller_interface_struct_t mcux_usb_iface = { USB_DeviceEhciRecv, USB_DeviceEhciCancel, USB_DeviceEhciControl }; + +#if DT_NODE_HAS_STATUS(DT_NODELABEL(usb1), okay) && CONFIG_USB_DC_NXP_EHCI #define CONTROLLER_ID kUSB_ControllerEhci0 +#elif DT_NODE_HAS_STATUS(DT_NODELABEL(usb2), okay) && CONFIG_USB_DC_NXP_EHCI +#define CONTROLLER_ID kUSB_ControllerEhci1 +#endif extern void USB_DeviceEhciIsrFunction(void *deviceHandle);