-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ARM] mv78xx0: implement GPIO and GPIO interrupt support
Signed-off-by: Lennert Buytenhek <buytenh@marvell.com> Signed-off-by: Nicolas Pitre <nico@marvell.com>
- Loading branch information
Lennert Buytenhek
authored and
Nicolas Pitre
committed
Dec 20, 2008
1 parent
4c21343
commit b95a13d
Showing
5 changed files
with
71 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* | ||
* arch/asm-arm/mach-mv78xx0/include/mach/gpio.h | ||
* | ||
* This file is licensed under the terms of the GNU General Public | ||
* License version 2. This program is licensed "as is" without any | ||
* warranty of any kind, whether express or implied. | ||
*/ | ||
|
||
#ifndef __ASM_ARCH_GPIO_H | ||
#define __ASM_ARCH_GPIO_H | ||
|
||
#include <mach/irqs.h> | ||
#include <plat/gpio.h> | ||
#include <asm-generic/gpio.h> /* cansleep wrappers */ | ||
|
||
extern int mv78xx0_core_index(void); | ||
|
||
#define GPIO_MAX 32 | ||
#define GPIO_OUT(pin) (DEV_BUS_VIRT_BASE + 0x0100) | ||
#define GPIO_IO_CONF(pin) (DEV_BUS_VIRT_BASE + 0x0104) | ||
#define GPIO_BLINK_EN(pin) (DEV_BUS_VIRT_BASE + 0x0108) | ||
#define GPIO_IN_POL(pin) (DEV_BUS_VIRT_BASE + 0x010c) | ||
#define GPIO_DATA_IN(pin) (DEV_BUS_VIRT_BASE + 0x0110) | ||
#define GPIO_EDGE_CAUSE(pin) (DEV_BUS_VIRT_BASE + 0x0114) | ||
#define GPIO_MASK_OFF (mv78xx0_core_index() ? 0x18 : 0) | ||
#define GPIO_EDGE_MASK(pin) (DEV_BUS_VIRT_BASE + 0x0118 + GPIO_MASK_OFF) | ||
#define GPIO_LEVEL_MASK(pin) (DEV_BUS_VIRT_BASE + 0x011c + GPIO_MASK_OFF) | ||
|
||
static inline int gpio_to_irq(int pin) | ||
{ | ||
return pin + IRQ_MV78XX0_GPIO_START; | ||
} | ||
|
||
static inline int irq_to_gpio(int irq) | ||
{ | ||
return irq - IRQ_MV78XX0_GPIO_START; | ||
} | ||
|
||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -122,7 +122,4 @@ | |
#define SATA_PHYS_BASE (MV78XX0_REGS_PHYS_BASE | 0xa0000) | ||
|
||
|
||
#define GPIO_MAX 32 | ||
|
||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters