diff options
Diffstat (limited to 'arch/arm/mach-s5p64x0/common.c')
-rw-r--r-- | arch/arm/mach-s5p64x0/common.c | 55 |
1 files changed, 17 insertions, 38 deletions
diff --git a/arch/arm/mach-s5p64x0/common.c b/arch/arm/mach-s5p64x0/common.c index b7555a0fb0fb..52b89a376447 100644 --- a/arch/arm/mach-s5p64x0/common.c +++ b/arch/arm/mach-s5p64x0/common.c | |||
@@ -17,7 +17,7 @@ | |||
17 | #include <linux/init.h> | 17 | #include <linux/init.h> |
18 | #include <linux/clk.h> | 18 | #include <linux/clk.h> |
19 | #include <linux/io.h> | 19 | #include <linux/io.h> |
20 | #include <linux/sysdev.h> | 20 | #include <linux/device.h> |
21 | #include <linux/serial_core.h> | 21 | #include <linux/serial_core.h> |
22 | #include <linux/platform_device.h> | 22 | #include <linux/platform_device.h> |
23 | #include <linux/sched.h> | 23 | #include <linux/sched.h> |
@@ -40,6 +40,7 @@ | |||
40 | #include <plat/clock.h> | 40 | #include <plat/clock.h> |
41 | #include <plat/devs.h> | 41 | #include <plat/devs.h> |
42 | #include <plat/pm.h> | 42 | #include <plat/pm.h> |
43 | #include <plat/sdhci.h> | ||
43 | #include <plat/adc-core.h> | 44 | #include <plat/adc-core.h> |
44 | #include <plat/fb-core.h> | 45 | #include <plat/fb-core.h> |
45 | #include <plat/gpio-cfg.h> | 46 | #include <plat/gpio-cfg.h> |
@@ -181,6 +182,10 @@ void __init s5p6440_map_io(void) | |||
181 | s3c_adc_setname("s3c64xx-adc"); | 182 | s3c_adc_setname("s3c64xx-adc"); |
182 | s3c_fb_setname("s5p64x0-fb"); | 183 | s3c_fb_setname("s5p64x0-fb"); |
183 | 184 | ||
185 | s5p64x0_default_sdhci0(); | ||
186 | s5p64x0_default_sdhci1(); | ||
187 | s5p6440_default_sdhci2(); | ||
188 | |||
184 | iotable_init(s5p6440_iodesc, ARRAY_SIZE(s5p6440_iodesc)); | 189 | iotable_init(s5p6440_iodesc, ARRAY_SIZE(s5p6440_iodesc)); |
185 | init_consistent_dma_size(SZ_8M); | 190 | init_consistent_dma_size(SZ_8M); |
186 | } | 191 | } |
@@ -191,6 +196,10 @@ void __init s5p6450_map_io(void) | |||
191 | s3c_adc_setname("s3c64xx-adc"); | 196 | s3c_adc_setname("s3c64xx-adc"); |
192 | s3c_fb_setname("s5p64x0-fb"); | 197 | s3c_fb_setname("s5p64x0-fb"); |
193 | 198 | ||
199 | s5p64x0_default_sdhci0(); | ||
200 | s5p64x0_default_sdhci1(); | ||
201 | s5p6450_default_sdhci2(); | ||
202 | |||
194 | iotable_init(s5p6450_iodesc, ARRAY_SIZE(s5p6450_iodesc)); | 203 | iotable_init(s5p6450_iodesc, ARRAY_SIZE(s5p6450_iodesc)); |
195 | init_consistent_dma_size(SZ_8M); | 204 | init_consistent_dma_size(SZ_8M); |
196 | } | 205 | } |
@@ -257,17 +266,18 @@ void __init s5p6450_init_irq(void) | |||
257 | s5p_init_irq(vic, ARRAY_SIZE(vic)); | 266 | s5p_init_irq(vic, ARRAY_SIZE(vic)); |
258 | } | 267 | } |
259 | 268 | ||
260 | struct sysdev_class s5p64x0_sysclass = { | 269 | struct bus_type s5p64x0_subsys = { |
261 | .name = "s5p64x0-core", | 270 | .name = "s5p64x0-core", |
271 | .dev_name = "s5p64x0-core", | ||
262 | }; | 272 | }; |
263 | 273 | ||
264 | static struct sys_device s5p64x0_sysdev = { | 274 | static struct device s5p64x0_dev = { |
265 | .cls = &s5p64x0_sysclass, | 275 | .bus = &s5p64x0_subsys, |
266 | }; | 276 | }; |
267 | 277 | ||
268 | static int __init s5p64x0_core_init(void) | 278 | static int __init s5p64x0_core_init(void) |
269 | { | 279 | { |
270 | return sysdev_class_register(&s5p64x0_sysclass); | 280 | return subsys_system_register(&s5p64x0_subsys, NULL); |
271 | } | 281 | } |
272 | core_initcall(s5p64x0_core_init); | 282 | core_initcall(s5p64x0_core_init); |
273 | 283 | ||
@@ -278,39 +288,10 @@ int __init s5p64x0_init(void) | |||
278 | /* set idle function */ | 288 | /* set idle function */ |
279 | pm_idle = s5p64x0_idle; | 289 | pm_idle = s5p64x0_idle; |
280 | 290 | ||
281 | return sysdev_register(&s5p64x0_sysdev); | 291 | return device_register(&s5p64x0_dev); |
282 | } | 292 | } |
283 | 293 | ||
284 | static struct s3c24xx_uart_clksrc s5p64x0_serial_clocks[] = { | ||
285 | [0] = { | ||
286 | .name = "pclk_low", | ||
287 | .divisor = 1, | ||
288 | .min_baud = 0, | ||
289 | .max_baud = 0, | ||
290 | }, | ||
291 | [1] = { | ||
292 | .name = "uclk1", | ||
293 | .divisor = 1, | ||
294 | .min_baud = 0, | ||
295 | .max_baud = 0, | ||
296 | }, | ||
297 | }; | ||
298 | |||
299 | /* uart registration process */ | 294 | /* uart registration process */ |
300 | |||
301 | void __init s5p64x0_common_init_uarts(struct s3c2410_uartcfg *cfg, int no) | ||
302 | { | ||
303 | struct s3c2410_uartcfg *tcfg = cfg; | ||
304 | u32 ucnt; | ||
305 | |||
306 | for (ucnt = 0; ucnt < no; ucnt++, tcfg++) { | ||
307 | if (!tcfg->clocks) { | ||
308 | tcfg->clocks = s5p64x0_serial_clocks; | ||
309 | tcfg->clocks_size = ARRAY_SIZE(s5p64x0_serial_clocks); | ||
310 | } | ||
311 | } | ||
312 | } | ||
313 | |||
314 | void __init s5p6440_init_uarts(struct s3c2410_uartcfg *cfg, int no) | 295 | void __init s5p6440_init_uarts(struct s3c2410_uartcfg *cfg, int no) |
315 | { | 296 | { |
316 | int uart; | 297 | int uart; |
@@ -320,13 +301,11 @@ void __init s5p6440_init_uarts(struct s3c2410_uartcfg *cfg, int no) | |||
320 | s5p_uart_resources[uart].resources->end = S5P6440_PA_UART(uart) + S5P_SZ_UART; | 301 | s5p_uart_resources[uart].resources->end = S5P6440_PA_UART(uart) + S5P_SZ_UART; |
321 | } | 302 | } |
322 | 303 | ||
323 | s5p64x0_common_init_uarts(cfg, no); | ||
324 | s3c24xx_init_uartdevs("s3c6400-uart", s5p_uart_resources, cfg, no); | 304 | s3c24xx_init_uartdevs("s3c6400-uart", s5p_uart_resources, cfg, no); |
325 | } | 305 | } |
326 | 306 | ||
327 | void __init s5p6450_init_uarts(struct s3c2410_uartcfg *cfg, int no) | 307 | void __init s5p6450_init_uarts(struct s3c2410_uartcfg *cfg, int no) |
328 | { | 308 | { |
329 | s5p64x0_common_init_uarts(cfg, no); | ||
330 | s3c24xx_init_uartdevs("s3c6400-uart", s5p_uart_resources, cfg, no); | 309 | s3c24xx_init_uartdevs("s3c6400-uart", s5p_uart_resources, cfg, no); |
331 | } | 310 | } |
332 | 311 | ||