aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2010-11-10 15:50:07 -0500
committerUwe Kleine-König <u.kleine-koenig@pengutronix.de>2010-11-17 04:01:37 -0500
commit224b8c83641c2f31e3efc9bc5956636cc42cadf7 (patch)
tree831e4ee5c1099cc7cb5cef3159f00bbb718c18de
parent2c20b9f19add2248dc867f1f78dcef1eb0944543 (diff)
ARM: mx25: dynamically allocate fsl-usb2-udc devices
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
-rw-r--r--arch/arm/mach-mx25/Kconfig1
-rw-r--r--arch/arm/mach-mx25/devices-imx25.h4
-rw-r--r--arch/arm/mach-mx25/devices.c26
-rw-r--r--arch/arm/mach-mx25/devices.h1
-rw-r--r--arch/arm/mach-mx25/mach-cpuimx25.c5
-rw-r--r--arch/arm/plat-mxc/devices/platform-fsl-usb2-udc.c5
6 files changed, 12 insertions, 30 deletions
diff --git a/arch/arm/mach-mx25/Kconfig b/arch/arm/mach-mx25/Kconfig
index b55585bf93fd..2944bb71b031 100644
--- a/arch/arm/mach-mx25/Kconfig
+++ b/arch/arm/mach-mx25/Kconfig
@@ -13,6 +13,7 @@ config MACH_EUKREA_CPUIMX25
13 bool "Support Eukrea CPUIMX25 Platform" 13 bool "Support Eukrea CPUIMX25 Platform"
14 select IMX_HAVE_PLATFORM_ESDHC 14 select IMX_HAVE_PLATFORM_ESDHC
15 select IMX_HAVE_PLATFORM_FLEXCAN 15 select IMX_HAVE_PLATFORM_FLEXCAN
16 select IMX_HAVE_PLATFORM_FSL_USB2_UDC
16 select IMX_HAVE_PLATFORM_IMX_I2C 17 select IMX_HAVE_PLATFORM_IMX_I2C
17 select IMX_HAVE_PLATFORM_IMX_UART 18 select IMX_HAVE_PLATFORM_IMX_UART
18 select IMX_HAVE_PLATFORM_MXC_EHCI 19 select IMX_HAVE_PLATFORM_MXC_EHCI
diff --git a/arch/arm/mach-mx25/devices-imx25.h b/arch/arm/mach-mx25/devices-imx25.h
index ac343ae7fe43..448939aac02c 100644
--- a/arch/arm/mach-mx25/devices-imx25.h
+++ b/arch/arm/mach-mx25/devices-imx25.h
@@ -19,6 +19,10 @@ extern const struct imx_flexcan_data imx25_flexcan_data[] __initconst;
19#define imx25_add_flexcan0(pdata) imx25_add_flexcan(0, pdata) 19#define imx25_add_flexcan0(pdata) imx25_add_flexcan(0, pdata)
20#define imx25_add_flexcan1(pdata) imx25_add_flexcan(1, pdata) 20#define imx25_add_flexcan1(pdata) imx25_add_flexcan(1, pdata)
21 21
22extern const struct imx_fsl_usb2_udc_data imx25_fsl_usb2_udc_data __initconst;
23#define imx25_add_fsl_usb2_udc(pdata) \
24 imx_add_fsl_usb2_udc(&imx25_fsl_usb2_udc_data, pdata)
25
22extern const struct imx_imx_i2c_data imx25_imx_i2c_data[] __initconst; 26extern const struct imx_imx_i2c_data imx25_imx_i2c_data[] __initconst;
23#define imx25_add_imx_i2c(id, pdata) \ 27#define imx25_add_imx_i2c(id, pdata) \
24 imx_add_imx_i2c(&imx25_imx_i2c_data[id], pdata) 28 imx_add_imx_i2c(&imx25_imx_i2c_data[id], pdata)
diff --git a/arch/arm/mach-mx25/devices.c b/arch/arm/mach-mx25/devices.c
index 4611c763ff17..27d07ce55ee0 100644
--- a/arch/arm/mach-mx25/devices.c
+++ b/arch/arm/mach-mx25/devices.c
@@ -22,32 +22,6 @@
22#include <mach/mx25.h> 22#include <mach/mx25.h>
23#include <mach/irqs.h> 23#include <mach/irqs.h>
24 24
25static u64 otg_dmamask = DMA_BIT_MASK(32);
26
27static struct resource mxc_otg_resources[] = {
28 {
29 .start = MX25_USB_OTG_BASE_ADDR,
30 .end = MX25_USB_OTG_BASE_ADDR + 0x1ff,
31 .flags = IORESOURCE_MEM,
32 }, {
33 .start = MX25_INT_USB_OTG,
34 .end = MX25_INT_USB_OTG,
35 .flags = IORESOURCE_IRQ,
36 },
37};
38
39/* OTG gadget device */
40struct platform_device otg_udc_device = {
41 .name = "fsl-usb2-udc",
42 .id = -1,
43 .dev = {
44 .dma_mask = &otg_dmamask,
45 .coherent_dma_mask = 0xffffffff,
46 },
47 .resource = mxc_otg_resources,
48 .num_resources = ARRAY_SIZE(mxc_otg_resources),
49};
50
51static struct resource mxc_pwm_resources0[] = { 25static struct resource mxc_pwm_resources0[] = {
52 { 26 {
53 .start = 0x53fe0000, 27 .start = 0x53fe0000,
diff --git a/arch/arm/mach-mx25/devices.h b/arch/arm/mach-mx25/devices.h
index e6ad64061963..266c305a2ad7 100644
--- a/arch/arm/mach-mx25/devices.h
+++ b/arch/arm/mach-mx25/devices.h
@@ -1,4 +1,3 @@
1extern struct platform_device otg_udc_device;
2extern struct platform_device mxc_pwm_device0; 1extern struct platform_device mxc_pwm_device0;
3extern struct platform_device mxc_pwm_device1; 2extern struct platform_device mxc_pwm_device1;
4extern struct platform_device mxc_pwm_device2; 3extern struct platform_device mxc_pwm_device2;
diff --git a/arch/arm/mach-mx25/mach-cpuimx25.c b/arch/arm/mach-mx25/mach-cpuimx25.c
index 0ee0fe73952d..2094bddb3e47 100644
--- a/arch/arm/mach-mx25/mach-cpuimx25.c
+++ b/arch/arm/mach-mx25/mach-cpuimx25.c
@@ -26,7 +26,6 @@
26#include <linux/platform_device.h> 26#include <linux/platform_device.h>
27#include <linux/usb/otg.h> 27#include <linux/usb/otg.h>
28#include <linux/usb/ulpi.h> 28#include <linux/usb/ulpi.h>
29#include <linux/fsl_devices.h>
30 29
31#include <mach/eukrea-baseboards.h> 30#include <mach/eukrea-baseboards.h>
32#include <mach/hardware.h> 31#include <mach/hardware.h>
@@ -97,7 +96,7 @@ static const struct mxc_usbh_platform_data usbh2_pdata __initconst = {
97 MXC_EHCI_IPPUE_DOWN, 96 MXC_EHCI_IPPUE_DOWN,
98}; 97};
99 98
100static struct fsl_usb2_platform_data otg_device_pdata = { 99static const struct fsl_usb2_platform_data otg_device_pdata __initconst = {
101 .operating_mode = FSL_USB2_DR_DEVICE, 100 .operating_mode = FSL_USB2_DR_DEVICE,
102 .phy_mode = FSL_USB2_PHY_UTMI, 101 .phy_mode = FSL_USB2_PHY_UTMI,
103}; 102};
@@ -135,7 +134,7 @@ static void __init eukrea_cpuimx25_init(void)
135 if (otg_mode_host) 134 if (otg_mode_host)
136 imx25_add_mxc_ehci_otg(&otg_pdata); 135 imx25_add_mxc_ehci_otg(&otg_pdata);
137 else 136 else
138 mxc_register_device(&otg_udc_device, &otg_device_pdata); 137 imx25_add_fsl_usb2_udc(&otg_device_pdata);
139 138
140 imx25_add_mxc_ehci_hs(&usbh2_pdata); 139 imx25_add_mxc_ehci_hs(&usbh2_pdata);
141 140
diff --git a/arch/arm/plat-mxc/devices/platform-fsl-usb2-udc.c b/arch/arm/plat-mxc/devices/platform-fsl-usb2-udc.c
index 3116f9ad263f..cb5fb710e850 100644
--- a/arch/arm/plat-mxc/devices/platform-fsl-usb2-udc.c
+++ b/arch/arm/plat-mxc/devices/platform-fsl-usb2-udc.c
@@ -15,6 +15,11 @@
15 .irq = soc ## _INT_USB_OTG, \ 15 .irq = soc ## _INT_USB_OTG, \
16 } 16 }
17 17
18#ifdef CONFIG_ARCH_MX25
19const struct imx_fsl_usb2_udc_data imx25_fsl_usb2_udc_data __initconst =
20 imx_fsl_usb2_udc_data_entry_single(MX25);
21#endif
22
18#ifdef CONFIG_SOC_IMX27 23#ifdef CONFIG_SOC_IMX27
19const struct imx_fsl_usb2_udc_data imx27_fsl_usb2_udc_data __initconst = 24const struct imx_fsl_usb2_udc_data imx27_fsl_usb2_udc_data __initconst =
20 imx_fsl_usb2_udc_data_entry_single(MX27); 25 imx_fsl_usb2_udc_data_entry_single(MX27);