2007-05-14 21:30:15 +08:00
|
|
|
/*
|
2008-08-05 23:14:15 +08:00
|
|
|
* arch/arm/mach-ks8695/include/mach/gpio.h
|
2007-05-14 21:30:15 +08:00
|
|
|
*
|
|
|
|
* Copyright (C) 2006 Andrew Victor
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License version 2 as
|
|
|
|
* published by the Free Software Foundation.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __ASM_ARCH_GPIO_H_
|
|
|
|
#define __ASM_ARCH_GPIO_H_
|
|
|
|
|
2008-10-30 05:14:54 +08:00
|
|
|
#include <linux/kernel.h>
|
|
|
|
|
2007-05-14 21:30:15 +08:00
|
|
|
#define KS8695_GPIO_0 0
|
|
|
|
#define KS8695_GPIO_1 1
|
|
|
|
#define KS8695_GPIO_2 2
|
|
|
|
#define KS8695_GPIO_3 3
|
|
|
|
#define KS8695_GPIO_4 4
|
|
|
|
#define KS8695_GPIO_5 5
|
|
|
|
#define KS8695_GPIO_6 6
|
|
|
|
#define KS8695_GPIO_7 7
|
|
|
|
#define KS8695_GPIO_8 8
|
|
|
|
#define KS8695_GPIO_9 9
|
|
|
|
#define KS8695_GPIO_10 10
|
|
|
|
#define KS8695_GPIO_11 11
|
|
|
|
#define KS8695_GPIO_12 12
|
|
|
|
#define KS8695_GPIO_13 13
|
|
|
|
#define KS8695_GPIO_14 14
|
|
|
|
#define KS8695_GPIO_15 15
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Configure GPIO pin as external interrupt source.
|
|
|
|
*/
|
2008-12-14 04:44:12 +08:00
|
|
|
extern int ks8695_gpio_interrupt(unsigned int pin, unsigned int type);
|
2007-05-14 21:30:15 +08:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Map GPIO line to IRQ number.
|
|
|
|
*/
|
2008-12-14 04:44:12 +08:00
|
|
|
extern int gpio_to_irq(unsigned int pin);
|
2007-05-14 21:30:15 +08:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Map IRQ number to GPIO line.
|
|
|
|
*/
|
2008-12-14 04:44:12 +08:00
|
|
|
extern int irq_to_gpio(unsigned int irq);
|
2007-05-14 21:30:15 +08:00
|
|
|
|
|
|
|
#include <asm-generic/gpio.h>
|
|
|
|
|
2008-12-14 04:44:12 +08:00
|
|
|
/* If it turns out that we need to optimise GPIO access for the
|
|
|
|
* Micrel's GPIOs, then these can be changed to check their argument
|
|
|
|
* directly as static inlines. However for now it's probably not
|
|
|
|
* worthwhile.
|
|
|
|
*/
|
|
|
|
#define gpio_get_value __gpio_get_value
|
|
|
|
#define gpio_set_value __gpio_set_value
|
2007-05-14 21:30:15 +08:00
|
|
|
|
2008-12-14 04:44:12 +08:00
|
|
|
/* Register the GPIOs */
|
|
|
|
extern void ks8695_register_gpios(void);
|
2007-05-14 21:30:15 +08:00
|
|
|
|
|
|
|
#endif
|