~ubuntu-branches/ubuntu/precise/linux-ti-omap4/precise-security

« back to all changes in this revision

Viewing changes to arch/arm/mach-mmp/include/mach/gpio-pxa.h

  • Committer: Package Import Robot
  • Author(s): Paolo Pisati, Paolo Pisati
  • Date: 2011-12-06 15:56:07 UTC
  • Revision ID: package-import@ubuntu.com-20111206155607-pcf44kv5fmhk564f
Tags: 3.2.0-1401.1
[ Paolo Pisati ]

* Rebased on top of Ubuntu-3.2.0-3.8
* Tilt-tracking @ ef2487af4bb15bdd0689631774b5a5e3a59f74e2
* Delete debian.ti-omap4/control, it shoudln't be tracked
* Fix architecture spelling (s/armel/armhf/)
* [Config] Update configs following 3.2 import
* [Config] Fix compilation: disable CODA and ARCH_OMAP3
* [Config] Fix compilation: disable Ethernet Faraday
* Update series to precise

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef __ASM_MACH_GPIO_PXA_H
 
2
#define __ASM_MACH_GPIO_PXA_H
 
3
 
 
4
#include <mach/addr-map.h>
 
5
#include <mach/irqs.h>
 
6
 
 
7
#define GPIO_REGS_VIRT  (APB_VIRT_BASE + 0x19000)
 
8
 
 
9
#define BANK_OFF(n)     (((n) < 3) ? (n) << 2 : 0x100 + (((n) - 3) << 2))
 
10
#define GPIO_REG(x)     (*(volatile u32 *)(GPIO_REGS_VIRT + (x)))
 
11
 
 
12
#define NR_BUILTIN_GPIO         IRQ_GPIO_NUM
 
13
 
 
14
#define gpio_to_bank(gpio)      ((gpio) >> 5)
 
15
 
 
16
/* NOTE: these macros are defined here to make optimization of
 
17
 * gpio_{get,set}_value() to work when 'gpio' is a constant.
 
18
 * Usage of these macros otherwise is no longer recommended,
 
19
 * use generic GPIO API whenever possible.
 
20
 */
 
21
#define GPIO_bit(gpio)  (1 << ((gpio) & 0x1f))
 
22
 
 
23
#define GPLR(x)         GPIO_REG(BANK_OFF(gpio_to_bank(x)) + 0x00)
 
24
#define GPDR(x)         GPIO_REG(BANK_OFF(gpio_to_bank(x)) + 0x0c)
 
25
#define GPSR(x)         GPIO_REG(BANK_OFF(gpio_to_bank(x)) + 0x18)
 
26
#define GPCR(x)         GPIO_REG(BANK_OFF(gpio_to_bank(x)) + 0x24)
 
27
 
 
28
#include <plat/gpio-pxa.h>
 
29
 
 
30
#endif /* __ASM_MACH_GPIO_PXA_H */