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