Skip to content

Commit e2ec54b

Browse files
MarkWangChinesenashif
authored andcommitted
drivers: udc: mcux: remove CONFIG_DT_HAS_NXP_USBPHY_ENABLED
remove CONFIG_DT_HAS_NXP_USBPHY_ENABLED to make codes more simple Signed-off-by: Mark Wang <[email protected]>
1 parent 4fecad4 commit e2ec54b

File tree

2 files changed

+4
-22
lines changed

2 files changed

+4
-22
lines changed

drivers/usb/udc/udc_mcux_ehci.c

+2-11
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,7 @@
2020
#include "usb_device_config.h"
2121
#include "usb_device_mcux_drv_port.h"
2222
#include "usb_device_ehci.h"
23-
#ifdef CONFIG_DT_HAS_NXP_USBPHY_ENABLED
2423
#include "usb_phy.h"
25-
#endif
2624

2725
#include <zephyr/logging/log.h>
2826
LOG_MODULE_REGISTER(udc_mcux, CONFIG_UDC_DRIVER_LOG_LEVEL);
@@ -45,9 +43,7 @@ struct udc_mcux_config {
4543
struct udc_ep_config *ep_cfg_out;
4644
uintptr_t base;
4745
const struct pinctrl_dev_config *pincfg;
48-
#ifdef CONFIG_DT_HAS_NXP_USBPHY_ENABLED
4946
usb_phy_config_struct_t *phy_config;
50-
#endif
5147
};
5248

5349
struct udc_mcux_data {
@@ -856,7 +852,6 @@ static const usb_device_controller_interface_struct_t udc_mcux_if = {
856852
USB_DeviceEhciRecv, USB_DeviceEhciCancel, USB_DeviceEhciControl
857853
};
858854

859-
#ifdef CONFIG_DT_HAS_NXP_USBPHY_ENABLED
860855
#define UDC_MCUX_PHY_DEFINE(n) \
861856
static usb_phy_config_struct_t phy_config_##n = { \
862857
.D_CAL = DT_PROP_OR(DT_INST_PHANDLE(n, phy_handle), tx_d_cal, 0), \
@@ -869,12 +864,8 @@ static usb_phy_config_struct_t phy_config_##n = { \
869864
(UDC_MCUX_PHY_DEFINE(n)), ())
870865

871866
#define UDC_MCUX_PHY_CFG_PTR_OR_NULL(n) \
872-
.phy_config = COND_CODE_1(DT_NODE_HAS_PROP(DT_DRV_INST(n), phy_handle), \
867+
COND_CODE_1(DT_NODE_HAS_PROP(DT_DRV_INST(n), phy_handle), \
873868
(&phy_config_##n), (NULL))
874-
#else
875-
#define UDC_MCUX_PHY_DEFINE_OR(n)
876-
#define UDC_MCUX_PHY_CFG_PTR_OR_NULL(n)
877-
#endif
878869

879870
#define USB_MCUX_EHCI_DEVICE_DEFINE(n) \
880871
UDC_MCUX_PHY_DEFINE_OR(n); \
@@ -910,7 +901,7 @@ static usb_phy_config_struct_t phy_config_##n = { \
910901
.ep_cfg_out = ep_cfg_out##n, \
911902
.mcux_if = &udc_mcux_if, \
912903
.pincfg = PINCTRL_DT_INST_DEV_CONFIG_GET(n), \
913-
UDC_MCUX_PHY_CFG_PTR_OR_NULL(n), \
904+
.phy_config = UDC_MCUX_PHY_CFG_PTR_OR_NULL(n), \
914905
}; \
915906
\
916907
static struct udc_mcux_data priv_data_##n = { \

drivers/usb/udc/udc_mcux_ip3511.c

+2-11
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,7 @@
2020
#include "usb_device_config.h"
2121
#include "usb_device_mcux_drv_port.h"
2222
#include "usb_device_lpcip3511.h"
23-
#ifdef CONFIG_DT_HAS_NXP_USBPHY_ENABLED
2423
#include "usb_phy.h"
25-
#endif
2624

2725
#include <zephyr/logging/log.h>
2826
LOG_MODULE_REGISTER(udc_mcux, CONFIG_UDC_DRIVER_LOG_LEVEL);
@@ -45,9 +43,7 @@ struct udc_mcux_config {
4543
struct udc_ep_config *ep_cfg_out;
4644
uintptr_t base;
4745
const struct pinctrl_dev_config *pincfg;
48-
#ifdef CONFIG_DT_HAS_NXP_USBPHY_ENABLED
4946
usb_phy_config_struct_t *phy_config;
50-
#endif
5147
};
5248

5349
struct udc_mcux_data {
@@ -817,7 +813,6 @@ static const usb_device_controller_interface_struct_t udc_mcux_if = {
817813
USB_DeviceLpc3511IpRecv, USB_DeviceLpc3511IpCancel, USB_DeviceLpc3511IpControl
818814
};
819815

820-
#ifdef CONFIG_DT_HAS_NXP_USBPHY_ENABLED
821816
#define UDC_MCUX_PHY_DEFINE(n) \
822817
static usb_phy_config_struct_t phy_config_##n = { \
823818
.D_CAL = DT_PROP_OR(DT_INST_PHANDLE(n, phy_handle), tx_d_cal, 0), \
@@ -830,12 +825,8 @@ static usb_phy_config_struct_t phy_config_##n = { \
830825
(UDC_MCUX_PHY_DEFINE(n)), ())
831826

832827
#define UDC_MCUX_PHY_CFG_PTR_OR_NULL(n) \
833-
.phy_config = COND_CODE_1(DT_NODE_HAS_PROP(DT_DRV_INST(n), phy_handle), \
828+
COND_CODE_1(DT_NODE_HAS_PROP(DT_DRV_INST(n), phy_handle), \
834829
(&phy_config_##n), (NULL))
835-
#else
836-
#define UDC_MCUX_PHY_DEFINE_OR(n)
837-
#define UDC_MCUX_PHY_CFG_PTR_OR_NULL(n)
838-
#endif
839830

840831
#define USB_MCUX_IP3511_DEVICE_DEFINE(n) \
841832
UDC_MCUX_PHY_DEFINE_OR(n); \
@@ -871,7 +862,7 @@ static usb_phy_config_struct_t phy_config_##n = { \
871862
.ep_cfg_out = ep_cfg_out##n, \
872863
.mcux_if = &udc_mcux_if, \
873864
.pincfg = PINCTRL_DT_INST_DEV_CONFIG_GET(n), \
874-
UDC_MCUX_PHY_CFG_PTR_OR_NULL(n), \
865+
.phy_config = UDC_MCUX_PHY_CFG_PTR_OR_NULL(n), \
875866
}; \
876867
\
877868
static struct udc_mcux_data priv_data_##n = { \

0 commit comments

Comments
 (0)