diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-08-08 14:38:42 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-08-08 14:38:42 -0400 |
commit | 49b75b87ce2dfbd99e59a50c3681b154d07e3a22 (patch) | |
tree | f14e1da19a13d87a512f9043c2f37fd75dd122b3 /arch/arm/mach-ixp2000/include/mach/gpio.h | |
parent | f1c7f79b6ab4f7ada002a0fae47f462ede6b6857 (diff) | |
parent | 097d9eb537ff4d88b74c3fe67392e27c478ca3c5 (diff) |
Merge branch 'for-linus-merged' of master.kernel.org:/home/rmk/linux-2.6-arm
* 'for-linus-merged' of master.kernel.org:/home/rmk/linux-2.6-arm:
[ARM] 5177/1: arm/mach-sa1100/Makefile: remove CONFIG_SA1100_USB
[ARM] 5166/1: magician: add MAINTAINERS entry
[ARM] fix pnx4008 build errors
[ARM] Fix SMP booting with non-zero PHYS_OFFSET
[ARM] 5185/1: Fix spi num_chipselect for lubbock
[ARM] Move include/asm-arm/arch-* to arch/arm/*/include/mach
[ARM] Add support for arch/arm/mach-*/include and arch/arm/plat-*/include
[ARM] Remove asm/hardware.h, use asm/arch/hardware.h instead
[ARM] Eliminate useless includes of asm/mach-types.h
[ARM] Fix circular include dependency with IRQ headers
avr32: Use <mach/foo.h> instead of <asm/arch/foo.h>
avr32: Introduce arch/avr32/mach-*/include/mach
avr32: Move include/asm-avr32 to arch/avr32/include/asm
[ARM] sa1100_wdt: use reset_status to remember watchdog reset status
[ARM] pxa: introduce reset_status and clear_reset_status for driver's usage
[ARM] pxa: introduce reset.h for reset specific header information
Diffstat (limited to 'arch/arm/mach-ixp2000/include/mach/gpio.h')
-rw-r--r-- | arch/arm/mach-ixp2000/include/mach/gpio.h | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/arch/arm/mach-ixp2000/include/mach/gpio.h b/arch/arm/mach-ixp2000/include/mach/gpio.h new file mode 100644 index 000000000000..4a88d2c33dac --- /dev/null +++ b/arch/arm/mach-ixp2000/include/mach/gpio.h | |||
@@ -0,0 +1,48 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-ixp2000/include/mach/gpio.h | ||
3 | * | ||
4 | * Copyright (C) 2002 Intel 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 | */ | ||
10 | |||
11 | /* | ||
12 | * IXP2000 GPIO in/out, edge/level detection for IRQs: | ||
13 | * IRQs are generated on Falling-edge, Rising-Edge, Level-low, Level-High | ||
14 | * or both Falling-edge and Rising-edge. | ||
15 | * This must be called *before* the corresponding IRQ is registerd. | ||
16 | * Use this instead of directly setting the GPIO registers. | ||
17 | * GPIOs may also be used as GPIOs (e.g. for emulating i2c/smb) | ||
18 | */ | ||
19 | #ifndef __ASM_ARCH_GPIO_H | ||
20 | #define __ASM_ARCH_GPIO_H | ||
21 | |||
22 | #ifndef __ASSEMBLY__ | ||
23 | |||
24 | #define GPIO_IN 0 | ||
25 | #define GPIO_OUT 1 | ||
26 | |||
27 | #define IXP2000_GPIO_LOW 0 | ||
28 | #define IXP2000_GPIO_HIGH 1 | ||
29 | |||
30 | extern void gpio_line_config(int line, int direction); | ||
31 | |||
32 | static inline int gpio_line_get(int line) | ||
33 | { | ||
34 | return (((*IXP2000_GPIO_PLR) >> line) & 1); | ||
35 | } | ||
36 | |||
37 | static inline void gpio_line_set(int line, int value) | ||
38 | { | ||
39 | if (value == IXP2000_GPIO_HIGH) { | ||
40 | ixp2000_reg_write(IXP2000_GPIO_POSR, 1 << line); | ||
41 | } else if (value == IXP2000_GPIO_LOW) { | ||
42 | ixp2000_reg_write(IXP2000_GPIO_POCR, 1 << line); | ||
43 | } | ||
44 | } | ||
45 | |||
46 | #endif /* !__ASSEMBLY__ */ | ||
47 | |||
48 | #endif /* ASM_ARCH_IXP2000_GPIO_H_ */ | ||