summaryrefslogtreecommitdiffstats
path: root/target/linux/ramips/files/arch/mips/include
diff options
context:
space:
mode:
authorjuhosg <juhosg@3c298f89-4303-0410-b956-a3cf2f4a3e73>2009-08-31 08:29:19 +0000
committerjuhosg <juhosg@3c298f89-4303-0410-b956-a3cf2f4a3e73>2009-08-31 08:29:19 +0000
commit7c54f57e7eed040ec8e9dbdd92e43c932f566081 (patch)
tree1d5ef9c303430d1f66026b966b382e0151a7be3d /target/linux/ramips/files/arch/mips/include
parent8e82554c4f9a898abdf540188bd69086958c9410 (diff)
[ramips] fix GPIOLIB support
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@17446 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/ramips/files/arch/mips/include')
-rw-r--r--target/linux/ramips/files/arch/mips/include/asm/mach-ralink/gpio.h44
-rw-r--r--target/linux/ramips/files/arch/mips/include/asm/mach-ralink/rt288x/ralink_soc.h20
-rw-r--r--target/linux/ramips/files/arch/mips/include/asm/mach-ralink/rt288x_regs.h1
-rw-r--r--target/linux/ramips/files/arch/mips/include/asm/mach-ralink/rt305x/ralink_soc.h20
-rw-r--r--target/linux/ramips/files/arch/mips/include/asm/mach-ralink/rt305x_regs.h1
5 files changed, 48 insertions, 38 deletions
diff --git a/target/linux/ramips/files/arch/mips/include/asm/mach-ralink/gpio.h b/target/linux/ramips/files/arch/mips/include/asm/mach-ralink/gpio.h
index e8a0836a3..f68ee1685 100644
--- a/target/linux/ramips/files/arch/mips/include/asm/mach-ralink/gpio.h
+++ b/target/linux/ramips/files/arch/mips/include/asm/mach-ralink/gpio.h
@@ -1,5 +1,5 @@
/*
- * Ralink RT288x GPIO API definitions
+ * Ralink SoC GPIO API support
*
* Copyright (C) 2008-2009 Gabor Juhos <juhosg@openwrt.org>
* Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
@@ -10,43 +10,15 @@
*
*/
-#ifndef __ASM_MACH_RT288X_GPIO_H
-#define __ASM_MACH_RT288X_GPIO_H
+#ifndef __ASM_MACH_RALINK_GPIO_H
+#define __ASM_MACH_RALINK_GPIO_H
-#define ARCH_NR_GPIOS 64
+#define ARCH_NR_GPIOS 128
#include <asm-generic/gpio.h>
-#include <asm/mach-ralink/rt288x.h>
-
-extern void __rt288x_gpio_set_value(unsigned gpio, int value);
-extern int __rt288x_gpio_get_value(unsigned gpio);
-
-static inline int gpio_to_irq(unsigned gpio)
-{
- return RT288X_GPIO_IRQ(gpio);
-}
-
-static inline int irq_to_gpio(unsigned irq)
-{
- return irq - RT288X_GPIO_IRQ_BASE;
-}
-
-static inline int gpio_get_value(unsigned gpio)
-{
- if (gpio < RT288X_GPIO_COUNT)
- return __rt288x_gpio_get_value(gpio);
-
- return __gpio_get_value(gpio);
-}
-
-static inline void gpio_set_value(unsigned gpio, int value)
-{
- if (gpio < RT288X_GPIO_COUNT)
- __rt288x_gpio_set_value(gpio, value);
- else
- __gpio_set_value(gpio, value);
-}
-
+#define gpio_get_value __gpio_get_value
+#define gpio_set_value __gpio_set_value
#define gpio_cansleep __gpio_cansleep
+#define gpio_to_irq __gpio_to_irq
-#endif /* __ASM_MACH_RT288X_GPIO_H */
+#endif /* __ASM_MACH_RALINK_GPIO_H */
diff --git a/target/linux/ramips/files/arch/mips/include/asm/mach-ralink/rt288x/ralink_soc.h b/target/linux/ramips/files/arch/mips/include/asm/mach-ralink/rt288x/ralink_soc.h
new file mode 100644
index 000000000..c379f3919
--- /dev/null
+++ b/target/linux/ramips/files/arch/mips/include/asm/mach-ralink/rt288x/ralink_soc.h
@@ -0,0 +1,20 @@
+/*
+ * Ralink RT288x specific SOC defines
+ *
+ * Copyright (C) 2009 Gabor Juhos <juhosg@openwrt.org>
+ *
+ * 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 __RT288X_RALINK_SOC_H
+#define __RT288X_RALINK_SOC_H
+
+#define RALINK_SOC_GPIO_BASE 0x300600
+
+#define RALINK_SOC_GPIO0_COUNT 24
+#define RALINK_SOC_GPIO1_COUNT 16
+#define RALINK_SOC_GPIO2_COUNT 32
+
+#endif /* __RT288X_RALINK_SOC_H */
diff --git a/target/linux/ramips/files/arch/mips/include/asm/mach-ralink/rt288x_regs.h b/target/linux/ramips/files/arch/mips/include/asm/mach-ralink/rt288x_regs.h
index 98308ffe0..dfd5b3159 100644
--- a/target/linux/ramips/files/arch/mips/include/asm/mach-ralink/rt288x_regs.h
+++ b/target/linux/ramips/files/arch/mips/include/asm/mach-ralink/rt288x_regs.h
@@ -16,7 +16,6 @@
#define RT2880_SYSC_BASE 0x00300000
#define RT2880_TIMER_BASE 0x00300100
-#define RT2880_INTC_BASE 0x00300200
#define RT2880_MEMC_BASE 0x00300300
#define RT2880_UART0_BASE 0x00300500
#define RT2880_PIO_BASE 0x00300600
diff --git a/target/linux/ramips/files/arch/mips/include/asm/mach-ralink/rt305x/ralink_soc.h b/target/linux/ramips/files/arch/mips/include/asm/mach-ralink/rt305x/ralink_soc.h
new file mode 100644
index 000000000..144cc4ea4
--- /dev/null
+++ b/target/linux/ramips/files/arch/mips/include/asm/mach-ralink/rt305x/ralink_soc.h
@@ -0,0 +1,20 @@
+/*
+ * Ralink RT305x specific SOC defines
+ *
+ * Copyright (C) 2009 Gabor Juhos <juhosg@openwrt.org>
+ *
+ * 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 __RT288X_RALINK_SOC_H
+#define __RT288X_RALINK_SOC_H
+
+#define RALINK_SOC_GPIO_BASE 0x10000600
+
+#define RALINK_SOC_GPIO0_COUNT 24
+#define RALINK_SOC_GPIO1_COUNT 16
+#define RALINK_SOC_GPIO2_COUNT 12
+
+#endif /* __RT288X_RALINK_SOC_H */
diff --git a/target/linux/ramips/files/arch/mips/include/asm/mach-ralink/rt305x_regs.h b/target/linux/ramips/files/arch/mips/include/asm/mach-ralink/rt305x_regs.h
index 139dc92e5..d4a192063 100644
--- a/target/linux/ramips/files/arch/mips/include/asm/mach-ralink/rt305x_regs.h
+++ b/target/linux/ramips/files/arch/mips/include/asm/mach-ralink/rt305x_regs.h
@@ -20,7 +20,6 @@
#define RT305X_MEMC_BASE 0x10000300
#define RT305X_PCM_BASE 0x10000400
#define RT305X_UART0_BASE 0x10000500
-#define RT305X_PIO_BASE 0x10000600
#define RT305X_GDMA_BASE 0x10000700
#define RT305X_NANDC_BASE 0x10000800
#define RT305X_I2C_BASE 0x10000900