summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorMugunthan V N <mugunthanvnm@ti.com>2016-11-17 14:38:10 +0530
committerSimon Glass <sjg@chromium.org>2016-12-02 21:04:48 -0700
commit1cac34ce161ae010d3f9ffd3f664e70206638ebc (patch)
treeb4e97524e55215380ee0e0f5c17635e27d523d52 /arch
parent3aec2648698d9be14ab8b3eeb7d4d7d3783379ac (diff)
downloadu-boot-imx-1cac34ce161ae010d3f9ffd3f664e70206638ebc.zip
u-boot-imx-1cac34ce161ae010d3f9ffd3f664e70206638ebc.tar.gz
u-boot-imx-1cac34ce161ae010d3f9ffd3f664e70206638ebc.tar.bz2
drivers: usb: musb: adopt musb backend driver to driver model
Currently all backend driver ops uses hard coded physical address, so to adopt the driver to DM, add device pointer to ops call backs so that drivers can get physical addresses from the usb driver priv/plat data. Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com> Reviewed-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/include/asm/arch-omap3/musb.h6
-rw-r--r--arch/arm/include/asm/omap_musb.h7
-rw-r--r--arch/arm/mach-omap2/am33xx/board.c4
-rw-r--r--arch/arm/mach-omap2/omap3/am35x_musb.c6
4 files changed, 12 insertions, 11 deletions
diff --git a/arch/arm/include/asm/arch-omap3/musb.h b/arch/arm/include/asm/arch-omap3/musb.h
index cee4ed3..d06a758 100644
--- a/arch/arm/include/asm/arch-omap3/musb.h
+++ b/arch/arm/include/asm/arch-omap3/musb.h
@@ -7,7 +7,7 @@
#ifndef __ASM_ARCH_OMAP3_MUSB_H
#define __ASM_ARCH_OMAP3_MUSB_H
-extern void am35x_musb_reset(void);
-extern void am35x_musb_phy_power(u8 on);
-extern void am35x_musb_clear_irq(void);
+void am35x_musb_reset(struct udevice *dev);
+void am35x_musb_phy_power(struct udevice *dev, u8 on);
+void am35x_musb_clear_irq(struct udevice *dev);
#endif
diff --git a/arch/arm/include/asm/omap_musb.h b/arch/arm/include/asm/omap_musb.h
index 8b9cb0e..7c5fb40 100644
--- a/arch/arm/include/asm/omap_musb.h
+++ b/arch/arm/include/asm/omap_musb.h
@@ -15,9 +15,10 @@ extern const struct musb_platform_ops omap2430_ops;
struct omap_musb_board_data {
u8 interface_type;
- void (*set_phy_power)(u8 on);
- void (*clear_irq)(void);
- void (*reset)(void);
+ struct udevice *dev;
+ void (*set_phy_power)(struct udevice *dev, u8 on);
+ void (*clear_irq)(struct udevice *dev);
+ void (*reset)(struct udevice *dev);
};
enum musb_interface {MUSB_INTERFACE_ULPI, MUSB_INTERFACE_UTMI};
diff --git a/arch/arm/mach-omap2/am33xx/board.c b/arch/arm/mach-omap2/am33xx/board.c
index 2ce7790..581c0ab 100644
--- a/arch/arm/mach-omap2/am33xx/board.c
+++ b/arch/arm/mach-omap2/am33xx/board.c
@@ -148,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);
}
@@ -167,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);
}
diff --git a/arch/arm/mach-omap2/omap3/am35x_musb.c b/arch/arm/mach-omap2/omap3/am35x_musb.c
index 74dd105..d542699 100644
--- a/arch/arm/mach-omap2/omap3/am35x_musb.c
+++ b/arch/arm/mach-omap2/omap3/am35x_musb.c
@@ -13,7 +13,7 @@
#include <asm/io.h>
#include <asm/arch/am35x_def.h>
-void am35x_musb_reset(void)
+void am35x_musb_reset(struct udevice *dev)
{
/* Reset the musb interface */
clrsetbits_le32(&am35x_scm_general_regs->ip_sw_reset,
@@ -22,7 +22,7 @@ void am35x_musb_reset(void)
USBOTGSS_SW_RST, 0);
}
-void am35x_musb_phy_power(u8 on)
+void am35x_musb_phy_power(struct udevice *dev, u8 on)
{
unsigned long start = get_timer(0);
@@ -53,7 +53,7 @@ void am35x_musb_phy_power(u8 on)
}
}
-void am35x_musb_clear_irq(void)
+void am35x_musb_clear_irq(struct udevice *dev)
{
clrsetbits_le32(&am35x_scm_general_regs->lvl_intr_clr,
0, USBOTGSS_INT_CLR);