mirror of
git://projects.qi-hardware.com/openwrt-xburst.git
synced 2024-08-23 06:58:03 +03:00
userspace gpio driver for .21
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@7368 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
parent
bd56fe6d91
commit
455638113d
@ -1,16 +1,28 @@
|
|||||||
diff -urN linux-2.6.19.2.old/arch/arm/mach-at91rm9200/gpio.c linux-2.6.19.2/arch/arm/mach-at91rm9200/gpio.c
|
--- linux-2.6.21.1.orig/arch/arm/mach-at91/gpio.c 2007-04-27 23:49:26.000000000 +0200
|
||||||
--- linux-2.6.19.2.old/arch/arm/mach-at91rm9200/gpio.c 2007-03-06 22:49:37.000000000 +0100
|
+++ linux-2.6.21.1/arch/arm/mach-at91/gpio.c 2007-05-28 15:30:48.000000000 +0200
|
||||||
+++ linux-2.6.19.2/arch/arm/mach-at91rm9200/gpio.c 2007-03-07 10:25:41.000000000 +0100
|
@@ -27,6 +27,7 @@
|
||||||
@@ -28,7 +28,7 @@
|
|
||||||
|
|
||||||
static struct at91_gpio_bank *gpio;
|
static struct at91_gpio_bank *gpio;
|
||||||
static int gpio_banks;
|
static int gpio_banks;
|
||||||
-
|
|
||||||
+static u32 pio_gpio_pin[4] = { 0, 0, 0, 0 };
|
+static u32 pio_gpio_pin[4] = { 0, 0, 0, 0 };
|
||||||
|
|
||||||
|
|
||||||
static inline void __iomem *pin_to_controller(unsigned pin)
|
static inline void __iomem *pin_to_controller(unsigned pin)
|
||||||
|
@@ -71,9 +72,13 @@
|
||||||
{
|
{
|
||||||
@@ -113,10 +113,13 @@
|
void __iomem *pio = pin_to_controller(pin);
|
||||||
|
unsigned mask = pin_to_mask(pin);
|
||||||
|
+ int bank = (pin - PIN_BASE) / 32;
|
||||||
|
|
||||||
|
if (!pio)
|
||||||
|
return -EINVAL;
|
||||||
|
+
|
||||||
|
+ pio_gpio_pin[bank] |= mask;
|
||||||
|
+
|
||||||
|
__raw_writel(mask, pio + PIO_IDR);
|
||||||
|
__raw_writel(mask, pio + (use_pullup ? PIO_PUER : PIO_PUDR));
|
||||||
|
__raw_writel(mask, pio + PIO_PER);
|
||||||
|
@@ -130,10 +135,13 @@
|
||||||
{
|
{
|
||||||
void __iomem *pio = pin_to_controller(pin);
|
void __iomem *pio = pin_to_controller(pin);
|
||||||
unsigned mask = pin_to_mask(pin);
|
unsigned mask = pin_to_mask(pin);
|
||||||
@ -24,7 +36,7 @@ diff -urN linux-2.6.19.2.old/arch/arm/mach-at91rm9200/gpio.c linux-2.6.19.2/arch
|
|||||||
__raw_writel(mask, pio + PIO_IDR);
|
__raw_writel(mask, pio + PIO_IDR);
|
||||||
__raw_writel(mask, pio + (use_pullup ? PIO_PUER : PIO_PUDR));
|
__raw_writel(mask, pio + (use_pullup ? PIO_PUER : PIO_PUDR));
|
||||||
__raw_writel(mask, pio + PIO_ODR);
|
__raw_writel(mask, pio + PIO_ODR);
|
||||||
@@ -134,10 +137,13 @@
|
@@ -151,10 +159,13 @@
|
||||||
{
|
{
|
||||||
void __iomem *pio = pin_to_controller(pin);
|
void __iomem *pio = pin_to_controller(pin);
|
||||||
unsigned mask = pin_to_mask(pin);
|
unsigned mask = pin_to_mask(pin);
|
||||||
@ -38,7 +50,7 @@ diff -urN linux-2.6.19.2.old/arch/arm/mach-at91rm9200/gpio.c linux-2.6.19.2/arch
|
|||||||
__raw_writel(mask, pio + PIO_IDR);
|
__raw_writel(mask, pio + PIO_IDR);
|
||||||
__raw_writel(mask, pio + PIO_PUDR);
|
__raw_writel(mask, pio + PIO_PUDR);
|
||||||
__raw_writel(mask, pio + (value ? PIO_SODR : PIO_CODR));
|
__raw_writel(mask, pio + (value ? PIO_SODR : PIO_CODR));
|
||||||
@@ -214,6 +220,18 @@
|
@@ -262,6 +273,18 @@
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(at91_get_gpio_value);
|
EXPORT_SYMBOL(at91_get_gpio_value);
|
||||||
|
|
||||||
@ -57,10 +69,9 @@ diff -urN linux-2.6.19.2.old/arch/arm/mach-at91rm9200/gpio.c linux-2.6.19.2/arch
|
|||||||
/*--------------------------------------------------------------------------*/
|
/*--------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#ifdef CONFIG_PM
|
#ifdef CONFIG_PM
|
||||||
diff -urN linux-2.6.19.2.old/drivers/char/Kconfig linux-2.6.19.2/drivers/char/Kconfig
|
--- linux-2.6.21.1.orig/drivers/char/Kconfig 2007-05-28 12:22:29.000000000 +0200
|
||||||
--- linux-2.6.19.2.old/drivers/char/Kconfig 2007-03-06 22:49:37.000000000 +0100
|
+++ linux-2.6.21.1/drivers/char/Kconfig 2007-05-28 15:37:43.000000000 +0200
|
||||||
+++ linux-2.6.19.2/drivers/char/Kconfig 2007-03-07 01:08:57.000000000 +0100
|
@@ -1087,5 +1087,12 @@
|
||||||
@@ -1064,5 +1064,12 @@
|
|
||||||
The SPI driver gives user mode access to this serial
|
The SPI driver gives user mode access to this serial
|
||||||
bus on the AT91RM9200 processor.
|
bus on the AT91RM9200 processor.
|
||||||
|
|
||||||
@ -69,24 +80,22 @@ diff -urN linux-2.6.19.2.old/drivers/char/Kconfig linux-2.6.19.2/drivers/char/Kc
|
|||||||
+ depends on ARCH_AT91RM9200 && MACH_VLINK
|
+ depends on ARCH_AT91RM9200 && MACH_VLINK
|
||||||
+ default n
|
+ default n
|
||||||
+ help
|
+ help
|
||||||
+ Provides a handler for LED and GPIO in userspace
|
+ Provides a handler GPIO's in userspace
|
||||||
+
|
+
|
||||||
endmenu
|
endmenu
|
||||||
|
|
||||||
diff -urN linux-2.6.19.2.old/drivers/char/Makefile linux-2.6.19.2/drivers/char/Makefile
|
--- linux-2.6.21.1.orig/drivers/char/Makefile 2007-05-28 12:22:29.000000000 +0200
|
||||||
--- linux-2.6.19.2.old/drivers/char/Makefile 2007-03-06 22:49:37.000000000 +0100
|
+++ linux-2.6.21.1/drivers/char/Makefile 2007-05-28 15:38:11.000000000 +0200
|
||||||
+++ linux-2.6.19.2/drivers/char/Makefile 2007-03-07 01:08:05.000000000 +0100
|
@@ -95,6 +95,7 @@
|
||||||
@@ -92,6 +92,7 @@
|
|
||||||
obj-$(CONFIG_TELCLOCK) += tlclk.o
|
obj-$(CONFIG_TELCLOCK) += tlclk.o
|
||||||
obj-$(CONFIG_AT91_SPI) += at91_spi.o
|
obj-$(CONFIG_AT91_SPI) += at91_spi.o
|
||||||
obj-$(CONFIG_AT91_SPIDEV) += at91_spidev.o
|
obj-$(CONFIG_AT91_SPIDEV) += at91_spidev.o
|
||||||
+obj-$(CONFIG_AT91_VLIO) += vlink_giu.o
|
+obj-$(CONFIG_AT91_VLIO) += vlink_giu.o
|
||||||
|
|
||||||
obj-$(CONFIG_WATCHDOG) += watchdog/
|
obj-$(CONFIG_WATCHDOG) += watchdog/
|
||||||
obj-$(CONFIG_MWAVE) += mwave/
|
obj-$(CONFIG_MWAVE) += mwave/
|
||||||
diff -urN linux-2.6.19.2.old/drivers/char/vlink_giu.c linux-2.6.19.2/drivers/char/vlink_giu.c
|
--- linux-2.6.21.1.orig/drivers/char/vlink_giu.c 1970-01-01 01:00:00.000000000 +0100
|
||||||
--- linux-2.6.19.2.old/drivers/char/vlink_giu.c 1970-01-01 01:00:00.000000000 +0100
|
+++ linux-2.6.21.1/drivers/char/vlink_giu.c 2007-05-28 15:39:47.000000000 +0200
|
||||||
+++ linux-2.6.19.2/drivers/char/vlink_giu.c 2007-03-07 01:21:21.000000000 +0100
|
|
||||||
@@ -0,0 +1,256 @@
|
@@ -0,0 +1,256 @@
|
||||||
+/*
|
+/*
|
||||||
+ * Driver for FDL Versalink GPIO
|
+ * Driver for FDL Versalink GPIO
|
||||||
@ -344,14 +353,3 @@ diff -urN linux-2.6.19.2.old/drivers/char/vlink_giu.c linux-2.6.19.2/drivers/cha
|
|||||||
+MODULE_AUTHOR("Hamish Guthrie <hamish@prodigi.ch>");
|
+MODULE_AUTHOR("Hamish Guthrie <hamish@prodigi.ch>");
|
||||||
+MODULE_DESCRIPTION("FDL Versalink GPIO Driver");
|
+MODULE_DESCRIPTION("FDL Versalink GPIO Driver");
|
||||||
+MODULE_LICENSE("GPL");
|
+MODULE_LICENSE("GPL");
|
||||||
diff -urN linux-2.6.19.2.old/include/asm-arm/arch-at91rm9200/gpio.h linux-2.6.19.2/include/asm-arm/arch-at91rm9200/gpio.h
|
|
||||||
--- linux-2.6.19.2.old/include/asm-arm/arch-at91rm9200/gpio.h 2007-01-10 20:10:37.000000000 +0100
|
|
||||||
+++ linux-2.6.19.2/include/asm-arm/arch-at91rm9200/gpio.h 2007-03-07 01:17:23.000000000 +0100
|
|
||||||
@@ -189,6 +189,7 @@
|
|
||||||
/* callable at any time */
|
|
||||||
extern int at91_set_gpio_value(unsigned pin, int value);
|
|
||||||
extern int at91_get_gpio_value(unsigned pin);
|
|
||||||
+extern int at91_is_pin_gpio(unsigned pin);
|
|
||||||
|
|
||||||
/* callable only from core power-management code */
|
|
||||||
extern void at91_gpio_suspend(void);
|
|
||||||
|
Loading…
Reference in New Issue
Block a user