Ben Dooks | a21765a | 2007-02-11 18:31:01 +0100 | [diff] [blame] | 1 | /* linux/arch/arm/plat-s3c24xx/devs.c |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 2 | * |
| 3 | * Copyright (c) 2004 Simtec Electronics |
Ben Dooks | 916a002 | 2006-09-06 19:03:21 +0100 | [diff] [blame] | 4 | * Ben Dooks <ben@simtec.co.uk> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 5 | * |
Ben Dooks | 916a002 | 2006-09-06 19:03:21 +0100 | [diff] [blame] | 6 | * Base S3C24XX platform device definitions |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 7 | * |
| 8 | * This program is free software; you can redistribute it and/or modify |
| 9 | * it under the terms of the GNU General Public License version 2 as |
| 10 | * published by the Free Software Foundation. |
| 11 | * |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 12 | */ |
| 13 | |
| 14 | #include <linux/kernel.h> |
| 15 | #include <linux/types.h> |
| 16 | #include <linux/interrupt.h> |
| 17 | #include <linux/list.h> |
| 18 | #include <linux/timer.h> |
| 19 | #include <linux/init.h> |
Ben Dooks | b6d1f54 | 2006-12-17 23:22:26 +0100 | [diff] [blame] | 20 | #include <linux/serial_core.h> |
Russell King | d052d1b | 2005-10-29 19:07:23 +0100 | [diff] [blame] | 21 | #include <linux/platform_device.h> |
Russell King | fced80c | 2008-09-06 12:10:45 +0100 | [diff] [blame] | 22 | #include <linux/io.h> |
Tejun Heo | 5a0e3ad | 2010-03-24 17:04:11 +0900 | [diff] [blame] | 23 | #include <linux/slab.h> |
Arnaud Patard | f44c67c | 2010-04-22 10:47:44 +0200 | [diff] [blame] | 24 | #include <linux/string.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 25 | |
| 26 | #include <asm/mach/arch.h> |
| 27 | #include <asm/mach/map.h> |
| 28 | #include <asm/mach/irq.h> |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 29 | #include <mach/fb.h> |
| 30 | #include <mach/hardware.h> |
Mark Brown | d91e9a7 | 2009-08-05 18:29:57 +0100 | [diff] [blame] | 31 | #include <mach/dma.h> |
| 32 | #include <mach/irqs.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 33 | #include <asm/irq.h> |
| 34 | |
Ben Dooks | a2b7ba9 | 2008-10-07 22:26:09 +0100 | [diff] [blame] | 35 | #include <plat/regs-serial.h> |
Ben Dooks | 57bd4b9 | 2008-10-30 10:14:37 +0000 | [diff] [blame] | 36 | #include <plat/udc.h> |
Ben Dooks | 22c810a | 2010-01-18 16:24:22 +0900 | [diff] [blame] | 37 | #include <plat/mci.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 38 | |
Ben Dooks | a2b7ba9 | 2008-10-07 22:26:09 +0100 | [diff] [blame] | 39 | #include <plat/devs.h> |
| 40 | #include <plat/cpu.h> |
Ben Dooks | 1362270 | 2008-10-30 10:14:38 +0000 | [diff] [blame] | 41 | #include <plat/regs-spi.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 42 | |
Arnaud Patard | ce8877b | 2009-12-23 19:25:05 +0000 | [diff] [blame] | 43 | #include <mach/ts.h> |
| 44 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 45 | /* Serial port registrations */ |
| 46 | |
Ben Dooks | 66a9b49 | 2006-06-18 23:04:05 +0100 | [diff] [blame] | 47 | static struct resource s3c2410_uart0_resource[] = { |
| 48 | [0] = { |
| 49 | .start = S3C2410_PA_UART0, |
| 50 | .end = S3C2410_PA_UART0 + 0x3fff, |
| 51 | .flags = IORESOURCE_MEM, |
| 52 | }, |
| 53 | [1] = { |
| 54 | .start = IRQ_S3CUART_RX0, |
| 55 | .end = IRQ_S3CUART_ERR0, |
| 56 | .flags = IORESOURCE_IRQ, |
| 57 | } |
| 58 | }; |
| 59 | |
| 60 | static struct resource s3c2410_uart1_resource[] = { |
| 61 | [0] = { |
| 62 | .start = S3C2410_PA_UART1, |
| 63 | .end = S3C2410_PA_UART1 + 0x3fff, |
| 64 | .flags = IORESOURCE_MEM, |
| 65 | }, |
| 66 | [1] = { |
| 67 | .start = IRQ_S3CUART_RX1, |
| 68 | .end = IRQ_S3CUART_ERR1, |
| 69 | .flags = IORESOURCE_IRQ, |
| 70 | } |
| 71 | }; |
| 72 | |
| 73 | static struct resource s3c2410_uart2_resource[] = { |
| 74 | [0] = { |
| 75 | .start = S3C2410_PA_UART2, |
| 76 | .end = S3C2410_PA_UART2 + 0x3fff, |
| 77 | .flags = IORESOURCE_MEM, |
| 78 | }, |
| 79 | [1] = { |
| 80 | .start = IRQ_S3CUART_RX2, |
| 81 | .end = IRQ_S3CUART_ERR2, |
| 82 | .flags = IORESOURCE_IRQ, |
| 83 | } |
| 84 | }; |
| 85 | |
Ben Dooks | dbf3599 | 2008-11-04 15:29:09 +0000 | [diff] [blame] | 86 | static struct resource s3c2410_uart3_resource[] = { |
| 87 | [0] = { |
| 88 | .start = S3C2443_PA_UART3, |
| 89 | .end = S3C2443_PA_UART3 + 0x3fff, |
| 90 | .flags = IORESOURCE_MEM, |
| 91 | }, |
| 92 | [1] = { |
| 93 | .start = IRQ_S3CUART_RX3, |
| 94 | .end = IRQ_S3CUART_ERR3, |
| 95 | .flags = IORESOURCE_IRQ, |
| 96 | }, |
| 97 | }; |
| 98 | |
Ben Dooks | 66a9b49 | 2006-06-18 23:04:05 +0100 | [diff] [blame] | 99 | struct s3c24xx_uart_resources s3c2410_uart_resources[] __initdata = { |
| 100 | [0] = { |
| 101 | .resources = s3c2410_uart0_resource, |
| 102 | .nr_resources = ARRAY_SIZE(s3c2410_uart0_resource), |
| 103 | }, |
| 104 | [1] = { |
| 105 | .resources = s3c2410_uart1_resource, |
| 106 | .nr_resources = ARRAY_SIZE(s3c2410_uart1_resource), |
| 107 | }, |
| 108 | [2] = { |
| 109 | .resources = s3c2410_uart2_resource, |
| 110 | .nr_resources = ARRAY_SIZE(s3c2410_uart2_resource), |
| 111 | }, |
Ben Dooks | dbf3599 | 2008-11-04 15:29:09 +0000 | [diff] [blame] | 112 | [3] = { |
| 113 | .resources = s3c2410_uart3_resource, |
| 114 | .nr_resources = ARRAY_SIZE(s3c2410_uart3_resource), |
| 115 | }, |
Ben Dooks | 66a9b49 | 2006-06-18 23:04:05 +0100 | [diff] [blame] | 116 | }; |
| 117 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 118 | /* LCD Controller */ |
| 119 | |
| 120 | static struct resource s3c_lcd_resource[] = { |
| 121 | [0] = { |
Lucas Correia Villa Real | 0367a8d | 2006-01-26 15:20:50 +0000 | [diff] [blame] | 122 | .start = S3C24XX_PA_LCD, |
| 123 | .end = S3C24XX_PA_LCD + S3C24XX_SZ_LCD - 1, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 124 | .flags = IORESOURCE_MEM, |
| 125 | }, |
| 126 | [1] = { |
| 127 | .start = IRQ_LCD, |
| 128 | .end = IRQ_LCD, |
| 129 | .flags = IORESOURCE_IRQ, |
| 130 | } |
| 131 | |
| 132 | }; |
| 133 | |
| 134 | static u64 s3c_device_lcd_dmamask = 0xffffffffUL; |
| 135 | |
| 136 | struct platform_device s3c_device_lcd = { |
| 137 | .name = "s3c2410-lcd", |
| 138 | .id = -1, |
| 139 | .num_resources = ARRAY_SIZE(s3c_lcd_resource), |
| 140 | .resource = s3c_lcd_resource, |
| 141 | .dev = { |
Ben Dooks | 6904b24 | 2005-06-29 11:09:15 +0100 | [diff] [blame] | 142 | .dma_mask = &s3c_device_lcd_dmamask, |
| 143 | .coherent_dma_mask = 0xffffffffUL |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 144 | } |
| 145 | }; |
| 146 | |
| 147 | EXPORT_SYMBOL(s3c_device_lcd); |
| 148 | |
Ben Dooks | 893b030 | 2005-10-28 15:31:45 +0100 | [diff] [blame] | 149 | void __init s3c24xx_fb_set_platdata(struct s3c2410fb_mach_info *pd) |
Arnaud Patard | f92273c | 2005-09-09 13:10:10 -0700 | [diff] [blame] | 150 | { |
Ben Dooks | 893b030 | 2005-10-28 15:31:45 +0100 | [diff] [blame] | 151 | struct s3c2410fb_mach_info *npd; |
| 152 | |
Arnaud Patard | f44c67c | 2010-04-22 10:47:44 +0200 | [diff] [blame] | 153 | npd = kmemdup(pd, sizeof(*npd), GFP_KERNEL); |
Ben Dooks | 893b030 | 2005-10-28 15:31:45 +0100 | [diff] [blame] | 154 | if (npd) { |
Ben Dooks | 893b030 | 2005-10-28 15:31:45 +0100 | [diff] [blame] | 155 | s3c_device_lcd.dev.platform_data = npd; |
Arnaud Patard | f44c67c | 2010-04-22 10:47:44 +0200 | [diff] [blame] | 156 | npd->displays = kmemdup(pd->displays, |
| 157 | sizeof(struct s3c2410fb_display) * npd->num_displays, |
| 158 | GFP_KERNEL); |
| 159 | if (!npd->displays) |
| 160 | printk(KERN_ERR "no memory for LCD display data\n"); |
Ben Dooks | 893b030 | 2005-10-28 15:31:45 +0100 | [diff] [blame] | 161 | } else { |
| 162 | printk(KERN_ERR "no memory for LCD platform data\n"); |
| 163 | } |
Arnaud Patard | f92273c | 2005-09-09 13:10:10 -0700 | [diff] [blame] | 164 | } |
Arnaud Patard | f92273c | 2005-09-09 13:10:10 -0700 | [diff] [blame] | 165 | |
Arnaud Patard | ce8877b | 2009-12-23 19:25:05 +0000 | [diff] [blame] | 166 | /* Touchscreen */ |
Vasily Khoruzhick | 0fe1309 | 2010-02-18 18:32:27 +0200 | [diff] [blame] | 167 | |
| 168 | static struct resource s3c_ts_resource[] = { |
| 169 | [0] = { |
| 170 | .start = S3C24XX_PA_ADC, |
| 171 | .end = S3C24XX_PA_ADC + S3C24XX_SZ_ADC - 1, |
| 172 | .flags = IORESOURCE_MEM, |
| 173 | }, |
| 174 | [1] = { |
| 175 | .start = IRQ_TC, |
| 176 | .end = IRQ_TC, |
| 177 | .flags = IORESOURCE_IRQ, |
| 178 | }, |
| 179 | |
| 180 | }; |
| 181 | |
Arnaud Patard | ce8877b | 2009-12-23 19:25:05 +0000 | [diff] [blame] | 182 | struct platform_device s3c_device_ts = { |
| 183 | .name = "s3c2410-ts", |
| 184 | .id = -1, |
Vasily Khoruzhick | 0fe1309 | 2010-02-18 18:32:27 +0200 | [diff] [blame] | 185 | .dev.parent = &s3c_device_adc.dev, |
| 186 | .num_resources = ARRAY_SIZE(s3c_ts_resource), |
| 187 | .resource = s3c_ts_resource, |
Arnaud Patard | ce8877b | 2009-12-23 19:25:05 +0000 | [diff] [blame] | 188 | }; |
| 189 | EXPORT_SYMBOL(s3c_device_ts); |
| 190 | |
| 191 | static struct s3c2410_ts_mach_info s3c2410ts_info; |
| 192 | |
| 193 | void __init s3c24xx_ts_set_platdata(struct s3c2410_ts_mach_info *hard_s3c2410ts_info) |
| 194 | { |
| 195 | memcpy(&s3c2410ts_info, hard_s3c2410ts_info, sizeof(struct s3c2410_ts_mach_info)); |
| 196 | s3c_device_ts.dev.platform_data = &s3c2410ts_info; |
| 197 | } |
| 198 | EXPORT_SYMBOL(s3c24xx_ts_set_platdata); |
| 199 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 200 | /* USB Device (Gadget)*/ |
| 201 | |
| 202 | static struct resource s3c_usbgadget_resource[] = { |
| 203 | [0] = { |
Lucas Correia Villa Real | 0367a8d | 2006-01-26 15:20:50 +0000 | [diff] [blame] | 204 | .start = S3C24XX_PA_USBDEV, |
| 205 | .end = S3C24XX_PA_USBDEV + S3C24XX_SZ_USBDEV - 1, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 206 | .flags = IORESOURCE_MEM, |
| 207 | }, |
| 208 | [1] = { |
| 209 | .start = IRQ_USBD, |
| 210 | .end = IRQ_USBD, |
| 211 | .flags = IORESOURCE_IRQ, |
| 212 | } |
| 213 | |
| 214 | }; |
| 215 | |
| 216 | struct platform_device s3c_device_usbgadget = { |
| 217 | .name = "s3c2410-usbgadget", |
| 218 | .id = -1, |
| 219 | .num_resources = ARRAY_SIZE(s3c_usbgadget_resource), |
| 220 | .resource = s3c_usbgadget_resource, |
| 221 | }; |
| 222 | |
| 223 | EXPORT_SYMBOL(s3c_device_usbgadget); |
| 224 | |
Arnaud Patard | 0dcfc32 | 2007-02-13 00:18:33 +0100 | [diff] [blame] | 225 | void __init s3c24xx_udc_set_platdata(struct s3c2410_udc_mach_info *pd) |
| 226 | { |
| 227 | struct s3c2410_udc_mach_info *npd; |
| 228 | |
| 229 | npd = kmalloc(sizeof(*npd), GFP_KERNEL); |
| 230 | if (npd) { |
| 231 | memcpy(npd, pd, sizeof(*npd)); |
| 232 | s3c_device_usbgadget.dev.platform_data = npd; |
| 233 | } else { |
| 234 | printk(KERN_ERR "no memory for udc platform data\n"); |
| 235 | } |
| 236 | } |
| 237 | |
| 238 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 239 | /* Watchdog */ |
| 240 | |
| 241 | static struct resource s3c_wdt_resource[] = { |
| 242 | [0] = { |
Lucas Correia Villa Real | 0367a8d | 2006-01-26 15:20:50 +0000 | [diff] [blame] | 243 | .start = S3C24XX_PA_WATCHDOG, |
| 244 | .end = S3C24XX_PA_WATCHDOG + S3C24XX_SZ_WATCHDOG - 1, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 245 | .flags = IORESOURCE_MEM, |
| 246 | }, |
| 247 | [1] = { |
| 248 | .start = IRQ_WDT, |
| 249 | .end = IRQ_WDT, |
| 250 | .flags = IORESOURCE_IRQ, |
| 251 | } |
| 252 | |
| 253 | }; |
| 254 | |
| 255 | struct platform_device s3c_device_wdt = { |
| 256 | .name = "s3c2410-wdt", |
| 257 | .id = -1, |
| 258 | .num_resources = ARRAY_SIZE(s3c_wdt_resource), |
| 259 | .resource = s3c_wdt_resource, |
| 260 | }; |
| 261 | |
| 262 | EXPORT_SYMBOL(s3c_device_wdt); |
| 263 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 264 | /* IIS */ |
| 265 | |
| 266 | static struct resource s3c_iis_resource[] = { |
| 267 | [0] = { |
Lucas Correia Villa Real | 0367a8d | 2006-01-26 15:20:50 +0000 | [diff] [blame] | 268 | .start = S3C24XX_PA_IIS, |
| 269 | .end = S3C24XX_PA_IIS + S3C24XX_SZ_IIS -1, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 270 | .flags = IORESOURCE_MEM, |
| 271 | } |
| 272 | }; |
| 273 | |
| 274 | static u64 s3c_device_iis_dmamask = 0xffffffffUL; |
| 275 | |
| 276 | struct platform_device s3c_device_iis = { |
| 277 | .name = "s3c2410-iis", |
| 278 | .id = -1, |
| 279 | .num_resources = ARRAY_SIZE(s3c_iis_resource), |
| 280 | .resource = s3c_iis_resource, |
| 281 | .dev = { |
| 282 | .dma_mask = &s3c_device_iis_dmamask, |
| 283 | .coherent_dma_mask = 0xffffffffUL |
| 284 | } |
| 285 | }; |
| 286 | |
| 287 | EXPORT_SYMBOL(s3c_device_iis); |
| 288 | |
| 289 | /* RTC */ |
| 290 | |
| 291 | static struct resource s3c_rtc_resource[] = { |
| 292 | [0] = { |
Lucas Correia Villa Real | 0367a8d | 2006-01-26 15:20:50 +0000 | [diff] [blame] | 293 | .start = S3C24XX_PA_RTC, |
| 294 | .end = S3C24XX_PA_RTC + 0xff, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 295 | .flags = IORESOURCE_MEM, |
| 296 | }, |
| 297 | [1] = { |
| 298 | .start = IRQ_RTC, |
| 299 | .end = IRQ_RTC, |
| 300 | .flags = IORESOURCE_IRQ, |
| 301 | }, |
| 302 | [2] = { |
| 303 | .start = IRQ_TICK, |
| 304 | .end = IRQ_TICK, |
| 305 | .flags = IORESOURCE_IRQ |
| 306 | } |
| 307 | }; |
| 308 | |
| 309 | struct platform_device s3c_device_rtc = { |
| 310 | .name = "s3c2410-rtc", |
| 311 | .id = -1, |
| 312 | .num_resources = ARRAY_SIZE(s3c_rtc_resource), |
| 313 | .resource = s3c_rtc_resource, |
| 314 | }; |
| 315 | |
| 316 | EXPORT_SYMBOL(s3c_device_rtc); |
| 317 | |
| 318 | /* ADC */ |
| 319 | |
| 320 | static struct resource s3c_adc_resource[] = { |
| 321 | [0] = { |
Lucas Correia Villa Real | 0367a8d | 2006-01-26 15:20:50 +0000 | [diff] [blame] | 322 | .start = S3C24XX_PA_ADC, |
| 323 | .end = S3C24XX_PA_ADC + S3C24XX_SZ_ADC - 1, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 324 | .flags = IORESOURCE_MEM, |
| 325 | }, |
| 326 | [1] = { |
| 327 | .start = IRQ_TC, |
Ben Dooks | 083d06e | 2006-02-08 22:03:31 +0000 | [diff] [blame] | 328 | .end = IRQ_TC, |
| 329 | .flags = IORESOURCE_IRQ, |
| 330 | }, |
| 331 | [2] = { |
| 332 | .start = IRQ_ADC, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 333 | .end = IRQ_ADC, |
| 334 | .flags = IORESOURCE_IRQ, |
| 335 | } |
| 336 | |
| 337 | }; |
| 338 | |
| 339 | struct platform_device s3c_device_adc = { |
Ben Dooks | 28ab44c5b | 2008-12-18 14:20:04 +0000 | [diff] [blame] | 340 | .name = "s3c24xx-adc", |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 341 | .id = -1, |
| 342 | .num_resources = ARRAY_SIZE(s3c_adc_resource), |
| 343 | .resource = s3c_adc_resource, |
| 344 | }; |
| 345 | |
| 346 | /* SDI */ |
| 347 | |
| 348 | static struct resource s3c_sdi_resource[] = { |
| 349 | [0] = { |
Ben Dooks | ce46a9c | 2008-10-21 14:06:26 +0100 | [diff] [blame] | 350 | .start = S3C24XX_PA_SDI, |
| 351 | .end = S3C24XX_PA_SDI + S3C24XX_SZ_SDI - 1, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 352 | .flags = IORESOURCE_MEM, |
| 353 | }, |
| 354 | [1] = { |
| 355 | .start = IRQ_SDI, |
| 356 | .end = IRQ_SDI, |
| 357 | .flags = IORESOURCE_IRQ, |
| 358 | } |
| 359 | |
| 360 | }; |
| 361 | |
| 362 | struct platform_device s3c_device_sdi = { |
| 363 | .name = "s3c2410-sdi", |
| 364 | .id = -1, |
| 365 | .num_resources = ARRAY_SIZE(s3c_sdi_resource), |
| 366 | .resource = s3c_sdi_resource, |
| 367 | }; |
| 368 | |
| 369 | EXPORT_SYMBOL(s3c_device_sdi); |
| 370 | |
Arnaud Patard | 1f138f1 | 2010-04-22 10:47:45 +0200 | [diff] [blame] | 371 | void __init s3c24xx_mci_set_platdata(struct s3c24xx_mci_pdata *pdata) |
Ben Dooks | 22c810a | 2010-01-18 16:24:22 +0900 | [diff] [blame] | 372 | { |
| 373 | struct s3c24xx_mci_pdata *npd; |
| 374 | |
| 375 | npd = kmemdup(pdata, sizeof(struct s3c24xx_mci_pdata), GFP_KERNEL); |
| 376 | if (!npd) |
| 377 | printk(KERN_ERR "%s: no memory to copy pdata", __func__); |
| 378 | |
| 379 | s3c_device_sdi.dev.platform_data = npd; |
| 380 | } |
| 381 | |
| 382 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 383 | /* SPI (0) */ |
| 384 | |
| 385 | static struct resource s3c_spi0_resource[] = { |
| 386 | [0] = { |
Lucas Correia Villa Real | 0367a8d | 2006-01-26 15:20:50 +0000 | [diff] [blame] | 387 | .start = S3C24XX_PA_SPI, |
| 388 | .end = S3C24XX_PA_SPI + 0x1f, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 389 | .flags = IORESOURCE_MEM, |
| 390 | }, |
| 391 | [1] = { |
| 392 | .start = IRQ_SPI0, |
| 393 | .end = IRQ_SPI0, |
| 394 | .flags = IORESOURCE_IRQ, |
| 395 | } |
| 396 | |
| 397 | }; |
| 398 | |
Albrecht Dreß | 66be0c3 | 2006-03-15 16:03:05 +0000 | [diff] [blame] | 399 | static u64 s3c_device_spi0_dmamask = 0xffffffffUL; |
| 400 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 401 | struct platform_device s3c_device_spi0 = { |
| 402 | .name = "s3c2410-spi", |
| 403 | .id = 0, |
| 404 | .num_resources = ARRAY_SIZE(s3c_spi0_resource), |
| 405 | .resource = s3c_spi0_resource, |
Albrecht Dreß | 66be0c3 | 2006-03-15 16:03:05 +0000 | [diff] [blame] | 406 | .dev = { |
| 407 | .dma_mask = &s3c_device_spi0_dmamask, |
| 408 | .coherent_dma_mask = 0xffffffffUL |
| 409 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 410 | }; |
| 411 | |
| 412 | EXPORT_SYMBOL(s3c_device_spi0); |
| 413 | |
| 414 | /* SPI (1) */ |
| 415 | |
| 416 | static struct resource s3c_spi1_resource[] = { |
| 417 | [0] = { |
Sandeep Sanjay Patil | e903382 | 2007-05-16 10:51:45 +0100 | [diff] [blame] | 418 | .start = S3C24XX_PA_SPI + S3C2410_SPI1, |
| 419 | .end = S3C24XX_PA_SPI + S3C2410_SPI1 + 0x1f, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 420 | .flags = IORESOURCE_MEM, |
| 421 | }, |
| 422 | [1] = { |
| 423 | .start = IRQ_SPI1, |
| 424 | .end = IRQ_SPI1, |
| 425 | .flags = IORESOURCE_IRQ, |
| 426 | } |
| 427 | |
| 428 | }; |
| 429 | |
Albrecht Dreß | 66be0c3 | 2006-03-15 16:03:05 +0000 | [diff] [blame] | 430 | static u64 s3c_device_spi1_dmamask = 0xffffffffUL; |
| 431 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 432 | struct platform_device s3c_device_spi1 = { |
| 433 | .name = "s3c2410-spi", |
| 434 | .id = 1, |
| 435 | .num_resources = ARRAY_SIZE(s3c_spi1_resource), |
| 436 | .resource = s3c_spi1_resource, |
Albrecht Dreß | 66be0c3 | 2006-03-15 16:03:05 +0000 | [diff] [blame] | 437 | .dev = { |
| 438 | .dma_mask = &s3c_device_spi1_dmamask, |
| 439 | .coherent_dma_mask = 0xffffffffUL |
| 440 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 441 | }; |
| 442 | |
| 443 | EXPORT_SYMBOL(s3c_device_spi1); |
| 444 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 445 | #ifdef CONFIG_CPU_S3C2440 |
| 446 | |
| 447 | /* Camif Controller */ |
| 448 | |
| 449 | static struct resource s3c_camif_resource[] = { |
| 450 | [0] = { |
| 451 | .start = S3C2440_PA_CAMIF, |
Ben Dooks | a0e0adb | 2005-10-28 15:26:42 +0100 | [diff] [blame] | 452 | .end = S3C2440_PA_CAMIF + S3C2440_SZ_CAMIF - 1, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 453 | .flags = IORESOURCE_MEM, |
| 454 | }, |
| 455 | [1] = { |
| 456 | .start = IRQ_CAM, |
| 457 | .end = IRQ_CAM, |
| 458 | .flags = IORESOURCE_IRQ, |
| 459 | } |
| 460 | |
| 461 | }; |
| 462 | |
| 463 | static u64 s3c_device_camif_dmamask = 0xffffffffUL; |
| 464 | |
| 465 | struct platform_device s3c_device_camif = { |
| 466 | .name = "s3c2440-camif", |
| 467 | .id = -1, |
| 468 | .num_resources = ARRAY_SIZE(s3c_camif_resource), |
| 469 | .resource = s3c_camif_resource, |
| 470 | .dev = { |
| 471 | .dma_mask = &s3c_device_camif_dmamask, |
| 472 | .coherent_dma_mask = 0xffffffffUL |
| 473 | } |
| 474 | }; |
| 475 | |
| 476 | EXPORT_SYMBOL(s3c_device_camif); |
| 477 | |
Mark Brown | d91e9a7 | 2009-08-05 18:29:57 +0100 | [diff] [blame] | 478 | /* AC97 */ |
| 479 | |
| 480 | static struct resource s3c_ac97_resource[] = { |
| 481 | [0] = { |
| 482 | .start = S3C2440_PA_AC97, |
| 483 | .end = S3C2440_PA_AC97 + S3C2440_SZ_AC97 -1, |
| 484 | .flags = IORESOURCE_MEM, |
| 485 | }, |
| 486 | [1] = { |
| 487 | .start = IRQ_S3C244x_AC97, |
| 488 | .end = IRQ_S3C244x_AC97, |
| 489 | .flags = IORESOURCE_IRQ, |
| 490 | }, |
| 491 | [2] = { |
| 492 | .name = "PCM out", |
| 493 | .start = DMACH_PCM_OUT, |
| 494 | .end = DMACH_PCM_OUT, |
| 495 | .flags = IORESOURCE_DMA, |
| 496 | }, |
| 497 | [3] = { |
| 498 | .name = "PCM in", |
| 499 | .start = DMACH_PCM_IN, |
| 500 | .end = DMACH_PCM_IN, |
| 501 | .flags = IORESOURCE_DMA, |
| 502 | }, |
| 503 | [4] = { |
| 504 | .name = "Mic in", |
| 505 | .start = DMACH_MIC_IN, |
| 506 | .end = DMACH_MIC_IN, |
| 507 | .flags = IORESOURCE_DMA, |
| 508 | }, |
| 509 | }; |
| 510 | |
| 511 | static u64 s3c_device_ac97_dmamask = 0xffffffffUL; |
| 512 | |
| 513 | struct platform_device s3c_device_ac97 = { |
| 514 | .name = "s3c-ac97", |
| 515 | .id = -1, |
| 516 | .num_resources = ARRAY_SIZE(s3c_ac97_resource), |
| 517 | .resource = s3c_ac97_resource, |
| 518 | .dev = { |
| 519 | .dma_mask = &s3c_device_ac97_dmamask, |
| 520 | .coherent_dma_mask = 0xffffffffUL |
| 521 | } |
| 522 | }; |
| 523 | |
| 524 | EXPORT_SYMBOL(s3c_device_ac97); |
| 525 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 526 | #endif // CONFIG_CPU_S32440 |