diff options
author | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2010-11-15 05:57:49 -0500 |
---|---|---|
committer | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2010-11-19 15:54:35 -0500 |
commit | 2d58de2805f93bdb8fa0608d98e1871bb28ec091 (patch) | |
tree | c02b9ce615ef49dea30cae203f4a6fbceb668daa | |
parent | 9e1dde33876ba83ad586c336647fff133d0f5472 (diff) |
ARM: mx3: dynamically allocate mxc-ehci devices
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
-rw-r--r-- | arch/arm/mach-mx3/Kconfig | 8 | ||||
-rw-r--r-- | arch/arm/mach-mx3/devices-imx31.h | 7 | ||||
-rw-r--r-- | arch/arm/mach-mx3/devices-imx35.h | 7 | ||||
-rw-r--r-- | arch/arm/mach-mx3/devices.c | 89 | ||||
-rw-r--r-- | arch/arm/mach-mx3/devices.h | 3 | ||||
-rw-r--r-- | arch/arm/mach-mx3/mach-armadillo5x0.c | 9 | ||||
-rw-r--r-- | arch/arm/mach-mx3/mach-cpuimx35.c | 9 | ||||
-rw-r--r-- | arch/arm/mach-mx3/mach-mx31lilly.c | 9 | ||||
-rw-r--r-- | arch/arm/mach-mx3/mach-mx31lite.c | 5 | ||||
-rw-r--r-- | arch/arm/mach-mx3/mach-mx31moboard.c | 11 | ||||
-rw-r--r-- | arch/arm/mach-mx3/mach-mx35_3ds.c | 5 | ||||
-rw-r--r-- | arch/arm/mach-mx3/mach-pcm037.c | 9 | ||||
-rw-r--r-- | arch/arm/mach-mx3/mach-pcm043.c | 9 | ||||
-rw-r--r-- | arch/arm/mach-mx3/mx31moboard-devboard.c | 10 | ||||
-rw-r--r-- | arch/arm/mach-mx3/mx31moboard-marxbot.c | 10 | ||||
-rw-r--r-- | arch/arm/mach-mx3/mx31moboard-smartbot.c | 11 | ||||
-rw-r--r-- | arch/arm/plat-mxc/devices/platform-mxc-ehci.c | 16 |
17 files changed, 92 insertions, 135 deletions
diff --git a/arch/arm/mach-mx3/Kconfig b/arch/arm/mach-mx3/Kconfig index 120add4b7bb9..157348354b7f 100644 --- a/arch/arm/mach-mx3/Kconfig +++ b/arch/arm/mach-mx3/Kconfig | |||
@@ -53,6 +53,7 @@ config MACH_PCM037 | |||
53 | select IMX_HAVE_PLATFORM_FSL_USB2_UDC | 53 | select IMX_HAVE_PLATFORM_FSL_USB2_UDC |
54 | select IMX_HAVE_PLATFORM_IMX_I2C | 54 | select IMX_HAVE_PLATFORM_IMX_I2C |
55 | select IMX_HAVE_PLATFORM_IMX_UART | 55 | select IMX_HAVE_PLATFORM_IMX_UART |
56 | select IMX_HAVE_PLATFORM_MXC_EHCI | ||
56 | select IMX_HAVE_PLATFORM_MXC_MMC | 57 | select IMX_HAVE_PLATFORM_MXC_MMC |
57 | select IMX_HAVE_PLATFORM_MXC_NAND | 58 | select IMX_HAVE_PLATFORM_MXC_NAND |
58 | select IMX_HAVE_PLATFORM_MXC_W1 | 59 | select IMX_HAVE_PLATFORM_MXC_W1 |
@@ -75,6 +76,7 @@ config MACH_MX31LITE | |||
75 | select SOC_IMX31 | 76 | select SOC_IMX31 |
76 | select MXC_ULPI if USB_ULPI | 77 | select MXC_ULPI if USB_ULPI |
77 | select IMX_HAVE_PLATFORM_IMX_UART | 78 | select IMX_HAVE_PLATFORM_IMX_UART |
79 | select IMX_HAVE_PLATFORM_MXC_EHCI | ||
78 | select IMX_HAVE_PLATFORM_MXC_MMC | 80 | select IMX_HAVE_PLATFORM_MXC_MMC |
79 | select IMX_HAVE_PLATFORM_MXC_NAND | 81 | select IMX_HAVE_PLATFORM_MXC_NAND |
80 | select IMX_HAVE_PLATFORM_SPI_IMX | 82 | select IMX_HAVE_PLATFORM_SPI_IMX |
@@ -109,6 +111,7 @@ config MACH_MX31MOBOARD | |||
109 | select IMX_HAVE_PLATFORM_FSL_USB2_UDC | 111 | select IMX_HAVE_PLATFORM_FSL_USB2_UDC |
110 | select IMX_HAVE_PLATFORM_IMX_I2C | 112 | select IMX_HAVE_PLATFORM_IMX_I2C |
111 | select IMX_HAVE_PLATFORM_IMX_UART | 113 | select IMX_HAVE_PLATFORM_IMX_UART |
114 | select IMX_HAVE_PLATFORM_MXC_EHCI | ||
112 | select IMX_HAVE_PLATFORM_MXC_MMC | 115 | select IMX_HAVE_PLATFORM_MXC_MMC |
113 | select IMX_HAVE_PLATFORM_SPI_IMX | 116 | select IMX_HAVE_PLATFORM_SPI_IMX |
114 | select MXC_ULPI if USB_ULPI | 117 | select MXC_ULPI if USB_ULPI |
@@ -120,6 +123,7 @@ config MACH_MX31LILLY | |||
120 | bool "Support MX31 LILLY-1131 platforms (INCO startec)" | 123 | bool "Support MX31 LILLY-1131 platforms (INCO startec)" |
121 | select SOC_IMX31 | 124 | select SOC_IMX31 |
122 | select IMX_HAVE_PLATFORM_IMX_UART | 125 | select IMX_HAVE_PLATFORM_IMX_UART |
126 | select IMX_HAVE_PLATFORM_MXC_EHCI | ||
123 | select IMX_HAVE_PLATFORM_MXC_MMC | 127 | select IMX_HAVE_PLATFORM_MXC_MMC |
124 | select IMX_HAVE_PLATFORM_SPI_IMX | 128 | select IMX_HAVE_PLATFORM_SPI_IMX |
125 | select MXC_ULPI if USB_ULPI | 129 | select MXC_ULPI if USB_ULPI |
@@ -142,6 +146,7 @@ config MACH_PCM043 | |||
142 | select IMX_HAVE_PLATFORM_IMX_I2C | 146 | select IMX_HAVE_PLATFORM_IMX_I2C |
143 | select IMX_HAVE_PLATFORM_IMX_SSI | 147 | select IMX_HAVE_PLATFORM_IMX_SSI |
144 | select IMX_HAVE_PLATFORM_IMX_UART | 148 | select IMX_HAVE_PLATFORM_IMX_UART |
149 | select IMX_HAVE_PLATFORM_MXC_EHCI | ||
145 | select IMX_HAVE_PLATFORM_MXC_NAND | 150 | select IMX_HAVE_PLATFORM_MXC_NAND |
146 | select IMX_HAVE_PLATFORM_FLEXCAN | 151 | select IMX_HAVE_PLATFORM_FLEXCAN |
147 | select IMX_HAVE_PLATFORM_ESDHC | 152 | select IMX_HAVE_PLATFORM_ESDHC |
@@ -155,6 +160,7 @@ config MACH_ARMADILLO5X0 | |||
155 | select SOC_IMX31 | 160 | select SOC_IMX31 |
156 | select IMX_HAVE_PLATFORM_IMX_I2C | 161 | select IMX_HAVE_PLATFORM_IMX_I2C |
157 | select IMX_HAVE_PLATFORM_IMX_UART | 162 | select IMX_HAVE_PLATFORM_IMX_UART |
163 | select IMX_HAVE_PLATFORM_MXC_EHCI | ||
158 | select IMX_HAVE_PLATFORM_MXC_MMC | 164 | select IMX_HAVE_PLATFORM_MXC_MMC |
159 | select IMX_HAVE_PLATFORM_MXC_NAND | 165 | select IMX_HAVE_PLATFORM_MXC_NAND |
160 | select MXC_ULPI if USB_ULPI | 166 | select MXC_ULPI if USB_ULPI |
@@ -169,6 +175,7 @@ config MACH_MX35_3DS | |||
169 | select IMX_HAVE_PLATFORM_ESDHC | 175 | select IMX_HAVE_PLATFORM_ESDHC |
170 | select IMX_HAVE_PLATFORM_FSL_USB2_UDC | 176 | select IMX_HAVE_PLATFORM_FSL_USB2_UDC |
171 | select IMX_HAVE_PLATFORM_IMX_UART | 177 | select IMX_HAVE_PLATFORM_IMX_UART |
178 | select IMX_HAVE_PLATFORM_MXC_EHCI | ||
172 | select IMX_HAVE_PLATFORM_MXC_NAND | 179 | select IMX_HAVE_PLATFORM_MXC_NAND |
173 | help | 180 | help |
174 | Include support for MX35PDK platform. This includes specific | 181 | Include support for MX35PDK platform. This includes specific |
@@ -188,6 +195,7 @@ config MACH_EUKREA_CPUIMX35 | |||
188 | select IMX_HAVE_PLATFORM_FSL_USB2_UDC | 195 | select IMX_HAVE_PLATFORM_FSL_USB2_UDC |
189 | select IMX_HAVE_PLATFORM_IMX_UART | 196 | select IMX_HAVE_PLATFORM_IMX_UART |
190 | select IMX_HAVE_PLATFORM_IMX_I2C | 197 | select IMX_HAVE_PLATFORM_IMX_I2C |
198 | select IMX_HAVE_PLATFORM_MXC_EHCI | ||
191 | select IMX_HAVE_PLATFORM_MXC_NAND | 199 | select IMX_HAVE_PLATFORM_MXC_NAND |
192 | select IMX_HAVE_PLATFORM_FLEXCAN | 200 | select IMX_HAVE_PLATFORM_FLEXCAN |
193 | select IMX_HAVE_PLATFORM_ESDHC | 201 | select IMX_HAVE_PLATFORM_ESDHC |
diff --git a/arch/arm/mach-mx3/devices-imx31.h b/arch/arm/mach-mx3/devices-imx31.h index 0cefaca5d13d..6571dd795e97 100644 --- a/arch/arm/mach-mx3/devices-imx31.h +++ b/arch/arm/mach-mx3/devices-imx31.h | |||
@@ -33,6 +33,13 @@ extern const struct imx_imx_uart_1irq_data imx31_imx_uart_data[] __initconst; | |||
33 | #define imx31_add_imx_uart3(pdata) imx31_add_imx_uart(3, pdata) | 33 | #define imx31_add_imx_uart3(pdata) imx31_add_imx_uart(3, pdata) |
34 | #define imx31_add_imx_uart4(pdata) imx31_add_imx_uart(4, pdata) | 34 | #define imx31_add_imx_uart4(pdata) imx31_add_imx_uart(4, pdata) |
35 | 35 | ||
36 | extern const struct imx_mxc_ehci_data imx31_mxc_ehci_otg_data __initconst; | ||
37 | #define imx31_add_mxc_ehci_otg(pdata) \ | ||
38 | imx_add_mxc_ehci(&imx31_mxc_ehci_otg_data, pdata) | ||
39 | extern const struct imx_mxc_ehci_data imx31_mxc_ehci_hs_data[] __initconst; | ||
40 | #define imx31_add_mxc_ehci_hs(id, pdata) \ | ||
41 | imx_add_mxc_ehci(&imx31_mxc_ehci_hs_data[id - 1], pdata) | ||
42 | |||
36 | extern const struct imx_mxc_mmc_data imx31_mxc_mmc_data[] __initconst; | 43 | extern const struct imx_mxc_mmc_data imx31_mxc_mmc_data[] __initconst; |
37 | #define imx31_add_mxc_mmc(id, pdata) \ | 44 | #define imx31_add_mxc_mmc(id, pdata) \ |
38 | imx_add_mxc_mmc(&imx31_mxc_mmc_data[id], pdata) | 45 | imx_add_mxc_mmc(&imx31_mxc_mmc_data[id], pdata) |
diff --git a/arch/arm/mach-mx3/devices-imx35.h b/arch/arm/mach-mx3/devices-imx35.h index 36561ccdfbd6..849c48a2c472 100644 --- a/arch/arm/mach-mx3/devices-imx35.h +++ b/arch/arm/mach-mx3/devices-imx35.h | |||
@@ -41,6 +41,13 @@ extern const struct imx_imx_uart_1irq_data imx35_imx_uart_data[] __initconst; | |||
41 | #define imx35_add_imx_uart1(pdata) imx35_add_imx_uart(1, pdata) | 41 | #define imx35_add_imx_uart1(pdata) imx35_add_imx_uart(1, pdata) |
42 | #define imx35_add_imx_uart2(pdata) imx35_add_imx_uart(2, pdata) | 42 | #define imx35_add_imx_uart2(pdata) imx35_add_imx_uart(2, pdata) |
43 | 43 | ||
44 | extern const struct imx_mxc_ehci_data imx35_mxc_ehci_otg_data __initconst; | ||
45 | #define imx35_add_mxc_ehci_otg(pdata) \ | ||
46 | imx_add_mxc_ehci(&imx35_mxc_ehci_otg_data, pdata) | ||
47 | extern const struct imx_mxc_ehci_data imx35_mxc_ehci_hs_data __initconst; | ||
48 | #define imx35_add_mxc_ehci_hs(pdata) \ | ||
49 | imx_add_mxc_ehci(&imx35_mxc_ehci_hs_data, pdata) | ||
50 | |||
44 | extern const struct imx_mxc_nand_data imx35_mxc_nand_data __initconst; | 51 | extern const struct imx_mxc_nand_data imx35_mxc_nand_data __initconst; |
45 | #define imx35_add_mxc_nand(pdata) \ | 52 | #define imx35_add_mxc_nand(pdata) \ |
46 | imx_add_mxc_nand(&imx35_mxc_nand_data, pdata) | 53 | imx_add_mxc_nand(&imx35_mxc_nand_data, pdata) |
diff --git a/arch/arm/mach-mx3/devices.c b/arch/arm/mach-mx3/devices.c index 3f859ae8b850..c122c0faaaa5 100644 --- a/arch/arm/mach-mx3/devices.c +++ b/arch/arm/mach-mx3/devices.c | |||
@@ -95,87 +95,6 @@ struct platform_device mx3_camera = { | |||
95 | }, | 95 | }, |
96 | }; | 96 | }; |
97 | 97 | ||
98 | static struct resource otg_resources[] = { | ||
99 | { | ||
100 | .start = MX31_USB_OTG_BASE_ADDR, | ||
101 | .end = MX31_USB_OTG_BASE_ADDR + 0x1ff, | ||
102 | .flags = IORESOURCE_MEM, | ||
103 | }, { | ||
104 | .start = MX31_INT_USB_OTG, | ||
105 | .end = MX31_INT_USB_OTG, | ||
106 | .flags = IORESOURCE_IRQ, | ||
107 | }, | ||
108 | }; | ||
109 | |||
110 | static u64 otg_dmamask = DMA_BIT_MASK(32); | ||
111 | |||
112 | /* OTG host */ | ||
113 | struct platform_device mxc_otg_host = { | ||
114 | .name = "mxc-ehci", | ||
115 | .id = 0, | ||
116 | .dev = { | ||
117 | .coherent_dma_mask = 0xffffffff, | ||
118 | .dma_mask = &otg_dmamask, | ||
119 | }, | ||
120 | .resource = otg_resources, | ||
121 | .num_resources = ARRAY_SIZE(otg_resources), | ||
122 | }; | ||
123 | |||
124 | /* USB host 1 */ | ||
125 | |||
126 | static u64 usbh1_dmamask = ~(u32)0; | ||
127 | |||
128 | static struct resource mxc_usbh1_resources[] = { | ||
129 | { | ||
130 | .start = MX31_USB_HS1_BASE_ADDR, | ||
131 | .end = MX31_USB_HS1_BASE_ADDR + 0x1ff, | ||
132 | .flags = IORESOURCE_MEM, | ||
133 | }, { | ||
134 | .start = MX31_INT_USB_HS1, | ||
135 | .end = MX31_INT_USB_HS1, | ||
136 | .flags = IORESOURCE_IRQ, | ||
137 | }, | ||
138 | }; | ||
139 | |||
140 | struct platform_device mxc_usbh1 = { | ||
141 | .name = "mxc-ehci", | ||
142 | .id = 1, | ||
143 | .dev = { | ||
144 | .coherent_dma_mask = 0xffffffff, | ||
145 | .dma_mask = &usbh1_dmamask, | ||
146 | }, | ||
147 | .resource = mxc_usbh1_resources, | ||
148 | .num_resources = ARRAY_SIZE(mxc_usbh1_resources), | ||
149 | }; | ||
150 | |||
151 | #ifdef CONFIG_ARCH_MX31 | ||
152 | /* USB host 2 */ | ||
153 | static u64 usbh2_dmamask = ~(u32)0; | ||
154 | |||
155 | static struct resource mxc_usbh2_resources[] = { | ||
156 | { | ||
157 | .start = MX31_USB_HS2_BASE_ADDR, | ||
158 | .end = MX31_USB_HS2_BASE_ADDR + 0x1ff, | ||
159 | .flags = IORESOURCE_MEM, | ||
160 | }, { | ||
161 | .start = MX31_INT_USB_HS2, | ||
162 | .end = MX31_INT_USB_HS2, | ||
163 | .flags = IORESOURCE_IRQ, | ||
164 | }, | ||
165 | }; | ||
166 | |||
167 | struct platform_device mxc_usbh2 = { | ||
168 | .name = "mxc-ehci", | ||
169 | .id = 2, | ||
170 | .dev = { | ||
171 | .coherent_dma_mask = 0xffffffff, | ||
172 | .dma_mask = &usbh2_dmamask, | ||
173 | }, | ||
174 | .resource = mxc_usbh2_resources, | ||
175 | .num_resources = ARRAY_SIZE(mxc_usbh2_resources), | ||
176 | }; | ||
177 | #endif | ||
178 | |||
179 | static struct resource imx_wdt_resources[] = { | 98 | static struct resource imx_wdt_resources[] = { |
180 | { | 99 | { |
181 | .flags = IORESOURCE_MEM, | 100 | .flags = IORESOURCE_MEM, |
@@ -237,14 +156,6 @@ static int __init mx3_devices_init(void) | |||
237 | #endif | 156 | #endif |
238 | #if defined(CONFIG_ARCH_MX35) | 157 | #if defined(CONFIG_ARCH_MX35) |
239 | if (cpu_is_mx35()) { | 158 | if (cpu_is_mx35()) { |
240 | otg_resources[0].start = MX35_USB_OTG_BASE_ADDR; | ||
241 | otg_resources[0].end = MX35_USB_OTG_BASE_ADDR + 0x1ff; | ||
242 | otg_resources[1].start = MX35_INT_USB_OTG; | ||
243 | otg_resources[1].end = MX35_INT_USB_OTG; | ||
244 | mxc_usbh1_resources[0].start = MX35_USB_HS_BASE_ADDR; | ||
245 | mxc_usbh1_resources[0].end = MX35_USB_HS_BASE_ADDR + 0x1ff; | ||
246 | mxc_usbh1_resources[1].start = MX35_INT_USB_HS; | ||
247 | mxc_usbh1_resources[1].end = MX35_INT_USB_HS; | ||
248 | imx_wdt_resources[0].start = MX35_WDOG_BASE_ADDR; | 159 | imx_wdt_resources[0].start = MX35_WDOG_BASE_ADDR; |
249 | imx_wdt_resources[0].end = MX35_WDOG_BASE_ADDR + 0x3fff; | 160 | imx_wdt_resources[0].end = MX35_WDOG_BASE_ADDR + 0x3fff; |
250 | } | 161 | } |
diff --git a/arch/arm/mach-mx3/devices.h b/arch/arm/mach-mx3/devices.h index eb3b990f60ff..1bc2918ba04c 100644 --- a/arch/arm/mach-mx3/devices.h +++ b/arch/arm/mach-mx3/devices.h | |||
@@ -1,9 +1,6 @@ | |||
1 | extern struct platform_device mx3_ipu; | 1 | extern struct platform_device mx3_ipu; |
2 | extern struct platform_device mx3_fb; | 2 | extern struct platform_device mx3_fb; |
3 | extern struct platform_device mx3_camera; | 3 | extern struct platform_device mx3_camera; |
4 | extern struct platform_device mxc_otg_host; | ||
5 | extern struct platform_device mxc_usbh1; | ||
6 | extern struct platform_device mxc_usbh2; | ||
7 | extern struct platform_device imx_wdt_device0; | 4 | extern struct platform_device imx_wdt_device0; |
8 | extern struct platform_device imx_rtc_device0; | 5 | extern struct platform_device imx_rtc_device0; |
9 | extern struct platform_device imx_kpp_device; | 6 | extern struct platform_device imx_kpp_device; |
diff --git a/arch/arm/mach-mx3/mach-armadillo5x0.c b/arch/arm/mach-mx3/mach-armadillo5x0.c index e48072cb9bf6..28b6f414b5d5 100644 --- a/arch/arm/mach-mx3/mach-armadillo5x0.c +++ b/arch/arm/mach-mx3/mach-armadillo5x0.c | |||
@@ -51,7 +51,6 @@ | |||
51 | #include <mach/iomux-mx3.h> | 51 | #include <mach/iomux-mx3.h> |
52 | #include <mach/ipu.h> | 52 | #include <mach/ipu.h> |
53 | #include <mach/mx3fb.h> | 53 | #include <mach/mx3fb.h> |
54 | #include <mach/mxc_ehci.h> | ||
55 | #include <mach/ulpi.h> | 54 | #include <mach/ulpi.h> |
56 | 55 | ||
57 | #include "devices-imx31.h" | 56 | #include "devices-imx31.h" |
@@ -244,13 +243,13 @@ h2_free_cs: | |||
244 | return err; | 243 | return err; |
245 | } | 244 | } |
246 | 245 | ||
247 | static struct mxc_usbh_platform_data usbotg_pdata = { | 246 | static struct mxc_usbh_platform_data usbotg_pdata __initdata = { |
248 | .init = usbotg_init, | 247 | .init = usbotg_init, |
249 | .portsc = MXC_EHCI_MODE_ULPI | MXC_EHCI_UTMI_8BIT, | 248 | .portsc = MXC_EHCI_MODE_ULPI | MXC_EHCI_UTMI_8BIT, |
250 | .flags = MXC_EHCI_POWER_PINS_ENABLED | MXC_EHCI_INTERFACE_DIFF_UNI, | 249 | .flags = MXC_EHCI_POWER_PINS_ENABLED | MXC_EHCI_INTERFACE_DIFF_UNI, |
251 | }; | 250 | }; |
252 | 251 | ||
253 | static struct mxc_usbh_platform_data usbh2_pdata = { | 252 | static struct mxc_usbh_platform_data usbh2_pdata __initdata = { |
254 | .init = usbh2_init, | 253 | .init = usbh2_init, |
255 | .portsc = MXC_EHCI_MODE_ULPI | MXC_EHCI_UTMI_8BIT, | 254 | .portsc = MXC_EHCI_MODE_ULPI | MXC_EHCI_UTMI_8BIT, |
256 | .flags = MXC_EHCI_POWER_PINS_ENABLED | MXC_EHCI_INTERFACE_DIFF_UNI, | 255 | .flags = MXC_EHCI_POWER_PINS_ENABLED | MXC_EHCI_INTERFACE_DIFF_UNI, |
@@ -554,8 +553,8 @@ static void __init armadillo5x0_init(void) | |||
554 | usbh2_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops, | 553 | usbh2_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops, |
555 | ULPI_OTG_DRVVBUS | ULPI_OTG_DRVVBUS_EXT); | 554 | ULPI_OTG_DRVVBUS | ULPI_OTG_DRVVBUS_EXT); |
556 | 555 | ||
557 | mxc_register_device(&mxc_otg_host, &usbotg_pdata); | 556 | imx31_add_mxc_ehci_otg(&usbotg_pdata); |
558 | mxc_register_device(&mxc_usbh2, &usbh2_pdata); | 557 | imx31_add_mxc_ehci_hs(2, &usbh2_pdata); |
559 | #endif | 558 | #endif |
560 | } | 559 | } |
561 | 560 | ||
diff --git a/arch/arm/mach-mx3/mach-cpuimx35.c b/arch/arm/mach-mx3/mach-cpuimx35.c index b8b619a0e07c..0af1e84d8f9d 100644 --- a/arch/arm/mach-mx3/mach-cpuimx35.c +++ b/arch/arm/mach-mx3/mach-cpuimx35.c | |||
@@ -42,7 +42,6 @@ | |||
42 | #include <mach/common.h> | 42 | #include <mach/common.h> |
43 | #include <mach/iomux-mx35.h> | 43 | #include <mach/iomux-mx35.h> |
44 | #include <mach/mxc_nand.h> | 44 | #include <mach/mxc_nand.h> |
45 | #include <mach/mxc_ehci.h> | ||
46 | 45 | ||
47 | #include "devices-imx35.h" | 46 | #include "devices-imx35.h" |
48 | #include "devices.h" | 47 | #include "devices.h" |
@@ -116,12 +115,12 @@ static const struct mxc_nand_platform_data | |||
116 | .flash_bbt = 1, | 115 | .flash_bbt = 1, |
117 | }; | 116 | }; |
118 | 117 | ||
119 | static struct mxc_usbh_platform_data __maybe_unused otg_pdata = { | 118 | static const struct mxc_usbh_platform_data otg_pdata __initconst = { |
120 | .portsc = MXC_EHCI_MODE_UTMI, | 119 | .portsc = MXC_EHCI_MODE_UTMI, |
121 | .flags = MXC_EHCI_INTERFACE_DIFF_UNI, | 120 | .flags = MXC_EHCI_INTERFACE_DIFF_UNI, |
122 | }; | 121 | }; |
123 | 122 | ||
124 | static struct mxc_usbh_platform_data __maybe_unused usbh1_pdata = { | 123 | static const struct mxc_usbh_platform_data usbh1_pdata __initconst = { |
125 | .portsc = MXC_EHCI_MODE_SERIAL, | 124 | .portsc = MXC_EHCI_MODE_SERIAL, |
126 | .flags = MXC_EHCI_INTERFACE_SINGLE_UNI | MXC_EHCI_INTERNAL_PHY | | 125 | .flags = MXC_EHCI_INTERFACE_SINGLE_UNI | MXC_EHCI_INTERNAL_PHY | |
127 | MXC_EHCI_IPPUE_DOWN, | 126 | MXC_EHCI_IPPUE_DOWN, |
@@ -167,11 +166,11 @@ static void __init mxc_board_init(void) | |||
167 | imx35_add_imx_i2c0(&eukrea_cpuimx35_i2c0_data); | 166 | imx35_add_imx_i2c0(&eukrea_cpuimx35_i2c0_data); |
168 | 167 | ||
169 | if (otg_mode_host) | 168 | if (otg_mode_host) |
170 | mxc_register_device(&mxc_otg_host, &otg_pdata); | 169 | imx35_add_mxc_ehci_otg(&otg_pdata); |
171 | else | 170 | else |
172 | imx35_add_fsl_usb2_udc(&otg_device_pdata); | 171 | imx35_add_fsl_usb2_udc(&otg_device_pdata); |
173 | 172 | ||
174 | mxc_register_device(&mxc_usbh1, &usbh1_pdata); | 173 | imx35_add_mxc_ehci_hs(&usbh1_pdata); |
175 | 174 | ||
176 | #ifdef CONFIG_MACH_EUKREA_MBIMXSD35_BASEBOARD | 175 | #ifdef CONFIG_MACH_EUKREA_MBIMXSD35_BASEBOARD |
177 | eukrea_mbimxsd35_baseboard_init(); | 176 | eukrea_mbimxsd35_baseboard_init(); |
diff --git a/arch/arm/mach-mx3/mach-mx31lilly.c b/arch/arm/mach-mx3/mach-mx31lilly.c index 42f47faa6fd6..2c595483f356 100644 --- a/arch/arm/mach-mx3/mach-mx31lilly.c +++ b/arch/arm/mach-mx3/mach-mx31lilly.c | |||
@@ -42,7 +42,6 @@ | |||
42 | #include <mach/common.h> | 42 | #include <mach/common.h> |
43 | #include <mach/iomux-mx3.h> | 43 | #include <mach/iomux-mx3.h> |
44 | #include <mach/board-mx31lilly.h> | 44 | #include <mach/board-mx31lilly.h> |
45 | #include <mach/mxc_ehci.h> | ||
46 | #include <mach/ulpi.h> | 45 | #include <mach/ulpi.h> |
47 | 46 | ||
48 | #include "devices-imx31.h" | 47 | #include "devices-imx31.h" |
@@ -230,13 +229,13 @@ static struct mxc_usbh_platform_data usbotg_pdata = { | |||
230 | .flags = MXC_EHCI_POWER_PINS_ENABLED, | 229 | .flags = MXC_EHCI_POWER_PINS_ENABLED, |
231 | }; | 230 | }; |
232 | 231 | ||
233 | static struct mxc_usbh_platform_data usbh1_pdata = { | 232 | static const struct mxc_usbh_platform_data usbh1_pdata __initconst = { |
234 | .init = usbh1_init, | 233 | .init = usbh1_init, |
235 | .portsc = MXC_EHCI_MODE_UTMI | MXC_EHCI_SERIAL, | 234 | .portsc = MXC_EHCI_MODE_UTMI | MXC_EHCI_SERIAL, |
236 | .flags = MXC_EHCI_POWER_PINS_ENABLED | MXC_EHCI_INTERFACE_SINGLE_UNI, | 235 | .flags = MXC_EHCI_POWER_PINS_ENABLED | MXC_EHCI_INTERFACE_SINGLE_UNI, |
237 | }; | 236 | }; |
238 | 237 | ||
239 | static struct mxc_usbh_platform_data usbh2_pdata = { | 238 | static struct mxc_usbh_platform_data usbh2_pdata __initdata = { |
240 | .init = usbh2_init, | 239 | .init = usbh2_init, |
241 | .portsc = MXC_EHCI_MODE_ULPI | MXC_EHCI_UTMI_8BIT, | 240 | .portsc = MXC_EHCI_MODE_ULPI | MXC_EHCI_UTMI_8BIT, |
242 | .flags = MXC_EHCI_POWER_PINS_ENABLED, | 241 | .flags = MXC_EHCI_POWER_PINS_ENABLED, |
@@ -249,8 +248,8 @@ static void lilly1131_usb_init(void) | |||
249 | usbh2_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops, | 248 | usbh2_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops, |
250 | ULPI_OTG_DRVVBUS | ULPI_OTG_DRVVBUS_EXT); | 249 | ULPI_OTG_DRVVBUS | ULPI_OTG_DRVVBUS_EXT); |
251 | 250 | ||
252 | mxc_register_device(&mxc_usbh1, &usbh1_pdata); | 251 | imx31_add_mxc_ehci_hs(1, &usbh1_pdata); |
253 | mxc_register_device(&mxc_usbh2, &usbh2_pdata); | 252 | imx31_add_mxc_ehci_hs(2, &usbh2_pdata); |
254 | } | 253 | } |
255 | 254 | ||
256 | #else | 255 | #else |
diff --git a/arch/arm/mach-mx3/mach-mx31lite.c b/arch/arm/mach-mx3/mach-mx31lite.c index b93895814cdf..9e64c66396e0 100644 --- a/arch/arm/mach-mx3/mach-mx31lite.c +++ b/arch/arm/mach-mx3/mach-mx31lite.c | |||
@@ -40,7 +40,6 @@ | |||
40 | #include <mach/board-mx31lite.h> | 40 | #include <mach/board-mx31lite.h> |
41 | #include <mach/iomux-mx3.h> | 41 | #include <mach/iomux-mx3.h> |
42 | #include <mach/irqs.h> | 42 | #include <mach/irqs.h> |
43 | #include <mach/mxc_ehci.h> | ||
44 | #include <mach/ulpi.h> | 43 | #include <mach/ulpi.h> |
45 | 44 | ||
46 | #include "devices-imx31.h" | 45 | #include "devices-imx31.h" |
@@ -171,7 +170,7 @@ static int usbh2_init(struct platform_device *pdev) | |||
171 | return 0; | 170 | return 0; |
172 | } | 171 | } |
173 | 172 | ||
174 | static struct mxc_usbh_platform_data usbh2_pdata = { | 173 | static struct mxc_usbh_platform_data usbh2_pdata __initdata = { |
175 | .init = usbh2_init, | 174 | .init = usbh2_init, |
176 | .portsc = MXC_EHCI_MODE_ULPI | MXC_EHCI_UTMI_8BIT, | 175 | .portsc = MXC_EHCI_MODE_ULPI | MXC_EHCI_UTMI_8BIT, |
177 | .flags = MXC_EHCI_POWER_PINS_ENABLED, | 176 | .flags = MXC_EHCI_POWER_PINS_ENABLED, |
@@ -258,7 +257,7 @@ static void __init mxc_board_init(void) | |||
258 | usbh2_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops, | 257 | usbh2_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops, |
259 | ULPI_OTG_DRVVBUS | ULPI_OTG_DRVVBUS_EXT); | 258 | ULPI_OTG_DRVVBUS | ULPI_OTG_DRVVBUS_EXT); |
260 | 259 | ||
261 | mxc_register_device(&mxc_usbh2, &usbh2_pdata); | 260 | imx31_add_mxc_ehci_hs(2, &usbh2_pdata); |
262 | #endif | 261 | #endif |
263 | 262 | ||
264 | /* SMSC9117 IRQ pin */ | 263 | /* SMSC9117 IRQ pin */ |
diff --git a/arch/arm/mach-mx3/mach-mx31moboard.c b/arch/arm/mach-mx3/mach-mx31moboard.c index 5e2ee85aadf9..203d21a510aa 100644 --- a/arch/arm/mach-mx3/mach-mx31moboard.c +++ b/arch/arm/mach-mx3/mach-mx31moboard.c | |||
@@ -40,7 +40,6 @@ | |||
40 | #include <mach/hardware.h> | 40 | #include <mach/hardware.h> |
41 | #include <mach/iomux-mx3.h> | 41 | #include <mach/iomux-mx3.h> |
42 | #include <mach/ipu.h> | 42 | #include <mach/ipu.h> |
43 | #include <mach/mxc_ehci.h> | ||
44 | #include <mach/mx3_camera.h> | 43 | #include <mach/mx3_camera.h> |
45 | #include <mach/spi.h> | 44 | #include <mach/spi.h> |
46 | #include <mach/ulpi.h> | 45 | #include <mach/ulpi.h> |
@@ -403,17 +402,23 @@ static void usb_xcvr_reset(void) | |||
403 | 402 | ||
404 | #if defined(CONFIG_USB_ULPI) | 403 | #if defined(CONFIG_USB_ULPI) |
405 | 404 | ||
406 | static struct mxc_usbh_platform_data usbh2_pdata = { | 405 | static struct mxc_usbh_platform_data usbh2_pdata __initdata = { |
407 | .portsc = MXC_EHCI_MODE_ULPI | MXC_EHCI_UTMI_8BIT, | 406 | .portsc = MXC_EHCI_MODE_ULPI | MXC_EHCI_UTMI_8BIT, |
408 | .flags = MXC_EHCI_POWER_PINS_ENABLED, | 407 | .flags = MXC_EHCI_POWER_PINS_ENABLED, |
409 | }; | 408 | }; |
410 | 409 | ||
411 | static int __init moboard_usbh2_init(void) | 410 | static int __init moboard_usbh2_init(void) |
412 | { | 411 | { |
412 | struct platform_device *pdev; | ||
413 | |||
413 | usbh2_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops, | 414 | usbh2_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops, |
414 | ULPI_OTG_DRVVBUS | ULPI_OTG_DRVVBUS_EXT); | 415 | ULPI_OTG_DRVVBUS | ULPI_OTG_DRVVBUS_EXT); |
415 | 416 | ||
416 | return mxc_register_device(&mxc_usbh2, &usbh2_pdata); | 417 | pdev = imx31_add_mxc_ehci_hs(2, &usbh2_pdata); |
418 | if (IS_ERR(pdev)) | ||
419 | return PTR_ERR(pdev); | ||
420 | |||
421 | return 0; | ||
417 | } | 422 | } |
418 | #else | 423 | #else |
419 | static inline int moboard_usbh2_init(void) { return 0; } | 424 | static inline int moboard_usbh2_init(void) { return 0; } |
diff --git a/arch/arm/mach-mx3/mach-mx35_3ds.c b/arch/arm/mach-mx3/mach-mx35_3ds.c index 6dfdf1746c76..73fb1157e56d 100644 --- a/arch/arm/mach-mx3/mach-mx35_3ds.c +++ b/arch/arm/mach-mx3/mach-mx35_3ds.c | |||
@@ -39,7 +39,6 @@ | |||
39 | #include <mach/iomux-mx35.h> | 39 | #include <mach/iomux-mx35.h> |
40 | #include <mach/irqs.h> | 40 | #include <mach/irqs.h> |
41 | #include <mach/3ds_debugboard.h> | 41 | #include <mach/3ds_debugboard.h> |
42 | #include <mach/mxc_ehci.h> | ||
43 | 42 | ||
44 | #include "devices-imx35.h" | 43 | #include "devices-imx35.h" |
45 | #include "devices.h" | 44 | #include "devices.h" |
@@ -127,7 +126,7 @@ static const struct fsl_usb2_platform_data usb_otg_pdata __initconst = { | |||
127 | }; | 126 | }; |
128 | 127 | ||
129 | /* USB HOST config */ | 128 | /* USB HOST config */ |
130 | static struct mxc_usbh_platform_data usb_host_pdata = { | 129 | static const struct mxc_usbh_platform_data usb_host_pdata __initconst = { |
131 | .portsc = MXC_EHCI_MODE_SERIAL, | 130 | .portsc = MXC_EHCI_MODE_SERIAL, |
132 | .flags = MXC_EHCI_INTERFACE_SINGLE_UNI | | 131 | .flags = MXC_EHCI_INTERFACE_SINGLE_UNI | |
133 | MXC_EHCI_INTERNAL_PHY, | 132 | MXC_EHCI_INTERNAL_PHY, |
@@ -147,7 +146,7 @@ static void __init mxc_board_init(void) | |||
147 | 146 | ||
148 | imx35_add_fsl_usb2_udc(&usb_otg_pdata); | 147 | imx35_add_fsl_usb2_udc(&usb_otg_pdata); |
149 | 148 | ||
150 | mxc_register_device(&mxc_usbh1, &usb_host_pdata); | 149 | imx35_add_mxc_ehci_hs(&usb_host_pdata); |
151 | 150 | ||
152 | imx35_add_mxc_nand(&mx35pdk_nand_board_info); | 151 | imx35_add_mxc_nand(&mx35pdk_nand_board_info); |
153 | imx35_add_esdhc(0, NULL); | 152 | imx35_add_esdhc(0, NULL); |
diff --git a/arch/arm/mach-mx3/mach-pcm037.c b/arch/arm/mach-mx3/mach-pcm037.c index 20f7f9485dc6..2d297436820b 100644 --- a/arch/arm/mach-mx3/mach-pcm037.c +++ b/arch/arm/mach-mx3/mach-pcm037.c | |||
@@ -44,7 +44,6 @@ | |||
44 | #include <mach/ipu.h> | 44 | #include <mach/ipu.h> |
45 | #include <mach/mx3_camera.h> | 45 | #include <mach/mx3_camera.h> |
46 | #include <mach/mx3fb.h> | 46 | #include <mach/mx3fb.h> |
47 | #include <mach/mxc_ehci.h> | ||
48 | #include <mach/ulpi.h> | 47 | #include <mach/ulpi.h> |
49 | 48 | ||
50 | #include "devices-imx31.h" | 49 | #include "devices-imx31.h" |
@@ -538,12 +537,12 @@ static struct platform_device pcm970_sja1000 = { | |||
538 | }; | 537 | }; |
539 | 538 | ||
540 | #if defined(CONFIG_USB_ULPI) | 539 | #if defined(CONFIG_USB_ULPI) |
541 | static struct mxc_usbh_platform_data otg_pdata = { | 540 | static struct mxc_usbh_platform_data otg_pdata __initdata = { |
542 | .portsc = MXC_EHCI_MODE_ULPI, | 541 | .portsc = MXC_EHCI_MODE_ULPI, |
543 | .flags = MXC_EHCI_INTERFACE_DIFF_UNI, | 542 | .flags = MXC_EHCI_INTERFACE_DIFF_UNI, |
544 | }; | 543 | }; |
545 | 544 | ||
546 | static struct mxc_usbh_platform_data usbh2_pdata = { | 545 | static struct mxc_usbh_platform_data usbh2_pdata __initdata = { |
547 | .portsc = MXC_EHCI_MODE_ULPI, | 546 | .portsc = MXC_EHCI_MODE_ULPI, |
548 | .flags = MXC_EHCI_INTERFACE_DIFF_UNI, | 547 | .flags = MXC_EHCI_INTERFACE_DIFF_UNI, |
549 | }; | 548 | }; |
@@ -654,13 +653,13 @@ static void __init mxc_board_init(void) | |||
654 | otg_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops, | 653 | otg_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops, |
655 | ULPI_OTG_DRVVBUS | ULPI_OTG_DRVVBUS_EXT); | 654 | ULPI_OTG_DRVVBUS | ULPI_OTG_DRVVBUS_EXT); |
656 | 655 | ||
657 | mxc_register_device(&mxc_otg_host, &otg_pdata); | 656 | imx31_add_mxc_ehci_otg(&otg_pdata); |
658 | } | 657 | } |
659 | 658 | ||
660 | usbh2_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops, | 659 | usbh2_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops, |
661 | ULPI_OTG_DRVVBUS | ULPI_OTG_DRVVBUS_EXT); | 660 | ULPI_OTG_DRVVBUS | ULPI_OTG_DRVVBUS_EXT); |
662 | 661 | ||
663 | mxc_register_device(&mxc_usbh2, &usbh2_pdata); | 662 | imx31_add_mxc_ehci_hs(2, &usbh2_pdata); |
664 | #endif | 663 | #endif |
665 | if (!otg_mode_host) | 664 | if (!otg_mode_host) |
666 | imx31_add_fsl_usb2_udc(&otg_device_pdata); | 665 | imx31_add_fsl_usb2_udc(&otg_device_pdata); |
diff --git a/arch/arm/mach-mx3/mach-pcm043.c b/arch/arm/mach-mx3/mach-pcm043.c index 78159f073a41..f9e7da98b107 100644 --- a/arch/arm/mach-mx3/mach-pcm043.c +++ b/arch/arm/mach-mx3/mach-pcm043.c | |||
@@ -38,7 +38,6 @@ | |||
38 | #include <mach/iomux-mx35.h> | 38 | #include <mach/iomux-mx35.h> |
39 | #include <mach/ipu.h> | 39 | #include <mach/ipu.h> |
40 | #include <mach/mx3fb.h> | 40 | #include <mach/mx3fb.h> |
41 | #include <mach/mxc_ehci.h> | ||
42 | #include <mach/ulpi.h> | 41 | #include <mach/ulpi.h> |
43 | #include <mach/audmux.h> | 42 | #include <mach/audmux.h> |
44 | 43 | ||
@@ -310,12 +309,12 @@ pcm037_nand_board_info __initconst = { | |||
310 | }; | 309 | }; |
311 | 310 | ||
312 | #if defined(CONFIG_USB_ULPI) | 311 | #if defined(CONFIG_USB_ULPI) |
313 | static struct mxc_usbh_platform_data otg_pdata = { | 312 | static struct mxc_usbh_platform_data otg_pdata __initdata = { |
314 | .portsc = MXC_EHCI_MODE_UTMI, | 313 | .portsc = MXC_EHCI_MODE_UTMI, |
315 | .flags = MXC_EHCI_INTERFACE_DIFF_UNI, | 314 | .flags = MXC_EHCI_INTERFACE_DIFF_UNI, |
316 | }; | 315 | }; |
317 | 316 | ||
318 | static struct mxc_usbh_platform_data usbh1_pdata = { | 317 | static const struct mxc_usbh_platform_data usbh1_pdata __initconst = { |
319 | .portsc = MXC_EHCI_MODE_SERIAL, | 318 | .portsc = MXC_EHCI_MODE_SERIAL, |
320 | .flags = MXC_EHCI_INTERFACE_SINGLE_UNI | MXC_EHCI_INTERNAL_PHY | | 319 | .flags = MXC_EHCI_INTERFACE_SINGLE_UNI | MXC_EHCI_INTERNAL_PHY | |
321 | MXC_EHCI_IPPUE_DOWN, | 320 | MXC_EHCI_IPPUE_DOWN, |
@@ -385,10 +384,10 @@ static void __init mxc_board_init(void) | |||
385 | otg_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops, | 384 | otg_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops, |
386 | ULPI_OTG_DRVVBUS | ULPI_OTG_DRVVBUS_EXT); | 385 | ULPI_OTG_DRVVBUS | ULPI_OTG_DRVVBUS_EXT); |
387 | 386 | ||
388 | mxc_register_device(&mxc_otg_host, &otg_pdata); | 387 | imx35_add_mxc_ehci_otg(&otg_pdata); |
389 | } | 388 | } |
390 | 389 | ||
391 | mxc_register_device(&mxc_usbh1, &usbh1_pdata); | 390 | imx35_add_mxc_ehci_hs(&usbh1_pdata); |
392 | #endif | 391 | #endif |
393 | if (!otg_mode_host) | 392 | if (!otg_mode_host) |
394 | imx35_add_fsl_usb2_udc(&otg_device_pdata); | 393 | imx35_add_fsl_usb2_udc(&otg_device_pdata); |
diff --git a/arch/arm/mach-mx3/mx31moboard-devboard.c b/arch/arm/mach-mx3/mx31moboard-devboard.c index 331b5950c7a0..94a0b9e4b7f3 100644 --- a/arch/arm/mach-mx3/mx31moboard-devboard.c +++ b/arch/arm/mach-mx3/mx31moboard-devboard.c | |||
@@ -24,7 +24,6 @@ | |||
24 | #include <mach/common.h> | 24 | #include <mach/common.h> |
25 | #include <mach/iomux-mx3.h> | 25 | #include <mach/iomux-mx3.h> |
26 | #include <mach/hardware.h> | 26 | #include <mach/hardware.h> |
27 | #include <mach/mxc_ehci.h> | ||
28 | #include <mach/ulpi.h> | 27 | #include <mach/ulpi.h> |
29 | 28 | ||
30 | #include "devices-imx31.h" | 29 | #include "devices-imx31.h" |
@@ -185,7 +184,7 @@ static int devboard_isp1105_set_vbus(struct otg_transceiver *otg, bool on) | |||
185 | return 0; | 184 | return 0; |
186 | } | 185 | } |
187 | 186 | ||
188 | static struct mxc_usbh_platform_data usbh1_pdata = { | 187 | static struct mxc_usbh_platform_data usbh1_pdata __initdata = { |
189 | .init = devboard_usbh1_hw_init, | 188 | .init = devboard_usbh1_hw_init, |
190 | .portsc = MXC_EHCI_MODE_UTMI | MXC_EHCI_SERIAL, | 189 | .portsc = MXC_EHCI_MODE_UTMI | MXC_EHCI_SERIAL, |
191 | .flags = MXC_EHCI_POWER_PINS_ENABLED | MXC_EHCI_INTERFACE_SINGLE_UNI, | 190 | .flags = MXC_EHCI_POWER_PINS_ENABLED | MXC_EHCI_INTERFACE_SINGLE_UNI, |
@@ -194,6 +193,7 @@ static struct mxc_usbh_platform_data usbh1_pdata = { | |||
194 | static int __init devboard_usbh1_init(void) | 193 | static int __init devboard_usbh1_init(void) |
195 | { | 194 | { |
196 | struct otg_transceiver *otg; | 195 | struct otg_transceiver *otg; |
196 | struct platform_device *pdev; | ||
197 | 197 | ||
198 | otg = kzalloc(sizeof(*otg), GFP_KERNEL); | 198 | otg = kzalloc(sizeof(*otg), GFP_KERNEL); |
199 | if (!otg) | 199 | if (!otg) |
@@ -205,7 +205,11 @@ static int __init devboard_usbh1_init(void) | |||
205 | 205 | ||
206 | usbh1_pdata.otg = otg; | 206 | usbh1_pdata.otg = otg; |
207 | 207 | ||
208 | return mxc_register_device(&mxc_usbh1, &usbh1_pdata); | 208 | pdev = imx31_add_mxc_ehci_hs(1, &usbh1_pdata); |
209 | if (IS_ERR(pdev)) | ||
210 | return PTR_ERR(pdev); | ||
211 | |||
212 | return 0; | ||
209 | } | 213 | } |
210 | 214 | ||
211 | 215 | ||
diff --git a/arch/arm/mach-mx3/mx31moboard-marxbot.c b/arch/arm/mach-mx3/mx31moboard-marxbot.c index db79f744c301..a35e8c9a0a02 100644 --- a/arch/arm/mach-mx3/mx31moboard-marxbot.c +++ b/arch/arm/mach-mx3/mx31moboard-marxbot.c | |||
@@ -28,7 +28,6 @@ | |||
28 | #include <mach/hardware.h> | 28 | #include <mach/hardware.h> |
29 | #include <mach/imx-uart.h> | 29 | #include <mach/imx-uart.h> |
30 | #include <mach/iomux-mx3.h> | 30 | #include <mach/iomux-mx3.h> |
31 | #include <mach/mxc_ehci.h> | ||
32 | #include <mach/ulpi.h> | 31 | #include <mach/ulpi.h> |
33 | 32 | ||
34 | #include <media/soc_camera.h> | 33 | #include <media/soc_camera.h> |
@@ -302,7 +301,7 @@ static int marxbot_isp1105_set_vbus(struct otg_transceiver *otg, bool on) | |||
302 | return 0; | 301 | return 0; |
303 | } | 302 | } |
304 | 303 | ||
305 | static struct mxc_usbh_platform_data usbh1_pdata = { | 304 | static struct mxc_usbh_platform_data usbh1_pdata __initdata = { |
306 | .init = marxbot_usbh1_hw_init, | 305 | .init = marxbot_usbh1_hw_init, |
307 | .portsc = MXC_EHCI_MODE_UTMI | MXC_EHCI_SERIAL, | 306 | .portsc = MXC_EHCI_MODE_UTMI | MXC_EHCI_SERIAL, |
308 | .flags = MXC_EHCI_POWER_PINS_ENABLED | MXC_EHCI_INTERFACE_SINGLE_UNI, | 307 | .flags = MXC_EHCI_POWER_PINS_ENABLED | MXC_EHCI_INTERFACE_SINGLE_UNI, |
@@ -311,6 +310,7 @@ static struct mxc_usbh_platform_data usbh1_pdata = { | |||
311 | static int __init marxbot_usbh1_init(void) | 310 | static int __init marxbot_usbh1_init(void) |
312 | { | 311 | { |
313 | struct otg_transceiver *otg; | 312 | struct otg_transceiver *otg; |
313 | struct platform_device *pdev; | ||
314 | 314 | ||
315 | otg = kzalloc(sizeof(*otg), GFP_KERNEL); | 315 | otg = kzalloc(sizeof(*otg), GFP_KERNEL); |
316 | if (!otg) | 316 | if (!otg) |
@@ -322,7 +322,11 @@ static int __init marxbot_usbh1_init(void) | |||
322 | 322 | ||
323 | usbh1_pdata.otg = otg; | 323 | usbh1_pdata.otg = otg; |
324 | 324 | ||
325 | return mxc_register_device(&mxc_usbh1, &usbh1_pdata); | 325 | pdev = imx31_add_mxc_ehci_hs(1, &usbh1_pdata); |
326 | if (IS_ERR(pdev)) | ||
327 | return PTR_ERR(pdev); | ||
328 | |||
329 | return 0; | ||
326 | } | 330 | } |
327 | 331 | ||
328 | static const struct fsl_usb2_platform_data usb_pdata __initconst = { | 332 | static const struct fsl_usb2_platform_data usb_pdata __initconst = { |
diff --git a/arch/arm/mach-mx3/mx31moboard-smartbot.c b/arch/arm/mach-mx3/mx31moboard-smartbot.c index 68e8ab55f4c7..8e989e5b3af6 100644 --- a/arch/arm/mach-mx3/mx31moboard-smartbot.c +++ b/arch/arm/mach-mx3/mx31moboard-smartbot.c | |||
@@ -27,7 +27,6 @@ | |||
27 | #include <mach/hardware.h> | 27 | #include <mach/hardware.h> |
28 | #include <mach/iomux-mx3.h> | 28 | #include <mach/iomux-mx3.h> |
29 | #include <mach/board-mx31moboard.h> | 29 | #include <mach/board-mx31moboard.h> |
30 | #include <mach/mxc_ehci.h> | ||
31 | #include <mach/ulpi.h> | 30 | #include <mach/ulpi.h> |
32 | 31 | ||
33 | #include <media/soc_camera.h> | 32 | #include <media/soc_camera.h> |
@@ -125,17 +124,23 @@ static const struct fsl_usb2_platform_data usb_pdata __initconst = { | |||
125 | 124 | ||
126 | #if defined(CONFIG_USB_ULPI) | 125 | #if defined(CONFIG_USB_ULPI) |
127 | 126 | ||
128 | static struct mxc_usbh_platform_data otg_host_pdata = { | 127 | static struct mxc_usbh_platform_data otg_host_pdata __initdata = { |
129 | .portsc = MXC_EHCI_MODE_ULPI | MXC_EHCI_UTMI_8BIT, | 128 | .portsc = MXC_EHCI_MODE_ULPI | MXC_EHCI_UTMI_8BIT, |
130 | .flags = MXC_EHCI_POWER_PINS_ENABLED, | 129 | .flags = MXC_EHCI_POWER_PINS_ENABLED, |
131 | }; | 130 | }; |
132 | 131 | ||
133 | static int __init smartbot_otg_host_init(void) | 132 | static int __init smartbot_otg_host_init(void) |
134 | { | 133 | { |
134 | struct platform_device *pdev; | ||
135 | |||
135 | otg_host_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops, | 136 | otg_host_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops, |
136 | ULPI_OTG_DRVVBUS | ULPI_OTG_DRVVBUS_EXT); | 137 | ULPI_OTG_DRVVBUS | ULPI_OTG_DRVVBUS_EXT); |
137 | 138 | ||
138 | return mxc_register_device(&mxc_otg_host, &otg_host_pdata); | 139 | pdev = imx31_add_mxc_ehci_otg(&otg_host_pdata); |
140 | if (IS_ERR(pdev)) | ||
141 | return PTR_ERR(pdev); | ||
142 | |||
143 | return 0; | ||
139 | } | 144 | } |
140 | #else | 145 | #else |
141 | static inline int smartbot_otg_host_init(void) { return 0; } | 146 | static inline int smartbot_otg_host_init(void) { return 0; } |
diff --git a/arch/arm/plat-mxc/devices/platform-mxc-ehci.c b/arch/arm/plat-mxc/devices/platform-mxc-ehci.c index 9bec63ff256a..cc488f4b6204 100644 --- a/arch/arm/plat-mxc/devices/platform-mxc-ehci.c +++ b/arch/arm/plat-mxc/devices/platform-mxc-ehci.c | |||
@@ -32,6 +32,22 @@ const struct imx_mxc_ehci_data imx27_mxc_ehci_hs_data[] __initconst = { | |||
32 | }; | 32 | }; |
33 | #endif /* ifdef CONFIG_SOC_IMX27 */ | 33 | #endif /* ifdef CONFIG_SOC_IMX27 */ |
34 | 34 | ||
35 | #ifdef CONFIG_SOC_IMX31 | ||
36 | const struct imx_mxc_ehci_data imx31_mxc_ehci_otg_data __initconst = | ||
37 | imx_mxc_ehci_data_entry_single(MX31, 0, OTG); | ||
38 | const struct imx_mxc_ehci_data imx31_mxc_ehci_hs_data[] __initconst = { | ||
39 | imx_mxc_ehci_data_entry_single(MX31, 1, HS1), | ||
40 | imx_mxc_ehci_data_entry_single(MX31, 2, HS2), | ||
41 | }; | ||
42 | #endif /* ifdef CONFIG_SOC_IMX31 */ | ||
43 | |||
44 | #ifdef CONFIG_SOC_IMX35 | ||
45 | const struct imx_mxc_ehci_data imx35_mxc_ehci_otg_data __initconst = | ||
46 | imx_mxc_ehci_data_entry_single(MX35, 0, OTG); | ||
47 | const struct imx_mxc_ehci_data imx35_mxc_ehci_hs_data __initconst = | ||
48 | imx_mxc_ehci_data_entry_single(MX35, 1, HS); | ||
49 | #endif /* ifdef CONFIG_SOC_IMX35 */ | ||
50 | |||
35 | struct platform_device *__init imx_add_mxc_ehci( | 51 | struct platform_device *__init imx_add_mxc_ehci( |
36 | const struct imx_mxc_ehci_data *data, | 52 | const struct imx_mxc_ehci_data *data, |
37 | const struct mxc_usbh_platform_data *pdata) | 53 | const struct mxc_usbh_platform_data *pdata) |