Commit 3e876935 authored by Uwe Kleine-König's avatar Uwe Kleine-König

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: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
parent 8f785e85
...@@ -73,59 +73,36 @@ struct platform_device imx_i2c_device0 = { ...@@ -73,59 +73,36 @@ struct platform_device imx_i2c_device0 = {
.num_resources = ARRAY_SIZE(imx_i2c_resources), .num_resources = ARRAY_SIZE(imx_i2c_resources),
}; };
static struct resource imx_uart1_resources[] = { #define DEFINE_IMX1_UART_DEVICE(n, baseaddr, irqrx, irqtx, irqrts) \
{ static struct resource imx1_uart_resources ## n[] = { \
.start = MX1_UART1_BASE_ADDR, { \
.end = MX1_UART1_BASE_ADDR + 0xD0, .start = baseaddr, \
.flags = IORESOURCE_MEM, .end = baseaddr + 0xd0, \
}, { .flags = IORESOURCE_MEM, \
.start = MX1_UART1_MINT_RX, }, { \
.end = MX1_UART1_MINT_RX, .start = irqrx, \
.flags = IORESOURCE_IRQ, .end = irqrx, \
}, { .flags = IORESOURCE_IRQ, \
.start = MX1_UART1_MINT_TX, }, { \
.end = MX1_UART1_MINT_TX, .start = irqtx, \
.flags = IORESOURCE_IRQ, .end = irqtx, \
}, { .flags = IORESOURCE_IRQ, \
.start = MX1_UART1_MINT_RTS, }, { \
.end = MX1_UART1_MINT_RTS, .start = irqrts, \
.flags = IORESOURCE_IRQ, .end = irqrts, \
}, .flags = IORESOURCE_IRQ, \
}; }, \
}; \
struct platform_device imx_uart1_device = { \
.name = "imx-uart", struct platform_device imx1_uart_device ## n = { \
.id = 0, .name = "imx-uart", \
.num_resources = ARRAY_SIZE(imx_uart1_resources), .id = n, \
.resource = imx_uart1_resources, .num_resources = ARRAY_SIZE(imx1_uart_resources ## n), \
}; .resource = imx1_uart_resources ## n, \
}
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,
},
};
struct platform_device imx_uart2_device = { DEFINE_IMX1_UART_DEVICE(0, MX1_UART1_BASE_ADDR, MX1_UART1_MINT_RX, MX1_UART1_MINT_TX, MX1_UART1_MINT_RTS);
.name = "imx-uart", DEFINE_IMX1_UART_DEVICE(1, MX1_UART2_BASE_ADDR, MX1_UART2_MINT_RX, MX1_UART2_MINT_TX, MX1_UART2_MINT_RTS);
.id = 1,
.num_resources = ARRAY_SIZE(imx_uart2_resources),
.resource = imx_uart2_resources,
};
static struct resource imx_rtc_resources[] = { static struct resource imx_rtc_resources[] = {
{ {
......
extern struct platform_device imx1_camera_device; extern struct platform_device imx1_camera_device;
extern struct platform_device imx_i2c_device0; extern struct platform_device imx_i2c_device0;
extern struct platform_device imx_uart1_device; extern struct platform_device imx1_uart_device0;
extern struct platform_device imx_uart2_device; extern struct platform_device imx1_uart_device1;
extern struct platform_device imx_rtc_device; extern struct platform_device imx_rtc_device;
extern struct platform_device imx_wdt_device; extern struct platform_device imx_wdt_device;
extern struct platform_device imx_usb_device; extern struct platform_device imx_usb_device;
...@@ -121,8 +121,8 @@ static void __init mx1ads_init(void) ...@@ -121,8 +121,8 @@ static void __init mx1ads_init(void)
ARRAY_SIZE(mx1ads_pins), "mx1ads"); ARRAY_SIZE(mx1ads_pins), "mx1ads");
/* UART */ /* UART */
mxc_register_device(&imx_uart1_device, &uart_pdata[0]); mxc_register_device(&imx1_uart_device0, &uart_pdata[0]);
mxc_register_device(&imx_uart2_device, &uart_pdata[1]); mxc_register_device(&imx1_uart_device1, &uart_pdata[1]);
/* Physmap flash */ /* Physmap flash */
mxc_register_device(&flash_device, &mx1ads_flash_data); mxc_register_device(&flash_device, &mx1ads_flash_data);
......
...@@ -130,7 +130,7 @@ static struct platform_device *devices[] __initdata = { ...@@ -130,7 +130,7 @@ static struct platform_device *devices[] __initdata = {
*/ */
static void __init scb9328_init(void) static void __init scb9328_init(void)
{ {
mxc_register_device(&imx_uart1_device, &uart_pdata); mxc_register_device(&imx1_uart_device0, &uart_pdata);
printk(KERN_INFO"Scb9328: Adding devices\n"); printk(KERN_INFO"Scb9328: Adding devices\n");
platform_add_devices(devices, ARRAY_SIZE(devices)); platform_add_devices(devices, ARRAY_SIZE(devices));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment