diff options
Diffstat (limited to 'include/asm-avr32')
-rw-r--r-- | include/asm-avr32/arch-at32ap/at32ap7000.h | 2 | ||||
-rw-r--r-- | include/asm-avr32/arch-at32ap/gpio.h | 27 | ||||
-rw-r--r-- | include/asm-avr32/arch-at32ap/irq.h | 14 | ||||
-rw-r--r-- | include/asm-avr32/arch-at32ap/portmux.h | 8 | ||||
-rw-r--r-- | include/asm-avr32/checksum.h | 2 | ||||
-rw-r--r-- | include/asm-avr32/dma-mapping.h | 8 | ||||
-rw-r--r-- | include/asm-avr32/gpio.h | 6 | ||||
-rw-r--r-- | include/asm-avr32/irq.h | 8 | ||||
-rw-r--r-- | include/asm-avr32/posix_types.h | 2 | ||||
-rw-r--r-- | include/asm-avr32/uaccess.h | 6 |
10 files changed, 70 insertions, 13 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/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 */ | ||
9 | int __must_check gpio_request(unsigned int gpio, const char *label); | ||
10 | void gpio_free(unsigned int gpio); | ||
11 | |||
12 | int gpio_direction_input(unsigned int gpio); | ||
13 | int gpio_direction_output(unsigned int gpio); | ||
14 | int gpio_get_value(unsigned int gpio); | ||
15 | void gpio_set_value(unsigned int gpio, int value); | ||
16 | |||
17 | static inline int gpio_to_irq(unsigned int gpio) | ||
18 | { | ||
19 | return gpio + GPIO_IRQ_BASE; | ||
20 | } | ||
21 | |||
22 | static 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 | ||
22 | void at32_select_periph(unsigned int pin, unsigned int periph, | 23 | void at32_select_periph(unsigned int pin, unsigned int periph, |
23 | unsigned long flags); | 24 | unsigned long flags); |
24 | void at32_select_gpio(unsigned int pin, unsigned long flags); | 25 | void at32_select_gpio(unsigned int pin, unsigned long flags); |
26 | void at32_reserve_pin(unsigned int pin); | ||
25 | 27 | ||
26 | #endif /* __ASM_ARCH_PORTMUX_H__ */ | 28 | #endif /* __ASM_ARCH_PORTMUX_H__ */ |
diff --git a/include/asm-avr32/checksum.h b/include/asm-avr32/checksum.h index af9d53f0f5d2..4ddbfd2486af 100644 --- a/include/asm-avr32/checksum.h +++ b/include/asm-avr32/checksum.h | |||
@@ -38,7 +38,7 @@ __wsum csum_partial_copy_generic(const void *src, void *dst, int len, | |||
38 | * passed in an incorrect kernel address to one of these functions. | 38 | * passed in an incorrect kernel address to one of these functions. |
39 | * | 39 | * |
40 | * If you use these functions directly please don't forget the | 40 | * If you use these functions directly please don't forget the |
41 | * verify_area(). | 41 | * access_ok(). |
42 | */ | 42 | */ |
43 | static inline | 43 | static inline |
44 | __wsum csum_partial_copy_nocheck(const void *src, void *dst, | 44 | __wsum csum_partial_copy_nocheck(const void *src, void *dst, |
diff --git a/include/asm-avr32/dma-mapping.h b/include/asm-avr32/dma-mapping.h index 5c01e27f0b41..115813e48fe0 100644 --- a/include/asm-avr32/dma-mapping.h +++ b/include/asm-avr32/dma-mapping.h | |||
@@ -32,6 +32,14 @@ static inline int dma_set_mask(struct device *dev, u64 dma_mask) | |||
32 | return 0; | 32 | return 0; |
33 | } | 33 | } |
34 | 34 | ||
35 | /* | ||
36 | * dma_map_single can't fail as it is implemented now. | ||
37 | */ | ||
38 | static inline int dma_mapping_error(dma_addr_t addr) | ||
39 | { | ||
40 | return 0; | ||
41 | } | ||
42 | |||
35 | /** | 43 | /** |
36 | * dma_alloc_coherent - allocate consistent memory for DMA | 44 | * dma_alloc_coherent - allocate consistent memory for DMA |
37 | * @dev: valid struct device pointer, or NULL for ISA and EISA-like devices | 45 | * @dev: valid struct device pointer, or NULL for ISA and EISA-like devices |
diff --git a/include/asm-avr32/gpio.h b/include/asm-avr32/gpio.h new file mode 100644 index 000000000000..19e8ccc77db3 --- /dev/null +++ b/include/asm-avr32/gpio.h | |||
@@ -0,0 +1,6 @@ | |||
1 | #ifndef __ASM_AVR32_GPIO_H | ||
2 | #define __ASM_AVR32_GPIO_H | ||
3 | |||
4 | #include <asm/arch/gpio.h> | ||
5 | |||
6 | #endif /* __ASM_AVR32_GPIO_H */ | ||
diff --git a/include/asm-avr32/irq.h b/include/asm-avr32/irq.h index f7e725707dd7..83e6549d7783 100644 --- a/include/asm-avr32/irq.h +++ b/include/asm-avr32/irq.h | |||
@@ -2,8 +2,12 @@ | |||
2 | #define __ASM_AVR32_IRQ_H | 2 | #define __ASM_AVR32_IRQ_H |
3 | 3 | ||
4 | #define NR_INTERNAL_IRQS 64 | 4 | #define NR_INTERNAL_IRQS 64 |
5 | #define NR_EXTERNAL_IRQS 64 | 5 | |
6 | #define NR_IRQS (NR_INTERNAL_IRQS + NR_EXTERNAL_IRQS) | 6 | #include <asm/arch/irq.h> |
7 | |||
8 | #ifndef NR_IRQS | ||
9 | #define NR_IRQS (NR_INTERNAL_IRQS) | ||
10 | #endif | ||
7 | 11 | ||
8 | #define irq_canonicalize(i) (i) | 12 | #define irq_canonicalize(i) (i) |
9 | 13 | ||
diff --git a/include/asm-avr32/posix_types.h b/include/asm-avr32/posix_types.h index 2831b039b349..9e255b999639 100644 --- a/include/asm-avr32/posix_types.h +++ b/include/asm-avr32/posix_types.h | |||
@@ -23,7 +23,7 @@ typedef unsigned short __kernel_ipc_pid_t; | |||
23 | typedef unsigned int __kernel_uid_t; | 23 | typedef unsigned int __kernel_uid_t; |
24 | typedef unsigned int __kernel_gid_t; | 24 | typedef unsigned int __kernel_gid_t; |
25 | typedef unsigned long __kernel_size_t; | 25 | typedef unsigned long __kernel_size_t; |
26 | typedef int __kernel_ssize_t; | 26 | typedef long __kernel_ssize_t; |
27 | typedef int __kernel_ptrdiff_t; | 27 | typedef int __kernel_ptrdiff_t; |
28 | typedef long __kernel_time_t; | 28 | typedef long __kernel_time_t; |
29 | typedef long __kernel_suseconds_t; | 29 | typedef long __kernel_suseconds_t; |
diff --git a/include/asm-avr32/uaccess.h b/include/asm-avr32/uaccess.h index 821deb5a9d28..74a679e9098c 100644 --- a/include/asm-avr32/uaccess.h +++ b/include/asm-avr32/uaccess.h | |||
@@ -68,12 +68,6 @@ static inline void set_fs(mm_segment_t s) | |||
68 | 68 | ||
69 | #define access_ok(type, addr, size) (likely(__range_ok(addr, size) == 0)) | 69 | #define access_ok(type, addr, size) (likely(__range_ok(addr, size) == 0)) |
70 | 70 | ||
71 | static inline int | ||
72 | verify_area(int type, const void __user *addr, unsigned long size) | ||
73 | { | ||
74 | return access_ok(type, addr, size) ? 0 : -EFAULT; | ||
75 | } | ||
76 | |||
77 | /* Generic arbitrary sized copy. Return the number of bytes NOT copied */ | 71 | /* Generic arbitrary sized copy. Return the number of bytes NOT copied */ |
78 | extern __kernel_size_t __copy_user(void *to, const void *from, | 72 | extern __kernel_size_t __copy_user(void *to, const void *from, |
79 | __kernel_size_t n); | 73 | __kernel_size_t n); |