MLK-20160-2 imx8qm/qxp: Fix build error when OTG gadget is enabled
Because u-boot USB gadget only can support one driver, so if we enable ci_udc driver, the cdns3 gadget driver must be disabled. This cause build error because we don't wrap the cdns gadget functions with its configuration. Fix the issue by adding CONFIG_USB_CDNS3_GADGET before cdns3 gadget function. Signed-off-by: Ye Li <ye.li@nxp.com>zero-sugar
parent
477dd3a2cb
commit
86d712e354
|
@ -277,7 +277,7 @@ void pci_init_board(void)
|
|||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_USB_XHCI_IMX8
|
||||
#ifdef CONFIG_USB
|
||||
|
||||
#ifdef CONFIG_USB_TCPC
|
||||
#define USB_TYPEC_SEL IMX_GPIO_NR(4, 6)
|
||||
|
@ -315,6 +315,7 @@ static void setup_typec(void)
|
|||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_USB_CDNS3_GADGET
|
||||
static struct cdns3_device cdns3_device_data = {
|
||||
.none_core_base = 0x5B110000,
|
||||
.xhci_base = 0x5B130000,
|
||||
|
@ -330,6 +331,7 @@ int usb_gadget_handle_interrupts(void)
|
|||
cdns3_uboot_handle_interrupt(1);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
int board_usb_init(int index, enum usb_init_type init)
|
||||
{
|
||||
|
@ -340,6 +342,7 @@ int board_usb_init(int index, enum usb_init_type init)
|
|||
#ifdef CONFIG_USB_TCPC
|
||||
ret = tcpc_setup_dfp_mode(&port);
|
||||
#endif
|
||||
#ifdef CONFIG_USB_CDNS3_GADGET
|
||||
} else {
|
||||
struct power_domain pd;
|
||||
int ret;
|
||||
|
@ -364,6 +367,7 @@ int board_usb_init(int index, enum usb_init_type init)
|
|||
|
||||
ret = cdns3_uboot_init(&cdns3_device_data);
|
||||
printf("%d cdns3_uboot_initmode %d\n", index, ret);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
|
@ -378,6 +382,7 @@ int board_usb_cleanup(int index, enum usb_init_type init)
|
|||
#ifdef CONFIG_USB_TCPC
|
||||
ret = tcpc_disable_src_vbus(&port);
|
||||
#endif
|
||||
#ifdef CONFIG_USB_CDNS3_GADGET
|
||||
} else {
|
||||
struct power_domain pd;
|
||||
int ret;
|
||||
|
@ -396,6 +401,7 @@ int board_usb_cleanup(int index, enum usb_init_type init)
|
|||
if (ret)
|
||||
printf("conn_usb2_phy Power up failed! (error = %d)\n", ret);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
|
|
|
@ -461,6 +461,7 @@ static void setup_typec(void)
|
|||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_USB_CDNS3_GADGET
|
||||
static struct cdns3_device cdns3_device_data = {
|
||||
.none_core_base = 0x5B110000,
|
||||
.xhci_base = 0x5B130000,
|
||||
|
@ -476,6 +477,7 @@ int usb_gadget_handle_interrupts(void)
|
|||
cdns3_uboot_handle_interrupt(1);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
int board_usb_init(int index, enum usb_init_type init)
|
||||
{
|
||||
|
@ -486,6 +488,7 @@ int board_usb_init(int index, enum usb_init_type init)
|
|||
#ifdef CONFIG_USB_TCPC
|
||||
ret = tcpc_setup_dfp_mode(&port);
|
||||
#endif
|
||||
#ifdef CONFIG_USB_CDNS3_GADGET
|
||||
} else {
|
||||
struct power_domain pd;
|
||||
int ret;
|
||||
|
@ -509,6 +512,7 @@ int board_usb_init(int index, enum usb_init_type init)
|
|||
|
||||
ret = cdns3_uboot_init(&cdns3_device_data);
|
||||
printf("%d cdns3_uboot_initmode %d\n", index, ret);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -525,6 +529,7 @@ int board_usb_cleanup(int index, enum usb_init_type init)
|
|||
#ifdef CONFIG_USB_TCPC
|
||||
ret = tcpc_disable_src_vbus(&port);
|
||||
#endif
|
||||
#ifdef CONFIG_USB_CDNS3_GADGET
|
||||
} else {
|
||||
struct power_domain pd;
|
||||
int ret;
|
||||
|
@ -543,6 +548,7 @@ int board_usb_cleanup(int index, enum usb_init_type init)
|
|||
if (ret)
|
||||
printf("conn_usb2_phy Power up failed! (error = %d)\n", ret);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue