]> git.openfabrics.org - ~emulex/infiniband.git/commitdiff
ARM: mx25: dynamically allocate fsl-usb2-udc devices
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Wed, 10 Nov 2010 20:50:07 +0000 (21:50 +0100)
committerUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Wed, 17 Nov 2010 09:01:37 +0000 (10:01 +0100)
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
arch/arm/mach-mx25/Kconfig
arch/arm/mach-mx25/devices-imx25.h
arch/arm/mach-mx25/devices.c
arch/arm/mach-mx25/devices.h
arch/arm/mach-mx25/mach-cpuimx25.c
arch/arm/plat-mxc/devices/platform-fsl-usb2-udc.c

index b55585bf93fd6932300482fc9f205f1ca0372fb0..2944bb71b031ffef27dfd652122a62330d2e5119 100644 (file)
@@ -13,6 +13,7 @@ config MACH_EUKREA_CPUIMX25
        bool "Support Eukrea CPUIMX25 Platform"
        select IMX_HAVE_PLATFORM_ESDHC
        select IMX_HAVE_PLATFORM_FLEXCAN
+       select IMX_HAVE_PLATFORM_FSL_USB2_UDC
        select IMX_HAVE_PLATFORM_IMX_I2C
        select IMX_HAVE_PLATFORM_IMX_UART
        select IMX_HAVE_PLATFORM_MXC_EHCI
index ac343ae7fe43cf5681a4b34412bb3bc214c73c7e..448939aac02c0271747fe950dac9bb6080bb3175 100644 (file)
@@ -19,6 +19,10 @@ extern const struct imx_flexcan_data imx25_flexcan_data[] __initconst;
 #define imx25_add_flexcan0(pdata)      imx25_add_flexcan(0, pdata)
 #define imx25_add_flexcan1(pdata)      imx25_add_flexcan(1, pdata)
 
+extern const struct imx_fsl_usb2_udc_data imx25_fsl_usb2_udc_data __initconst;
+#define imx25_add_fsl_usb2_udc(pdata)  \
+       imx_add_fsl_usb2_udc(&imx25_fsl_usb2_udc_data, pdata)
+
 extern const struct imx_imx_i2c_data imx25_imx_i2c_data[] __initconst;
 #define imx25_add_imx_i2c(id, pdata)   \
        imx_add_imx_i2c(&imx25_imx_i2c_data[id], pdata)
index 4611c763ff1747897861ee6b8cb3cb6eb40182bc..27d07ce55ee09e70915895efb53214a1d481e151 100644 (file)
 #include <mach/mx25.h>
 #include <mach/irqs.h>
 
-static u64 otg_dmamask = DMA_BIT_MASK(32);
-
-static struct resource mxc_otg_resources[] = {
-       {
-               .start = MX25_USB_OTG_BASE_ADDR,
-               .end = MX25_USB_OTG_BASE_ADDR + 0x1ff,
-               .flags = IORESOURCE_MEM,
-       }, {
-               .start = MX25_INT_USB_OTG,
-               .end = MX25_INT_USB_OTG,
-               .flags = IORESOURCE_IRQ,
-       },
-};
-
-/* OTG gadget device */
-struct platform_device otg_udc_device = {
-       .name = "fsl-usb2-udc",
-       .id   = -1,
-       .dev  = {
-               .dma_mask          = &otg_dmamask,
-               .coherent_dma_mask = 0xffffffff,
-       },
-       .resource = mxc_otg_resources,
-       .num_resources = ARRAY_SIZE(mxc_otg_resources),
-};
-
 static struct resource mxc_pwm_resources0[] = {
        {
                .start  = 0x53fe0000,
index e6ad64061963cdaf09f445ae41d2b4fd5a3b5ea4..266c305a2ad7783628c751e8e1bb22ab7814410f 100644 (file)
@@ -1,4 +1,3 @@
-extern struct platform_device otg_udc_device;
 extern struct platform_device mxc_pwm_device0;
 extern struct platform_device mxc_pwm_device1;
 extern struct platform_device mxc_pwm_device2;
index 0ee0fe73952d4fbcf4aacb90829645f718bbbdd2..2094bddb3e47681740bff4d27b279a9b13b43134 100644 (file)
@@ -26,7 +26,6 @@
 #include <linux/platform_device.h>
 #include <linux/usb/otg.h>
 #include <linux/usb/ulpi.h>
-#include <linux/fsl_devices.h>
 
 #include <mach/eukrea-baseboards.h>
 #include <mach/hardware.h>
@@ -97,7 +96,7 @@ static const struct mxc_usbh_platform_data usbh2_pdata __initconst = {
                  MXC_EHCI_IPPUE_DOWN,
 };
 
-static struct fsl_usb2_platform_data otg_device_pdata = {
+static const struct fsl_usb2_platform_data otg_device_pdata __initconst = {
        .operating_mode = FSL_USB2_DR_DEVICE,
        .phy_mode       = FSL_USB2_PHY_UTMI,
 };
@@ -135,7 +134,7 @@ static void __init eukrea_cpuimx25_init(void)
        if (otg_mode_host)
                imx25_add_mxc_ehci_otg(&otg_pdata);
        else
-               mxc_register_device(&otg_udc_device, &otg_device_pdata);
+               imx25_add_fsl_usb2_udc(&otg_device_pdata);
 
        imx25_add_mxc_ehci_hs(&usbh2_pdata);
 
index 3116f9ad263f53866a723e5f9bd42bae0cd57c27..cb5fb710e8507760608ca2d37d7f29c7e9475a43 100644 (file)
                .irq = soc ## _INT_USB_OTG,                             \
        }
 
+#ifdef CONFIG_ARCH_MX25
+const struct imx_fsl_usb2_udc_data imx25_fsl_usb2_udc_data __initconst =
+       imx_fsl_usb2_udc_data_entry_single(MX25);
+#endif
+
 #ifdef CONFIG_SOC_IMX27
 const struct imx_fsl_usb2_udc_data imx27_fsl_usb2_udc_data __initconst =
        imx_fsl_usb2_udc_data_entry_single(MX27);