aboutsummaryrefslogtreecommitdiffstats
path: root/arch/avr32/mach-at32ap/at32ap7000.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/avr32/mach-at32ap/at32ap7000.c')
-rw-r--r--arch/avr32/mach-at32ap/at32ap7000.c44
1 files changed, 36 insertions, 8 deletions
diff --git a/arch/avr32/mach-at32ap/at32ap7000.c b/arch/avr32/mach-at32ap/at32ap7000.c
index 981d553e471b..c1e477ec7576 100644
--- a/arch/avr32/mach-at32ap/at32ap7000.c
+++ b/arch/avr32/mach-at32ap/at32ap7000.c
@@ -736,12 +736,19 @@ at32_add_device_eth(unsigned int id, struct eth_platform_data *data)
736/* -------------------------------------------------------------------- 736/* --------------------------------------------------------------------
737 * SPI 737 * SPI
738 * -------------------------------------------------------------------- */ 738 * -------------------------------------------------------------------- */
739static struct resource spi0_resource[] = { 739static struct resource atmel_spi0_resource[] = {
740 PBMEM(0xffe00000), 740 PBMEM(0xffe00000),
741 IRQ(3), 741 IRQ(3),
742}; 742};
743DEFINE_DEV(spi, 0); 743DEFINE_DEV(atmel_spi, 0);
744DEV_CLK(mck, spi0, pba, 0); 744DEV_CLK(spi_clk, atmel_spi0, pba, 0);
745
746static struct resource atmel_spi1_resource[] = {
747 PBMEM(0xffe00400),
748 IRQ(4),
749};
750DEFINE_DEV(atmel_spi, 1);
751DEV_CLK(spi_clk, atmel_spi1, pba, 1);
745 752
746struct platform_device *__init at32_add_device_spi(unsigned int id) 753struct platform_device *__init at32_add_device_spi(unsigned int id)
747{ 754{
@@ -749,13 +756,33 @@ struct platform_device *__init at32_add_device_spi(unsigned int id)
749 756
750 switch (id) { 757 switch (id) {
751 case 0: 758 case 0:
752 pdev = &spi0_device; 759 pdev = &atmel_spi0_device;
753 select_peripheral(PA(0), PERIPH_A, 0); /* MISO */ 760 select_peripheral(PA(0), PERIPH_A, 0); /* MISO */
754 select_peripheral(PA(1), PERIPH_A, 0); /* MOSI */ 761 select_peripheral(PA(1), PERIPH_A, 0); /* MOSI */
755 select_peripheral(PA(2), PERIPH_A, 0); /* SCK */ 762 select_peripheral(PA(2), PERIPH_A, 0); /* SCK */
756 select_peripheral(PA(3), PERIPH_A, 0); /* NPCS0 */ 763
757 select_peripheral(PA(4), PERIPH_A, 0); /* NPCS1 */ 764 /* NPCS[2:0] */
758 select_peripheral(PA(5), PERIPH_A, 0); /* NPCS2 */ 765 at32_select_gpio(GPIO_PIN_PA(3),
766 AT32_GPIOF_OUTPUT | AT32_GPIOF_HIGH);
767 at32_select_gpio(GPIO_PIN_PA(4),
768 AT32_GPIOF_OUTPUT | AT32_GPIOF_HIGH);
769 at32_select_gpio(GPIO_PIN_PA(5),
770 AT32_GPIOF_OUTPUT | AT32_GPIOF_HIGH);
771 break;
772
773 case 1:
774 pdev = &atmel_spi1_device;
775 select_peripheral(PB(0), PERIPH_B, 0); /* MISO */
776 select_peripheral(PB(1), PERIPH_B, 0); /* MOSI */
777 select_peripheral(PB(5), PERIPH_B, 0); /* SCK */
778
779 /* NPCS[2:0] */
780 at32_select_gpio(GPIO_PIN_PB(2),
781 AT32_GPIOF_OUTPUT | AT32_GPIOF_HIGH);
782 at32_select_gpio(GPIO_PIN_PB(3),
783 AT32_GPIOF_OUTPUT | AT32_GPIOF_HIGH);
784 at32_select_gpio(GPIO_PIN_PB(4),
785 AT32_GPIOF_OUTPUT | AT32_GPIOF_HIGH);
759 break; 786 break;
760 787
761 default: 788 default:
@@ -877,7 +904,8 @@ struct clk *at32_clock_list[] = {
877 &macb0_pclk, 904 &macb0_pclk,
878 &macb1_hclk, 905 &macb1_hclk,
879 &macb1_pclk, 906 &macb1_pclk,
880 &spi0_mck, 907 &atmel_spi0_spi_clk,
908 &atmel_spi1_spi_clk,
881 &lcdc0_hclk, 909 &lcdc0_hclk,
882 &lcdc0_pixclk, 910 &lcdc0_pixclk,
883}; 911};