AVR32: Add clk and gpio infrastructure for mmci
authorHaavard Skinnemoen <hskinnemoen@atmel.com>
Sun, 17 Dec 2006 17:55:37 +0000 (18:55 +0100)
committerHaavard Skinnemoen <hskinnemoen@atmel.com>
Sat, 14 Apr 2007 14:14:06 +0000 (16:14 +0200)
Implement functions for configuring the mmci pins, as well as
functions for getting the clock rate of the mmci controller.

Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
cpu/at32ap/at32ap7000/gpio.c
include/asm-avr32/arch-at32ap7000/clk.h
include/asm-avr32/arch-at32ap7000/gpio.h

index cab5bf0dd12dc705171ed3bd24def3299f7c5fd9..52f5372a607af95fad45eadc3146e71f6813da7d 100644 (file)
@@ -125,3 +125,13 @@ void gpio_enable_macb1(void)
        gpio_select_periph_B(GPIO_PIN_PD15, 0); /* SPD  */
 #endif
 }
+
+void gpio_enable_mmci(void)
+{
+       gpio_select_periph_A(GPIO_PIN_PA10, 0); /* CLK   */
+       gpio_select_periph_A(GPIO_PIN_PA11, 0); /* CMD   */
+       gpio_select_periph_A(GPIO_PIN_PA12, 0); /* DATA0 */
+       gpio_select_periph_A(GPIO_PIN_PA13, 0); /* DATA1 */
+       gpio_select_periph_A(GPIO_PIN_PA14, 0); /* DATA2 */
+       gpio_select_periph_A(GPIO_PIN_PA15, 0); /* DATA3 */
+}
index 1ca5b48955ed4a4fdedff0bed4932233478e31fd..7e20d97b7f94132819ba737b0fa1421401d3eeb6 100644 (file)
@@ -62,5 +62,9 @@ static inline unsigned long get_macb_hclk_rate(unsigned int dev_id)
 {
        return get_hsb_clk_rate();
 }
+static inline unsigned long get_mci_clk_rate(void)
+{
+       return get_pbb_clk_rate();
+}
 
 #endif /* __ASM_AVR32_ARCH_CLK_H__ */
index ca966e13428df28a6765cf532a484ed660479313..8d9b092750c2624b92d0961f53da047c14d0f56c 100644 (file)
@@ -207,6 +207,7 @@ void gpio_enable_usart2(void);
 void gpio_enable_usart3(void);
 void gpio_enable_macb0(void);
 void gpio_enable_macb1(void);
+void gpio_enable_mmci(void);
 
 #endif /* __ASM_AVR32_ARCH_GPIO_H__ */