aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-avr32/arch-at32ap
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-avr32/arch-at32ap')
-rw-r--r--include/asm-avr32/arch-at32ap/at32ap7000.h2
-rw-r--r--include/asm-avr32/arch-at32ap/board.h4
-rw-r--r--include/asm-avr32/arch-at32ap/gpio.h27
-rw-r--r--include/asm-avr32/arch-at32ap/irq.h14
-rw-r--r--include/asm-avr32/arch-at32ap/portmux.h8
5 files changed, 51 insertions, 4 deletions
diff --git a/include/asm-avr32/arch-at32ap/at32ap7000.h b/include/asm-avr32/arch-at32ap/at32ap7000.h
index ba85e04553d4..3914d7b94ff4 100644
--- a/include/asm-avr32/arch-at32ap/at32ap7000.h
+++ b/include/asm-avr32/arch-at32ap/at32ap7000.h
@@ -24,10 +24,12 @@
24#define GPIO_PIOB_BASE (GPIO_PIOA_BASE + 32) 24#define GPIO_PIOB_BASE (GPIO_PIOA_BASE + 32)
25#define GPIO_PIOC_BASE (GPIO_PIOB_BASE + 32) 25#define GPIO_PIOC_BASE (GPIO_PIOB_BASE + 32)
26#define GPIO_PIOD_BASE (GPIO_PIOC_BASE + 32) 26#define GPIO_PIOD_BASE (GPIO_PIOC_BASE + 32)
27#define GPIO_PIOE_BASE (GPIO_PIOD_BASE + 32)
27 28
28#define GPIO_PIN_PA(N) (GPIO_PIOA_BASE + (N)) 29#define GPIO_PIN_PA(N) (GPIO_PIOA_BASE + (N))
29#define GPIO_PIN_PB(N) (GPIO_PIOB_BASE + (N)) 30#define GPIO_PIN_PB(N) (GPIO_PIOB_BASE + (N))
30#define GPIO_PIN_PC(N) (GPIO_PIOC_BASE + (N)) 31#define GPIO_PIN_PC(N) (GPIO_PIOC_BASE + (N))
31#define GPIO_PIN_PD(N) (GPIO_PIOD_BASE + (N)) 32#define GPIO_PIN_PD(N) (GPIO_PIOD_BASE + (N))
33#define GPIO_PIN_PE(N) (GPIO_PIOE_BASE + (N))
32 34
33#endif /* __ASM_ARCH_AT32AP7000_H__ */ 35#endif /* __ASM_ARCH_AT32AP7000_H__ */
diff --git a/include/asm-avr32/arch-at32ap/board.h b/include/asm-avr32/arch-at32ap/board.h
index b120ee030c86..1a7b07d436ff 100644
--- a/include/asm-avr32/arch-at32ap/board.h
+++ b/include/asm-avr32/arch-at32ap/board.h
@@ -26,7 +26,9 @@ struct eth_platform_data {
26struct platform_device * 26struct platform_device *
27at32_add_device_eth(unsigned int id, struct eth_platform_data *data); 27at32_add_device_eth(unsigned int id, struct eth_platform_data *data);
28 28
29struct platform_device *at32_add_device_spi(unsigned int id); 29struct spi_board_info;
30struct platform_device *
31at32_add_device_spi(unsigned int id, struct spi_board_info *b, unsigned int n);
30 32
31struct lcdc_platform_data { 33struct lcdc_platform_data {
32 unsigned long fbmem_start; 34 unsigned long fbmem_start;
diff --git a/include/asm-avr32/arch-at32ap/gpio.h b/include/asm-avr32/arch-at32ap/gpio.h
new file mode 100644
index 000000000000..fcb756bdaa8e
--- /dev/null
+++ b/include/asm-avr32/arch-at32ap/gpio.h
@@ -0,0 +1,27 @@
1#ifndef __ASM_AVR32_ARCH_GPIO_H
2#define __ASM_AVR32_ARCH_GPIO_H
3
4#include <linux/compiler.h>
5#include <asm/irq.h>
6
7
8/* Arch-neutral GPIO API */
9int __must_check gpio_request(unsigned int gpio, const char *label);
10void gpio_free(unsigned int gpio);
11
12int gpio_direction_input(unsigned int gpio);
13int gpio_direction_output(unsigned int gpio);
14int gpio_get_value(unsigned int gpio);
15void gpio_set_value(unsigned int gpio, int value);
16
17static inline int gpio_to_irq(unsigned int gpio)
18{
19 return gpio + GPIO_IRQ_BASE;
20}
21
22static inline int irq_to_gpio(unsigned int irq)
23{
24 return irq - GPIO_IRQ_BASE;
25}
26
27#endif /* __ASM_AVR32_ARCH_GPIO_H */
diff --git a/include/asm-avr32/arch-at32ap/irq.h b/include/asm-avr32/arch-at32ap/irq.h
new file mode 100644
index 000000000000..5adffab9a577
--- /dev/null
+++ b/include/asm-avr32/arch-at32ap/irq.h
@@ -0,0 +1,14 @@
1#ifndef __ASM_AVR32_ARCH_IRQ_H
2#define __ASM_AVR32_ARCH_IRQ_H
3
4#define EIM_IRQ_BASE NR_INTERNAL_IRQS
5#define NR_EIM_IRQS 32
6
7#define AT32_EXTINT(n) (EIM_IRQ_BASE + (n))
8
9#define GPIO_IRQ_BASE (EIM_IRQ_BASE + NR_EIM_IRQS)
10#define NR_GPIO_IRQS (5 * 32)
11
12#define NR_IRQS (GPIO_IRQ_BASE + NR_GPIO_IRQS)
13
14#endif /* __ASM_AVR32_ARCH_IRQ_H */
diff --git a/include/asm-avr32/arch-at32ap/portmux.h b/include/asm-avr32/arch-at32ap/portmux.h
index 83c690571322..9930871decde 100644
--- a/include/asm-avr32/arch-at32ap/portmux.h
+++ b/include/asm-avr32/arch-at32ap/portmux.h
@@ -15,12 +15,14 @@
15 * 15 *
16 * The following flags determine the initial state of the pin. 16 * The following flags determine the initial state of the pin.
17 */ 17 */
18#define AT32_GPIOF_PULLUP 0x00000001 /* Enable pull-up */ 18#define AT32_GPIOF_PULLUP 0x00000001 /* (not-OUT) Enable pull-up */
19#define AT32_GPIOF_OUTPUT 0x00000002 /* Enable output driver */ 19#define AT32_GPIOF_OUTPUT 0x00000002 /* (OUT) Enable output driver */
20#define AT32_GPIOF_HIGH 0x00000004 /* Set output high */ 20#define AT32_GPIOF_HIGH 0x00000004 /* (OUT) Set output high */
21#define AT32_GPIOF_DEGLITCH 0x00000008 /* (IN) Filter glitches */
21 22
22void at32_select_periph(unsigned int pin, unsigned int periph, 23void at32_select_periph(unsigned int pin, unsigned int periph,
23 unsigned long flags); 24 unsigned long flags);
24void at32_select_gpio(unsigned int pin, unsigned long flags); 25void at32_select_gpio(unsigned int pin, unsigned long flags);
26void at32_reserve_pin(unsigned int pin);
25 27
26#endif /* __ASM_ARCH_PORTMUX_H__ */ 28#endif /* __ASM_ARCH_PORTMUX_H__ */