-
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.
yaml --- r: 137418 b: refs/heads/master c: e2bb665 h: refs/heads/master v: v3
- Loading branch information
Eric Miao
committed
Mar 23, 2009
1 parent
6a1b31f
commit 3f9873c
Showing
4 changed files
with
58 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
--- | ||
refs/heads/master: 40305a583a3e080a8d1aa126fa810480ec8cbabd | ||
refs/heads/master: e2bb6650ef94c64723e2dd35ab92410b9477bc64 |
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,36 @@ | ||
#ifndef __ASM_MACH_GPIO_H | ||
#define __ASM_MACH_GPIO_H | ||
|
||
#include <mach/addr-map.h> | ||
#include <mach/irqs.h> | ||
#include <asm-generic/gpio.h> | ||
|
||
#define GPIO_REGS_VIRT (APB_VIRT_BASE + 0x19000) | ||
|
||
#define BANK_OFF(n) (((n) < 3) ? (n) << 2 : 0x100 + (((n) - 3) << 2)) | ||
#define GPIO_REG(x) (*((volatile u32 *)(GPIO_REGS_VIRT + (x)))) | ||
|
||
#define NR_BUILTIN_GPIO (128) | ||
|
||
#define gpio_to_bank(gpio) ((gpio) >> 5) | ||
#define gpio_to_irq(gpio) (IRQ_GPIO_START + (gpio)) | ||
#define irq_to_gpio(irq) ((irq) - IRQ_GPIO_START) | ||
|
||
|
||
#define __gpio_is_inverted(gpio) (0) | ||
#define __gpio_is_occupied(gpio) (0) | ||
|
||
/* NOTE: these macros are defined here to make optimization of | ||
* gpio_{get,set}_value() to work when 'gpio' is a constant. | ||
* Usage of these macros otherwise is no longer recommended, | ||
* use generic GPIO API whenever possible. | ||
*/ | ||
#define GPIO_bit(gpio) (1 << ((gpio) & 0x1f)) | ||
|
||
#define GPLR(x) GPIO_REG(BANK_OFF(gpio_to_bank(x)) + 0x00) | ||
#define GPDR(x) GPIO_REG(BANK_OFF(gpio_to_bank(x)) + 0x0c) | ||
#define GPSR(x) GPIO_REG(BANK_OFF(gpio_to_bank(x)) + 0x18) | ||
#define GPCR(x) GPIO_REG(BANK_OFF(gpio_to_bank(x)) + 0x24) | ||
|
||
#include <plat/gpio.h> | ||
#endif /* __ASM_MACH_GPIO_H */ |
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