aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2010-06-10 12:02:25 -0400
committerUwe Kleine-König <u.kleine-koenig@pengutronix.de>2010-06-24 09:40:45 -0400
commit3e876935b805966f140bdae73f96bc4c3632c947 (patch)
tree54c461e530a3325459dfd32c775a98e1b3eb6ffa
parent8f785e8549fbf73995a7795651709b458300ed01 (diff)
ARM: imx1: rename imx_uart[12]_device to follow a common naming scheme
Note that these devices are specific for imx1 as only here three irqs are used. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
-rw-r--r--arch/arm/mach-mx1/devices.c81
-rw-r--r--arch/arm/mach-mx1/devices.h4
-rw-r--r--arch/arm/mach-mx1/mach-mx1ads.c4
-rw-r--r--arch/arm/mach-mx1/mach-scb9328.c2
4 files changed, 34 insertions, 57 deletions
diff --git a/arch/arm/mach-mx1/devices.c b/arch/arm/mach-mx1/devices.c
index c770aa0a10de..a79e6132dbe5 100644
--- a/arch/arm/mach-mx1/devices.c
+++ b/arch/arm/mach-mx1/devices.c
@@ -73,59 +73,36 @@ struct platform_device imx_i2c_device0 = {
73 .num_resources = ARRAY_SIZE(imx_i2c_resources), 73 .num_resources = ARRAY_SIZE(imx_i2c_resources),
74}; 74};
75 75
76static struct resource imx_uart1_resources[] = { 76#define DEFINE_IMX1_UART_DEVICE(n, baseaddr, irqrx, irqtx, irqrts) \
77 { 77 static struct resource imx1_uart_resources ## n[] = { \
78 .start = MX1_UART1_BASE_ADDR, 78 { \
79 .end = MX1_UART1_BASE_ADDR + 0xD0, 79 .start = baseaddr, \
80 .flags = IORESOURCE_MEM, 80 .end = baseaddr + 0xd0, \
81 }, { 81 .flags = IORESOURCE_MEM, \
82 .start = MX1_UART1_MINT_RX, 82 }, { \
83 .end = MX1_UART1_MINT_RX, 83 .start = irqrx, \
84 .flags = IORESOURCE_IRQ, 84 .end = irqrx, \
85 }, { 85 .flags = IORESOURCE_IRQ, \
86 .start = MX1_UART1_MINT_TX, 86 }, { \
87 .end = MX1_UART1_MINT_TX, 87 .start = irqtx, \
88 .flags = IORESOURCE_IRQ, 88 .end = irqtx, \
89 }, { 89 .flags = IORESOURCE_IRQ, \
90 .start = MX1_UART1_MINT_RTS, 90 }, { \
91 .end = MX1_UART1_MINT_RTS, 91 .start = irqrts, \
92 .flags = IORESOURCE_IRQ, 92 .end = irqrts, \
93 }, 93 .flags = IORESOURCE_IRQ, \
94}; 94 }, \
95 95 }; \
96struct platform_device imx_uart1_device = { 96 \
97 .name = "imx-uart", 97 struct platform_device imx1_uart_device ## n = { \
98 .id = 0, 98 .name = "imx-uart", \
99 .num_resources = ARRAY_SIZE(imx_uart1_resources), 99 .id = n, \
100 .resource = imx_uart1_resources, 100 .num_resources = ARRAY_SIZE(imx1_uart_resources ## n), \
101}; 101 .resource = imx1_uart_resources ## n, \
102 102 }
103static struct resource imx_uart2_resources[] = {
104 {
105 .start = MX1_UART2_BASE_ADDR,
106 .end = MX1_UART2_BASE_ADDR + 0xD0,
107 .flags = IORESOURCE_MEM,
108 }, {
109 .start = MX1_UART2_MINT_RX,
110 .end = MX1_UART2_MINT_RX,
111 .flags = IORESOURCE_IRQ,
112 }, {
113 .start = MX1_UART2_MINT_TX,
114 .end = MX1_UART2_MINT_TX,
115 .flags = IORESOURCE_IRQ,
116 }, {
117 .start = MX1_UART2_MINT_RTS,
118 .end = MX1_UART2_MINT_RTS,
119 .flags = IORESOURCE_IRQ,
120 },
121};
122 103
123struct platform_device imx_uart2_device = { 104DEFINE_IMX1_UART_DEVICE(0, MX1_UART1_BASE_ADDR, MX1_UART1_MINT_RX, MX1_UART1_MINT_TX, MX1_UART1_MINT_RTS);
124 .name = "imx-uart", 105DEFINE_IMX1_UART_DEVICE(1, MX1_UART2_BASE_ADDR, MX1_UART2_MINT_RX, MX1_UART2_MINT_TX, MX1_UART2_MINT_RTS);
125 .id = 1,
126 .num_resources = ARRAY_SIZE(imx_uart2_resources),
127 .resource = imx_uart2_resources,
128};
129 106
130static struct resource imx_rtc_resources[] = { 107static struct resource imx_rtc_resources[] = {
131 { 108 {
diff --git a/arch/arm/mach-mx1/devices.h b/arch/arm/mach-mx1/devices.h
index 851d6dfccf2e..13325166f639 100644
--- a/arch/arm/mach-mx1/devices.h
+++ b/arch/arm/mach-mx1/devices.h
@@ -1,7 +1,7 @@
1extern struct platform_device imx1_camera_device; 1extern struct platform_device imx1_camera_device;
2extern struct platform_device imx_i2c_device0; 2extern struct platform_device imx_i2c_device0;
3extern struct platform_device imx_uart1_device; 3extern struct platform_device imx1_uart_device0;
4extern struct platform_device imx_uart2_device; 4extern struct platform_device imx1_uart_device1;
5extern struct platform_device imx_rtc_device; 5extern struct platform_device imx_rtc_device;
6extern struct platform_device imx_wdt_device; 6extern struct platform_device imx_wdt_device;
7extern struct platform_device imx_usb_device; 7extern struct platform_device imx_usb_device;
diff --git a/arch/arm/mach-mx1/mach-mx1ads.c b/arch/arm/mach-mx1/mach-mx1ads.c
index 16adc6194706..5d7c85f8aaf5 100644
--- a/arch/arm/mach-mx1/mach-mx1ads.c
+++ b/arch/arm/mach-mx1/mach-mx1ads.c
@@ -121,8 +121,8 @@ static void __init mx1ads_init(void)
121 ARRAY_SIZE(mx1ads_pins), "mx1ads"); 121 ARRAY_SIZE(mx1ads_pins), "mx1ads");
122 122
123 /* UART */ 123 /* UART */
124 mxc_register_device(&imx_uart1_device, &uart_pdata[0]); 124 mxc_register_device(&imx1_uart_device0, &uart_pdata[0]);
125 mxc_register_device(&imx_uart2_device, &uart_pdata[1]); 125 mxc_register_device(&imx1_uart_device1, &uart_pdata[1]);
126 126
127 /* Physmap flash */ 127 /* Physmap flash */
128 mxc_register_device(&flash_device, &mx1ads_flash_data); 128 mxc_register_device(&flash_device, &mx1ads_flash_data);
diff --git a/arch/arm/mach-mx1/mach-scb9328.c b/arch/arm/mach-mx1/mach-scb9328.c
index ed2ff162c380..482b24df4624 100644
--- a/arch/arm/mach-mx1/mach-scb9328.c
+++ b/arch/arm/mach-mx1/mach-scb9328.c
@@ -130,7 +130,7 @@ static struct platform_device *devices[] __initdata = {
130 */ 130 */
131static void __init scb9328_init(void) 131static void __init scb9328_init(void)
132{ 132{
133 mxc_register_device(&imx_uart1_device, &uart_pdata); 133 mxc_register_device(&imx1_uart_device0, &uart_pdata);
134 134
135 printk(KERN_INFO"Scb9328: Adding devices\n"); 135 printk(KERN_INFO"Scb9328: Adding devices\n");
136 platform_add_devices(devices, ARRAY_SIZE(devices)); 136 platform_add_devices(devices, ARRAY_SIZE(devices));