diff options
author | Florian Fainelli <florian@openwrt.org> | 2009-11-02 23:07:47 +0000 |
---|---|---|
committer | Florian Fainelli <florian@openwrt.org> | 2009-11-02 23:07:47 +0000 |
commit | b02cb69da98a20016c146546f397ba357f9af8ca (patch) | |
tree | 3187d84d72723f8840dd3d775a23ba974a7c2a97 /target/linux/rdc/files-2.6.30/arch/x86/include/asm | |
parent | d0410d9e1a01b22ce683ff37b63191aecc7e3828 (diff) | |
download | master-187ad058-b02cb69da98a20016c146546f397ba357f9af8ca.tar.gz master-187ad058-b02cb69da98a20016c146546f397ba357f9af8ca.tar.bz2 master-187ad058-b02cb69da98a20016c146546f397ba357f9af8ca.zip |
[rdc] forward port r18254 to 2.6.30
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@18276 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/rdc/files-2.6.30/arch/x86/include/asm')
-rw-r--r-- | target/linux/rdc/files-2.6.30/arch/x86/include/asm/mach-rdc321x/gpio.h | 59 | ||||
-rw-r--r-- | target/linux/rdc/files-2.6.30/arch/x86/include/asm/mach-rdc321x/rdc321x_defs.h | 12 |
2 files changed, 71 insertions, 0 deletions
diff --git a/target/linux/rdc/files-2.6.30/arch/x86/include/asm/mach-rdc321x/gpio.h b/target/linux/rdc/files-2.6.30/arch/x86/include/asm/mach-rdc321x/gpio.h new file mode 100644 index 0000000000..873bffe302 --- /dev/null +++ b/target/linux/rdc/files-2.6.30/arch/x86/include/asm/mach-rdc321x/gpio.h @@ -0,0 +1,59 @@ +#ifndef _ASM_X86_MACH_RDC321X_GPIO_H +#define _ASM_X86_MACH_RDC321X_GPIO_H + +#include <linux/kernel.h> + +extern int rdc_gpio_get_value(unsigned gpio); +extern void rdc_gpio_set_value(unsigned gpio, int value); +extern int rdc_gpio_direction_input(unsigned gpio); +extern int rdc_gpio_direction_output(unsigned gpio, int value); +extern int rdc_gpio_request(unsigned gpio, const char *label); +extern void rdc_gpio_free(unsigned gpio); + +/* Wrappers for the arch-neutral GPIO API */ + +static inline int gpio_request(unsigned gpio, const char *label) +{ + return rdc_gpio_request(gpio, label); +} + +static inline void gpio_free(unsigned gpio) +{ + might_sleep(); + rdc_gpio_free(gpio); +} + +static inline int gpio_direction_input(unsigned gpio) +{ + return rdc_gpio_direction_input(gpio); +} + +static inline int gpio_direction_output(unsigned gpio, int value) +{ + return rdc_gpio_direction_output(gpio, value); +} + +static inline int gpio_get_value(unsigned gpio) +{ + return rdc_gpio_get_value(gpio); +} + +static inline void gpio_set_value(unsigned gpio, int value) +{ + rdc_gpio_set_value(gpio, value); +} + +static inline int gpio_to_irq(unsigned gpio) +{ + return gpio; +} + +static inline int irq_to_gpio(unsigned irq) +{ + return irq; +} + +/* For cansleep */ +#include <asm-generic/gpio.h> + +#endif /* _ASM_X86_MACH_RDC321X_GPIO_H */ diff --git a/target/linux/rdc/files-2.6.30/arch/x86/include/asm/mach-rdc321x/rdc321x_defs.h b/target/linux/rdc/files-2.6.30/arch/x86/include/asm/mach-rdc321x/rdc321x_defs.h new file mode 100644 index 0000000000..c8e9c8bed3 --- /dev/null +++ b/target/linux/rdc/files-2.6.30/arch/x86/include/asm/mach-rdc321x/rdc321x_defs.h @@ -0,0 +1,12 @@ +#define PFX "rdc321x: " + +/* General purpose configuration and data registers */ +#define RDC3210_CFGREG_ADDR 0x0CF8 +#define RDC3210_CFGREG_DATA 0x0CFC + +#define RDC321X_GPIO_CTRL_REG1 0x48 +#define RDC321X_GPIO_CTRL_REG2 0x84 +#define RDC321X_GPIO_DATA_REG1 0x4c +#define RDC321X_GPIO_DATA_REG2 0x88 + +#define RDC321X_MAX_GPIO 58 |