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