aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-at91
diff options
context:
space:
mode:
authorAndrew Victor <andrew@sanpeople.com>2007-05-02 12:46:49 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2007-05-03 09:10:22 -0400
commit7776a94c311504f26e73060920dfb3ccf02786b7 (patch)
treea3fad56e267e62ce83f85d3470c14d4681c7484c /arch/arm/mach-at91
parente8788babe6ddb35ab041a146d6b3e18874513566 (diff)
[ARM] 4352/1: AT91: Platform data for LCD and AC97.
Define resources, platform_device and device registration functions for the LCD and AC97 controllers on the AT91SAM9263. Also update the AT91SAM9261 to use the common atmel_lcdfb driver. Signed-off-by: Nicolas Ferre <nicolas.ferre@rfo.atmel.com> Signed-off-by: Andrew Victor <andrew@sanpeople.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-at91')
-rw-r--r--arch/arm/mach-at91/at91sam9261_devices.c10
-rw-r--r--arch/arm/mach-at91/at91sam9263_devices.c124
2 files changed, 129 insertions, 5 deletions
diff --git a/arch/arm/mach-at91/at91sam9261_devices.c b/arch/arm/mach-at91/at91sam9261_devices.c
index e1504766fd64..8e781997716a 100644
--- a/arch/arm/mach-at91/at91sam9261_devices.c
+++ b/arch/arm/mach-at91/at91sam9261_devices.c
@@ -430,9 +430,9 @@ void __init at91_add_device_spi(struct spi_board_info *devices, int nr_devices)
430 * LCD Controller 430 * LCD Controller
431 * -------------------------------------------------------------------- */ 431 * -------------------------------------------------------------------- */
432 432
433#if defined(CONFIG_FB_AT91) || defined(CONFIG_FB_AT91_MODULE) 433#if defined(CONFIG_FB_ATMEL) || defined(CONFIG_FB_ATMEL_MODULE)
434static u64 lcdc_dmamask = 0xffffffffUL; 434static u64 lcdc_dmamask = 0xffffffffUL;
435static struct at91fb_info lcdc_data; 435static struct atmel_lcdfb_info lcdc_data;
436 436
437static struct resource lcdc_resources[] = { 437static struct resource lcdc_resources[] = {
438 [0] = { 438 [0] = {
@@ -455,7 +455,7 @@ static struct resource lcdc_resources[] = {
455}; 455};
456 456
457static struct platform_device at91_lcdc_device = { 457static struct platform_device at91_lcdc_device = {
458 .name = "at91-fb", 458 .name = "atmel_lcdfb",
459 .id = 0, 459 .id = 0,
460 .dev = { 460 .dev = {
461 .dma_mask = &lcdc_dmamask, 461 .dma_mask = &lcdc_dmamask,
@@ -466,7 +466,7 @@ static struct platform_device at91_lcdc_device = {
466 .num_resources = ARRAY_SIZE(lcdc_resources), 466 .num_resources = ARRAY_SIZE(lcdc_resources),
467}; 467};
468 468
469void __init at91_add_device_lcdc(struct at91fb_info *data) 469void __init at91_add_device_lcdc(struct atmel_lcdfb_info *data)
470{ 470{
471 if (!data) { 471 if (!data) {
472 return; 472 return;
@@ -499,7 +499,7 @@ void __init at91_add_device_lcdc(struct at91fb_info *data)
499 platform_device_register(&at91_lcdc_device); 499 platform_device_register(&at91_lcdc_device);
500} 500}
501#else 501#else
502void __init at91_add_device_lcdc(struct at91fb_info *data) {} 502void __init at91_add_device_lcdc(struct atmel_lcdfb_info *data) {}
503#endif 503#endif
504 504
505 505
diff --git a/arch/arm/mach-at91/at91sam9263_devices.c b/arch/arm/mach-at91/at91sam9263_devices.c
index b77121f27f34..2b2e18a67128 100644
--- a/arch/arm/mach-at91/at91sam9263_devices.c
+++ b/arch/arm/mach-at91/at91sam9263_devices.c
@@ -573,6 +573,130 @@ void __init at91_add_device_spi(struct spi_board_info *devices, int nr_devices)
573 573
574 574
575/* -------------------------------------------------------------------- 575/* --------------------------------------------------------------------
576 * AC97
577 * -------------------------------------------------------------------- */
578
579#if defined(CONFIG_SND_AT91_AC97) || defined(CONFIG_SND_AT91_AC97_MODULE)
580static u64 ac97_dmamask = 0xffffffffUL;
581static struct atmel_ac97_data ac97_data;
582
583static struct resource ac97_resources[] = {
584 [0] = {
585 .start = AT91SAM9263_BASE_AC97C,
586 .end = AT91SAM9263_BASE_AC97C + SZ_16K - 1,
587 .flags = IORESOURCE_MEM,
588 },
589 [1] = {
590 .start = AT91SAM9263_ID_AC97C,
591 .end = AT91SAM9263_ID_AC97C,
592 .flags = IORESOURCE_IRQ,
593 },
594};
595
596static struct platform_device at91sam9263_ac97_device = {
597 .name = "ac97c",
598 .id = 1,
599 .dev = {
600 .dma_mask = &ac97_dmamask,
601 .coherent_dma_mask = 0xffffffff,
602 .platform_data = &ac97_data,
603 },
604 .resource = ac97_resources,
605 .num_resources = ARRAY_SIZE(ac97_resources),
606};
607
608void __init at91_add_device_ac97(struct atmel_ac97_data *data)
609{
610 if (!data)
611 return;
612
613 at91_set_A_periph(AT91_PIN_PB0, 0); /* AC97FS */
614 at91_set_A_periph(AT91_PIN_PB1, 0); /* AC97CK */
615 at91_set_A_periph(AT91_PIN_PB2, 0); /* AC97TX */
616 at91_set_A_periph(AT91_PIN_PB3, 0); /* AC97RX */
617
618 /* reset */
619 if (data->reset_pin)
620 at91_set_gpio_output(data->reset_pin, 0);
621
622 ac97_data = *ek_data;
623 platform_device_register(&at91sam9263_ac97_device);
624}
625#else
626void __init at91_add_device_ac97(struct atmel_ac97_data *data) {}
627#endif
628
629
630/* --------------------------------------------------------------------
631 * LCD Controller
632 * -------------------------------------------------------------------- */
633
634#if defined(CONFIG_FB_ATMEL) || defined(CONFIG_FB_ATMEL_MODULE)
635static u64 lcdc_dmamask = 0xffffffffUL;
636static struct atmel_lcdfb_info lcdc_data;
637
638static struct resource lcdc_resources[] = {
639 [0] = {
640 .start = AT91SAM9263_LCDC_BASE,
641 .end = AT91SAM9263_LCDC_BASE + SZ_4K - 1,
642 .flags = IORESOURCE_MEM,
643 },
644 [1] = {
645 .start = AT91SAM9263_ID_LCDC,
646 .end = AT91SAM9263_ID_LCDC,
647 .flags = IORESOURCE_IRQ,
648 },
649};
650
651static struct platform_device at91_lcdc_device = {
652 .name = "atmel_lcdfb",
653 .id = 0,
654 .dev = {
655 .dma_mask = &lcdc_dmamask,
656 .coherent_dma_mask = 0xffffffff,
657 .platform_data = &lcdc_data,
658 },
659 .resource = lcdc_resources,
660 .num_resources = ARRAY_SIZE(lcdc_resources),
661};
662
663void __init at91_add_device_lcdc(struct atmel_lcdfb_info *data)
664{
665 if (!data)
666 return;
667
668 at91_set_A_periph(AT91_PIN_PC1, 0); /* LCDHSYNC */
669 at91_set_A_periph(AT91_PIN_PC2, 0); /* LCDDOTCK */
670 at91_set_A_periph(AT91_PIN_PC3, 0); /* LCDDEN */
671 at91_set_B_periph(AT91_PIN_PB9, 0); /* LCDCC */
672 at91_set_A_periph(AT91_PIN_PC6, 0); /* LCDD2 */
673 at91_set_A_periph(AT91_PIN_PC7, 0); /* LCDD3 */
674 at91_set_A_periph(AT91_PIN_PC8, 0); /* LCDD4 */
675 at91_set_A_periph(AT91_PIN_PC9, 0); /* LCDD5 */
676 at91_set_A_periph(AT91_PIN_PC10, 0); /* LCDD6 */
677 at91_set_A_periph(AT91_PIN_PC11, 0); /* LCDD7 */
678 at91_set_A_periph(AT91_PIN_PC14, 0); /* LCDD10 */
679 at91_set_A_periph(AT91_PIN_PC15, 0); /* LCDD11 */
680 at91_set_A_periph(AT91_PIN_PC16, 0); /* LCDD12 */
681 at91_set_B_periph(AT91_PIN_PC12, 0); /* LCDD13 */
682 at91_set_A_periph(AT91_PIN_PC18, 0); /* LCDD14 */
683 at91_set_A_periph(AT91_PIN_PC19, 0); /* LCDD15 */
684 at91_set_A_periph(AT91_PIN_PC22, 0); /* LCDD18 */
685 at91_set_A_periph(AT91_PIN_PC23, 0); /* LCDD19 */
686 at91_set_A_periph(AT91_PIN_PC24, 0); /* LCDD20 */
687 at91_set_B_periph(AT91_PIN_PC17, 0); /* LCDD21 */
688 at91_set_A_periph(AT91_PIN_PC26, 0); /* LCDD22 */
689 at91_set_A_periph(AT91_PIN_PC27, 0); /* LCDD23 */
690
691 lcdc_data = *data;
692 platform_device_register(&at91_lcdc_device);
693}
694#else
695void __init at91_add_device_lcdc(struct atmel_lcdfb_info *data) {}
696#endif
697
698
699/* --------------------------------------------------------------------
576 * LEDs 700 * LEDs
577 * -------------------------------------------------------------------- */ 701 * -------------------------------------------------------------------- */
578 702