summaryrefslogtreecommitdiff
path: root/arch/arm/mach-omap2/am33xx/board.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-omap2/am33xx/board.c')
-rw-r--r--arch/arm/mach-omap2/am33xx/board.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/arch/arm/mach-omap2/am33xx/board.c b/arch/arm/mach-omap2/am33xx/board.c
index 5ebeac0..581c0ab 100644
--- a/arch/arm/mach-omap2/am33xx/board.c
+++ b/arch/arm/mach-omap2/am33xx/board.c
@@ -120,7 +120,8 @@ int cpu_mmc_init(bd_t *bis)
/* AM33XX has two MUSB controllers which can be host or gadget */
#if (defined(CONFIG_USB_MUSB_GADGET) || defined(CONFIG_USB_MUSB_HOST)) && \
- (defined(CONFIG_AM335X_USB0) || defined(CONFIG_AM335X_USB1))
+ (defined(CONFIG_AM335X_USB0) || defined(CONFIG_AM335X_USB1)) && \
+ (!defined(CONFIG_DM_USB))
static struct ctrl_dev *cdev = (struct ctrl_dev *)CTRL_DEVICE_BASE;
/* USB 2.0 PHY Control */
@@ -147,7 +148,7 @@ static struct musb_hdrc_config musb_config = {
};
#ifdef CONFIG_AM335X_USB0
-static void am33xx_otg0_set_phy_power(u8 on)
+static void am33xx_otg0_set_phy_power(struct udevice *dev, u8 on)
{
am33xx_usb_set_phy_power(on, &cdev->usb_ctrl0);
}
@@ -166,7 +167,7 @@ static struct musb_hdrc_platform_data otg0_plat = {
#endif
#ifdef CONFIG_AM335X_USB1
-static void am33xx_otg1_set_phy_power(u8 on)
+static void am33xx_otg1_set_phy_power(struct udevice *dev, u8 on)
{
am33xx_usb_set_phy_power(on, &cdev->usb_ctrl1);
}
@@ -187,6 +188,7 @@ static struct musb_hdrc_platform_data otg1_plat = {
int arch_misc_init(void)
{
+#ifndef CONFIG_DM_USB
#ifdef CONFIG_AM335X_USB0
musb_register(&otg0_plat, &otg0_board_data,
(void *)USB0_OTG_BASE);
@@ -195,6 +197,14 @@ int arch_misc_init(void)
musb_register(&otg1_plat, &otg1_board_data,
(void *)USB1_OTG_BASE);
#endif
+#else
+ struct udevice *dev;
+ int ret;
+
+ ret = uclass_first_device(UCLASS_MISC, &dev);
+ if (ret || !dev)
+ return ret;
+#endif
return 0;
}