Skip to content

Commit 371ebaa

Browse files
middleware: usb: update mcux usb host controller driver to support zephyr
- EHCI and KHCI driver include Zephyr USB port file if it is Zephyr environment Signed-off-by: Mark Wang <yichang.wang@nxp.com>
1 parent 4c32213 commit 371ebaa

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

mcux/middleware/mcux-sdk-middleware-usb/host/usb_host_ehci.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@
77
*/
88
#include "usb_host_config.h"
99
#if ((defined USB_HOST_CONFIG_EHCI) && (USB_HOST_CONFIG_EHCI > 0U))
10+
#if (defined CONFIG_UHC_DRIVER)
11+
#include "usb_host_mcux_drv_port.h"
12+
#include "fsl_device_registers.h"
13+
#include "usb_host_ehci.h"
14+
#if ((defined FSL_FEATURE_SOC_USBPHY_COUNT) && (FSL_FEATURE_SOC_USBPHY_COUNT))
15+
#include "usb_phy.h"
16+
#endif
17+
#else
1018
#include "usb_host.h"
1119
#include "usb_host_hci.h"
1220
#include "usb_host_devices.h"
@@ -21,6 +29,7 @@
2129
#if ((defined USB_HOST_CONFIG_COMPLIANCE_TEST) && (USB_HOST_CONFIG_COMPLIANCE_TEST))
2230
#include "usb_host.h"
2331
#endif
32+
#endif
2433
#if (defined(FSL_FEATURE_MEMORY_HAS_ADDRESS_OFFSET) && (FSL_FEATURE_MEMORY_HAS_ADDRESS_OFFSET > 0U))
2534
#include "fsl_memory.h"
2635
#endif

mcux/middleware/mcux-sdk-middleware-usb/host/usb_host_khci.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,18 @@
88

99
#include "usb_host_config.h"
1010
#if ((defined USB_HOST_CONFIG_KHCI) && (USB_HOST_CONFIG_KHCI))
11+
#if (defined CONFIG_UHC_DRIVER)
12+
#include "usb_host_mcux_drv_port.h"
13+
#include "fsl_device_registers.h"
14+
#include "usb_host_khci.h"
15+
#else
1116
#include "usb_host.h"
1217
#include "usb_host_hci.h"
1318
#include "fsl_device_registers.h"
1419
#include "usb_host_khci.h"
1520
#include "usb_host_devices.h"
1621
#include "usb_host_framework.h"
22+
#endif
1723
/*******************************************************************************
1824
* Variables
1925
******************************************************************************/
@@ -1703,7 +1709,7 @@ usb_status_t USB_HostKhciOpenPipe(usb_host_controller_handle controllerHandle,
17031709
{
17041710
usb_khci_host_state_struct_t *usbHostPointer = (usb_khci_host_state_struct_t *)controllerHandle;
17051711
usb_host_pipe_t *pipePointer;
1706-
usb_host_pipe_t *prePipePointer;
1712+
usb_host_pipe_t *prePipePointer = NULL;
17071713
usb_host_pipe_t *tempPipePointer;
17081714

17091715
OSA_SR_ALLOC();

0 commit comments

Comments
 (0)