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