diff options
Diffstat (limited to 'arch/arm/mach-pxa/generic.c')
-rw-r--r-- | arch/arm/mach-pxa/generic.c | 93 |
1 files changed, 19 insertions, 74 deletions
diff --git a/arch/arm/mach-pxa/generic.c b/arch/arm/mach-pxa/generic.c index 64b08b744f9f..296539b6359c 100644 --- a/arch/arm/mach-pxa/generic.c +++ b/arch/arm/mach-pxa/generic.c | |||
@@ -43,6 +43,7 @@ | |||
43 | #include <asm/arch/irda.h> | 43 | #include <asm/arch/irda.h> |
44 | #include <asm/arch/i2c.h> | 44 | #include <asm/arch/i2c.h> |
45 | 45 | ||
46 | #include "devices.h" | ||
46 | #include "generic.h" | 47 | #include "generic.h" |
47 | 48 | ||
48 | /* | 49 | /* |
@@ -242,7 +243,7 @@ static struct resource pxamci_resources[] = { | |||
242 | 243 | ||
243 | static u64 pxamci_dmamask = 0xffffffffUL; | 244 | static u64 pxamci_dmamask = 0xffffffffUL; |
244 | 245 | ||
245 | static struct platform_device pxamci_device = { | 246 | struct platform_device pxamci_device = { |
246 | .name = "pxa2xx-mci", | 247 | .name = "pxa2xx-mci", |
247 | .id = -1, | 248 | .id = -1, |
248 | .dev = { | 249 | .dev = { |
@@ -281,7 +282,7 @@ static struct resource pxa2xx_udc_resources[] = { | |||
281 | 282 | ||
282 | static u64 udc_dma_mask = ~(u32)0; | 283 | static u64 udc_dma_mask = ~(u32)0; |
283 | 284 | ||
284 | static struct platform_device udc_device = { | 285 | struct platform_device pxaudc_device = { |
285 | .name = "pxa2xx-udc", | 286 | .name = "pxa2xx-udc", |
286 | .id = -1, | 287 | .id = -1, |
287 | .resource = pxa2xx_udc_resources, | 288 | .resource = pxa2xx_udc_resources, |
@@ -307,7 +308,7 @@ static struct resource pxafb_resources[] = { | |||
307 | 308 | ||
308 | static u64 fb_dma_mask = ~(u64)0; | 309 | static u64 fb_dma_mask = ~(u64)0; |
309 | 310 | ||
310 | static struct platform_device pxafb_device = { | 311 | struct platform_device pxafb_device = { |
311 | .name = "pxa2xx-fb", | 312 | .name = "pxa2xx-fb", |
312 | .id = -1, | 313 | .id = -1, |
313 | .dev = { | 314 | .dev = { |
@@ -328,24 +329,24 @@ void __init set_pxa_fb_parent(struct device *parent_dev) | |||
328 | pxafb_device.dev.parent = parent_dev; | 329 | pxafb_device.dev.parent = parent_dev; |
329 | } | 330 | } |
330 | 331 | ||
331 | static struct platform_device ffuart_device = { | 332 | struct platform_device ffuart_device = { |
332 | .name = "pxa2xx-uart", | 333 | .name = "pxa2xx-uart", |
333 | .id = 0, | 334 | .id = 0, |
334 | }; | 335 | }; |
335 | static struct platform_device btuart_device = { | 336 | struct platform_device btuart_device = { |
336 | .name = "pxa2xx-uart", | 337 | .name = "pxa2xx-uart", |
337 | .id = 1, | 338 | .id = 1, |
338 | }; | 339 | }; |
339 | static struct platform_device stuart_device = { | 340 | struct platform_device stuart_device = { |
340 | .name = "pxa2xx-uart", | 341 | .name = "pxa2xx-uart", |
341 | .id = 2, | 342 | .id = 2, |
342 | }; | 343 | }; |
343 | static struct platform_device hwuart_device = { | 344 | struct platform_device hwuart_device = { |
344 | .name = "pxa2xx-uart", | 345 | .name = "pxa2xx-uart", |
345 | .id = 3, | 346 | .id = 3, |
346 | }; | 347 | }; |
347 | 348 | ||
348 | static struct resource i2c_resources[] = { | 349 | static struct resource pxai2c_resources[] = { |
349 | { | 350 | { |
350 | .start = 0x40301680, | 351 | .start = 0x40301680, |
351 | .end = 0x403016a3, | 352 | .end = 0x403016a3, |
@@ -357,40 +358,19 @@ static struct resource i2c_resources[] = { | |||
357 | }, | 358 | }, |
358 | }; | 359 | }; |
359 | 360 | ||
360 | static struct platform_device i2c_device = { | 361 | struct platform_device pxai2c_device = { |
361 | .name = "pxa2xx-i2c", | 362 | .name = "pxa2xx-i2c", |
362 | .id = 0, | 363 | .id = 0, |
363 | .resource = i2c_resources, | 364 | .resource = pxai2c_resources, |
364 | .num_resources = ARRAY_SIZE(i2c_resources), | 365 | .num_resources = ARRAY_SIZE(pxai2c_resources), |
365 | }; | 366 | }; |
366 | 367 | ||
367 | #ifdef CONFIG_PXA27x | ||
368 | static struct resource i2c_power_resources[] = { | ||
369 | { | ||
370 | .start = 0x40f00180, | ||
371 | .end = 0x40f001a3, | ||
372 | .flags = IORESOURCE_MEM, | ||
373 | }, { | ||
374 | .start = IRQ_PWRI2C, | ||
375 | .end = IRQ_PWRI2C, | ||
376 | .flags = IORESOURCE_IRQ, | ||
377 | }, | ||
378 | }; | ||
379 | |||
380 | static struct platform_device i2c_power_device = { | ||
381 | .name = "pxa2xx-i2c", | ||
382 | .id = 1, | ||
383 | .resource = i2c_power_resources, | ||
384 | .num_resources = ARRAY_SIZE(i2c_resources), | ||
385 | }; | ||
386 | #endif | ||
387 | |||
388 | void __init pxa_set_i2c_info(struct i2c_pxa_platform_data *info) | 368 | void __init pxa_set_i2c_info(struct i2c_pxa_platform_data *info) |
389 | { | 369 | { |
390 | i2c_device.dev.platform_data = info; | 370 | pxai2c_device.dev.platform_data = info; |
391 | } | 371 | } |
392 | 372 | ||
393 | static struct resource i2s_resources[] = { | 373 | static struct resource pxai2s_resources[] = { |
394 | { | 374 | { |
395 | .start = 0x40400000, | 375 | .start = 0x40400000, |
396 | .end = 0x40400083, | 376 | .end = 0x40400083, |
@@ -402,16 +382,16 @@ static struct resource i2s_resources[] = { | |||
402 | }, | 382 | }, |
403 | }; | 383 | }; |
404 | 384 | ||
405 | static struct platform_device i2s_device = { | 385 | struct platform_device pxai2s_device = { |
406 | .name = "pxa2xx-i2s", | 386 | .name = "pxa2xx-i2s", |
407 | .id = -1, | 387 | .id = -1, |
408 | .resource = i2s_resources, | 388 | .resource = pxai2s_resources, |
409 | .num_resources = ARRAY_SIZE(i2s_resources), | 389 | .num_resources = ARRAY_SIZE(pxai2s_resources), |
410 | }; | 390 | }; |
411 | 391 | ||
412 | static u64 pxaficp_dmamask = ~(u32)0; | 392 | static u64 pxaficp_dmamask = ~(u32)0; |
413 | 393 | ||
414 | static struct platform_device pxaficp_device = { | 394 | struct platform_device pxaficp_device = { |
415 | .name = "pxa2xx-ir", | 395 | .name = "pxa2xx-ir", |
416 | .id = -1, | 396 | .id = -1, |
417 | .dev = { | 397 | .dev = { |
@@ -425,42 +405,7 @@ void __init pxa_set_ficp_info(struct pxaficp_platform_data *info) | |||
425 | pxaficp_device.dev.platform_data = info; | 405 | pxaficp_device.dev.platform_data = info; |
426 | } | 406 | } |
427 | 407 | ||
428 | static struct platform_device pxartc_device = { | 408 | struct platform_device pxartc_device = { |
429 | .name = "sa1100-rtc", | 409 | .name = "sa1100-rtc", |
430 | .id = -1, | 410 | .id = -1, |
431 | }; | 411 | }; |
432 | |||
433 | static struct platform_device *devices[] __initdata = { | ||
434 | &pxamci_device, | ||
435 | &udc_device, | ||
436 | &pxafb_device, | ||
437 | &ffuart_device, | ||
438 | &btuart_device, | ||
439 | &stuart_device, | ||
440 | &pxaficp_device, | ||
441 | &i2c_device, | ||
442 | #ifdef CONFIG_PXA27x | ||
443 | &i2c_power_device, | ||
444 | #endif | ||
445 | &i2s_device, | ||
446 | &pxartc_device, | ||
447 | }; | ||
448 | |||
449 | static int __init pxa_init(void) | ||
450 | { | ||
451 | int cpuid, ret; | ||
452 | |||
453 | ret = platform_add_devices(devices, ARRAY_SIZE(devices)); | ||
454 | if (ret) | ||
455 | return ret; | ||
456 | |||
457 | /* Only add HWUART for PXA255/26x; PXA210/250/27x do not have it. */ | ||
458 | cpuid = read_cpuid(CPUID_ID); | ||
459 | if (((cpuid >> 4) & 0xfff) == 0x2d0 || | ||
460 | ((cpuid >> 4) & 0xfff) == 0x290) | ||
461 | ret = platform_device_register(&hwuart_device); | ||
462 | |||
463 | return ret; | ||
464 | } | ||
465 | |||
466 | subsys_initcall(pxa_init); | ||