Commit 7808fa48 authored by Matteo Vit's avatar Matteo Vit Committed by Haavard Skinnemoen

[AVR32] add multidrive support for pio driver

This patch add multidrive support for pio driver
Signed-off-by: default avatarMatteo Vit - Dave S.r.l. <matteo.vit@dave.eu>
Signed-off-by: default avatarHaavard Skinnemoen <hskinnemoen@atmel.com>
parent d938b893
...@@ -110,6 +110,10 @@ void __init at32_select_gpio(unsigned int pin, unsigned long flags) ...@@ -110,6 +110,10 @@ void __init at32_select_gpio(unsigned int pin, unsigned long flags)
pio_writel(pio, SODR, mask); pio_writel(pio, SODR, mask);
else else
pio_writel(pio, CODR, mask); pio_writel(pio, CODR, mask);
if (flags & AT32_GPIOF_MULTIDRV)
pio_writel(pio, MDER, mask);
else
pio_writel(pio, MDDR, mask);
pio_writel(pio, PUDR, mask); pio_writel(pio, PUDR, mask);
pio_writel(pio, OER, mask); pio_writel(pio, OER, mask);
} else { } else {
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#define AT32_GPIOF_OUTPUT 0x00000002 /* (OUT) Enable output driver */ #define AT32_GPIOF_OUTPUT 0x00000002 /* (OUT) Enable output driver */
#define AT32_GPIOF_HIGH 0x00000004 /* (OUT) Set output high */ #define AT32_GPIOF_HIGH 0x00000004 /* (OUT) Set output high */
#define AT32_GPIOF_DEGLITCH 0x00000008 /* (IN) Filter glitches */ #define AT32_GPIOF_DEGLITCH 0x00000008 /* (IN) Filter glitches */
#define AT32_GPIOF_MULTIDRV 0x00000010 /* Enable multidriver option */
void at32_select_periph(unsigned int pin, unsigned int periph, void at32_select_periph(unsigned int pin, unsigned int periph,
unsigned long flags); unsigned long flags);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment