From 550454d4b6186e712a1b48e27a3dce788dd54ca9 Mon Sep 17 00:00:00 2001 From: florian Date: Mon, 2 Nov 2009 23:07:47 +0000 Subject: [rdc] forward port r18254 to 2.6.30 git-svn-id: svn://svn.openwrt.org/openwrt/trunk@18276 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- .../arch/x86/include/asm/mach-rdc321x/gpio.h | 59 ++++++++++++++++++++++ .../x86/include/asm/mach-rdc321x/rdc321x_defs.h | 12 +++++ 2 files changed, 71 insertions(+) create mode 100644 target/linux/rdc/files-2.6.30/arch/x86/include/asm/mach-rdc321x/gpio.h create mode 100644 target/linux/rdc/files-2.6.30/arch/x86/include/asm/mach-rdc321x/rdc321x_defs.h (limited to 'target/linux/rdc/files-2.6.30/arch/x86/include') 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 000000000..873bffe30 --- /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 + +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 + +#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 000000000..c8e9c8bed --- /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 -- cgit v1.2.3