ARM: imx: rename mxc_uart_devicex to follow a common naming scheme
[deliverable/linux.git] / arch / arm / mach-mx1 / devices.c
index 8064f2c3b86ffd129462b1e6602451dcc1faf6bf..a79e6132dbe506819c6ad697c36c276dbac31186 100644 (file)
@@ -29,7 +29,7 @@
 
 #include "devices.h"
 
-static struct resource imx_csi_resources[] = {
+static struct resource imx1_camera_resources[] = {
        {
                .start  = 0x00224000,
                .end    = 0x00224010,
@@ -41,17 +41,17 @@ static struct resource imx_csi_resources[] = {
        },
 };
 
-static u64 imx_csi_dmamask = DMA_BIT_MASK(32);
+static u64 imx1_camera_dmamask = DMA_BIT_MASK(32);
 
-struct platform_device imx_csi_device = {
+struct platform_device imx1_camera_device = {
        .name           = "mx1-camera",
        .id             = 0, /* This is used to put cameras on this interface */
        .dev            = {
-               .dma_mask = &imx_csi_dmamask,
+               .dma_mask = &imx1_camera_dmamask,
                .coherent_dma_mask = DMA_BIT_MASK(32),
        },
-       .resource       = imx_csi_resources,
-       .num_resources  = ARRAY_SIZE(imx_csi_resources),
+       .resource       = imx1_camera_resources,
+       .num_resources  = ARRAY_SIZE(imx1_camera_resources),
 };
 
 static struct resource imx_i2c_resources[] = {
@@ -66,66 +66,43 @@ static struct resource imx_i2c_resources[] = {
        },
 };
 
-struct platform_device imx_i2c_device = {
+struct platform_device imx_i2c_device0 = {
        .name           = "imx-i2c",
        .id             = 0,
        .resource       = imx_i2c_resources,
        .num_resources  = ARRAY_SIZE(imx_i2c_resources),
 };
 
-static struct resource imx_uart1_resources[] = {
-       {
-               .start = MX1_UART1_BASE_ADDR,
-               .end = MX1_UART1_BASE_ADDR + 0xD0,
-               .flags = IORESOURCE_MEM,
-       }, {
-               .start = MX1_UART1_MINT_RX,
-               .end = MX1_UART1_MINT_RX,
-               .flags = IORESOURCE_IRQ,
-       }, {
-               .start = MX1_UART1_MINT_TX,
-               .end = MX1_UART1_MINT_TX,
-               .flags = IORESOURCE_IRQ,
-       }, {
-               .start = MX1_UART1_MINT_RTS,
-               .end = MX1_UART1_MINT_RTS,
-               .flags = IORESOURCE_IRQ,
-       },
-};
-
-struct platform_device imx_uart1_device = {
-       .name           = "imx-uart",
-       .id             = 0,
-       .num_resources  = ARRAY_SIZE(imx_uart1_resources),
-       .resource       = imx_uart1_resources,
-};
-
-static struct resource imx_uart2_resources[] = {
-       {
-               .start = MX1_UART2_BASE_ADDR,
-               .end = MX1_UART2_BASE_ADDR + 0xD0,
-               .flags = IORESOURCE_MEM,
-       }, {
-               .start = MX1_UART2_MINT_RX,
-               .end = MX1_UART2_MINT_RX,
-               .flags = IORESOURCE_IRQ,
-       }, {
-               .start = MX1_UART2_MINT_TX,
-               .end = MX1_UART2_MINT_TX,
-               .flags = IORESOURCE_IRQ,
-       }, {
-               .start = MX1_UART2_MINT_RTS,
-               .end = MX1_UART2_MINT_RTS,
-               .flags = IORESOURCE_IRQ,
-       },
-};
+#define DEFINE_IMX1_UART_DEVICE(n, baseaddr, irqrx, irqtx, irqrts)     \
+       static struct resource imx1_uart_resources ## n[] = {           \
+               {                                                       \
+                       .start = baseaddr,                              \
+                       .end = baseaddr + 0xd0,                         \
+                       .flags = IORESOURCE_MEM,                        \
+               }, {                                                    \
+                       .start = irqrx,                                 \
+                       .end = irqrx,                                   \
+                       .flags = IORESOURCE_IRQ,                        \
+               }, {                                                    \
+                       .start = irqtx,                                 \
+                       .end = irqtx,                                   \
+                       .flags = IORESOURCE_IRQ,                        \
+               }, {                                                    \
+                       .start = irqrts,                                \
+                       .end = irqrts,                                  \
+                       .flags = IORESOURCE_IRQ,                        \
+               },                                                      \
+       };                                                              \
+                                                                       \
+       struct platform_device imx1_uart_device ## n = {                \
+               .name = "imx-uart",                                     \
+               .id = n,                                                \
+               .num_resources = ARRAY_SIZE(imx1_uart_resources ## n),  \
+               .resource = imx1_uart_resources ## n,                   \
+       }
 
-struct platform_device imx_uart2_device = {
-       .name           = "imx-uart",
-       .id             = 1,
-       .num_resources  = ARRAY_SIZE(imx_uart2_resources),
-       .resource       = imx_uart2_resources,
-};
+DEFINE_IMX1_UART_DEVICE(0, MX1_UART1_BASE_ADDR, MX1_UART1_MINT_RX, MX1_UART1_MINT_TX, MX1_UART1_MINT_RTS);
+DEFINE_IMX1_UART_DEVICE(1, MX1_UART2_BASE_ADDR, MX1_UART2_MINT_RX, MX1_UART2_MINT_TX, MX1_UART2_MINT_RTS);
 
 static struct resource imx_rtc_resources[] = {
        {
@@ -237,7 +214,7 @@ static struct mxc_gpio_port imx_gpio_ports[] = {
        }
 };
 
-int __init mxc_register_gpios(void)
+int __init imx1_register_gpios(void)
 {
        return mxc_gpio_init(imx_gpio_ports, ARRAY_SIZE(imx_gpio_ports));
 }
This page took 0.026148 seconds and 5 git commands to generate.