| Haavard Skinnemoen | 5f97f7f | 2006-09-25 23:32:13 -0700 | [diff] [blame] | 1 | /* | 
|  | 2 | * AT32 portmux interface. | 
|  | 3 | * | 
|  | 4 | * Copyright (C) 2006 Atmel Corporation | 
|  | 5 | * | 
|  | 6 | * This program is free software; you can redistribute it and/or modify | 
|  | 7 | * it under the terms of the GNU General Public License version 2 as | 
|  | 8 | * published by the Free Software Foundation. | 
|  | 9 | */ | 
| Haavard Skinnemoen | c3e2a79 | 2006-12-04 13:46:52 +0100 | [diff] [blame] | 10 | #ifndef __ASM_ARCH_PORTMUX_H__ | 
|  | 11 | #define __ASM_ARCH_PORTMUX_H__ | 
| Haavard Skinnemoen | 5f97f7f | 2006-09-25 23:32:13 -0700 | [diff] [blame] | 12 |  | 
| Haavard Skinnemoen | c3e2a79 | 2006-12-04 13:46:52 +0100 | [diff] [blame] | 13 | /* | 
|  | 14 | * Set up pin multiplexing, called from board init only. | 
|  | 15 | * | 
|  | 16 | * The following flags determine the initial state of the pin. | 
|  | 17 | */ | 
| Haavard Skinnemoen | 6a4e522 | 2007-02-05 16:57:13 +0100 | [diff] [blame] | 18 | #define AT32_GPIOF_PULLUP	0x00000001	/* (not-OUT) Enable pull-up */ | 
|  | 19 | #define AT32_GPIOF_OUTPUT	0x00000002	/* (OUT) Enable output driver */ | 
|  | 20 | #define AT32_GPIOF_HIGH		0x00000004	/* (OUT) Set output high */ | 
|  | 21 | #define AT32_GPIOF_DEGLITCH	0x00000008	/* (IN) Filter glitches */ | 
| Matteo Vit | 7808fa4 | 2007-08-09 14:55:34 +0200 | [diff] [blame] | 22 | #define AT32_GPIOF_MULTIDRV	0x00000010	/* Enable multidriver option */ | 
| Haavard Skinnemoen | 5f97f7f | 2006-09-25 23:32:13 -0700 | [diff] [blame] | 23 |  | 
| Haavard Skinnemoen | c3e2a79 | 2006-12-04 13:46:52 +0100 | [diff] [blame] | 24 | void at32_select_periph(unsigned int pin, unsigned int periph, | 
|  | 25 | unsigned long flags); | 
|  | 26 | void at32_select_gpio(unsigned int pin, unsigned long flags); | 
| Haavard Skinnemoen | e7f70b8 | 2007-01-30 11:01:23 +0100 | [diff] [blame] | 27 | void at32_reserve_pin(unsigned int pin); | 
| Haavard Skinnemoen | c3e2a79 | 2006-12-04 13:46:52 +0100 | [diff] [blame] | 28 |  | 
|  | 29 | #endif /* __ASM_ARCH_PORTMUX_H__ */ |