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