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