aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-s3c2410/s3c2440.c
diff options
context:
space:
mode:
authorBen Dooks <ben-linux@fluff.org>2006-06-18 18:04:05 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2006-06-18 18:04:05 -0400
commit66a9b49a370baac75d90b7da9a2445997a8a9438 (patch)
tree62b22d1559c1c1d1e02428f27c08dca0fb66aa83 /arch/arm/mach-s3c2410/s3c2440.c
parent810c894f2b27b634883723f9fee10a7cf1d0bcb4 (diff)
[ARM] 3557/1: S3C24XX: centralise and cleanup uart registration
Patch from Ben Dooks All the S3C24XX based devices currently have similar uart blocks, in the same location. Make the process of adding new uart blocks easier by commonising the device definitions and adding a new init function for the cpu code. Signed-off-by: Ben Dooks <ben-linux@fluff.org> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-s3c2410/s3c2440.c')
-rw-r--r--arch/arm/mach-s3c2410/s3c2440.c94
1 files changed, 2 insertions, 92 deletions
diff --git a/arch/arm/mach-s3c2410/s3c2440.c b/arch/arm/mach-s3c2410/s3c2440.c
index b7fe6d9453fb..54681740f9f1 100644
--- a/arch/arm/mach-s3c2410/s3c2440.c
+++ b/arch/arm/mach-s3c2410/s3c2440.c
@@ -60,95 +60,13 @@ static struct map_desc s3c2440_iodesc[] __initdata = {
60 IODESC_ENT(WATCHDOG), 60 IODESC_ENT(WATCHDOG),
61}; 61};
62 62
63static struct resource s3c_uart0_resource[] = {
64 [0] = {
65 .start = S3C2410_PA_UART0,
66 .end = S3C2410_PA_UART0 + 0x3fff,
67 .flags = IORESOURCE_MEM,
68 },
69 [1] = {
70 .start = IRQ_S3CUART_RX0,
71 .end = IRQ_S3CUART_ERR0,
72 .flags = IORESOURCE_IRQ,
73 }
74
75};
76
77static struct resource s3c_uart1_resource[] = {
78 [0] = {
79 .start = S3C2410_PA_UART1,
80 .end = S3C2410_PA_UART1 + 0x3fff,
81 .flags = IORESOURCE_MEM,
82 },
83 [1] = {
84 .start = IRQ_S3CUART_RX1,
85 .end = IRQ_S3CUART_ERR1,
86 .flags = IORESOURCE_IRQ,
87 }
88};
89
90static struct resource s3c_uart2_resource[] = {
91 [0] = {
92 .start = S3C2410_PA_UART2,
93 .end = S3C2410_PA_UART2 + 0x3fff,
94 .flags = IORESOURCE_MEM,
95 },
96 [1] = {
97 .start = IRQ_S3CUART_RX2,
98 .end = IRQ_S3CUART_ERR2,
99 .flags = IORESOURCE_IRQ,
100 }
101};
102
103/* our uart devices */
104
105static struct platform_device s3c_uart0 = {
106 .name = "s3c2440-uart",
107 .id = 0,
108 .num_resources = ARRAY_SIZE(s3c_uart0_resource),
109 .resource = s3c_uart0_resource,
110};
111
112static struct platform_device s3c_uart1 = {
113 .name = "s3c2440-uart",
114 .id = 1,
115 .num_resources = ARRAY_SIZE(s3c_uart1_resource),
116 .resource = s3c_uart1_resource,
117};
118
119static struct platform_device s3c_uart2 = {
120 .name = "s3c2440-uart",
121 .id = 2,
122 .num_resources = ARRAY_SIZE(s3c_uart2_resource),
123 .resource = s3c_uart2_resource,
124};
125
126static struct platform_device *uart_devices[] __initdata = {
127 &s3c_uart0,
128 &s3c_uart1,
129 &s3c_uart2
130};
131
132/* uart initialisation */ 63/* uart initialisation */
133 64
134static int __initdata s3c2440_uart_count;
135
136void __init s3c2440_init_uarts(struct s3c2410_uartcfg *cfg, int no) 65void __init s3c2440_init_uarts(struct s3c2410_uartcfg *cfg, int no)
137{ 66{
138 struct platform_device *platdev; 67 s3c24xx_init_uartdevs("s3c2440-uart", s3c2410_uart_resources, cfg, no);
139 int uart;
140
141 for (uart = 0; uart < no; uart++, cfg++) {
142 platdev = uart_devices[cfg->hwport];
143
144 s3c24xx_uart_devs[uart] = platdev;
145 platdev->dev.platform_data = cfg;
146 }
147
148 s3c2440_uart_count = uart;
149} 68}
150 69
151
152#ifdef CONFIG_PM 70#ifdef CONFIG_PM
153 71
154static struct sleep_save s3c2440_sleep[] = { 72static struct sleep_save s3c2440_sleep[] = {
@@ -269,15 +187,7 @@ core_initcall(s3c2440_core_init);
269 187
270int __init s3c2440_init(void) 188int __init s3c2440_init(void)
271{ 189{
272 int ret;
273
274 printk("S3C2440: Initialising architecture\n"); 190 printk("S3C2440: Initialising architecture\n");
275 191
276 ret = sysdev_register(&s3c2440_sysdev); 192 return sysdev_register(&s3c2440_sysdev);
277 if (ret != 0)
278 printk(KERN_ERR "failed to register sysdev for s3c2440\n");
279 else
280 ret = platform_add_devices(s3c24xx_uart_devs, s3c2440_uart_count);
281
282 return ret;
283} 193}