summaryrefslogtreecommitdiff
path: root/target/linux/ifxmips/files
diff options
context:
space:
mode:
authorJohn Crispin <john@openwrt.org>2008-06-08 08:07:14 +0000
committerJohn Crispin <john@openwrt.org>2008-06-08 08:07:14 +0000
commitb3331b3d034e64d6ad70b61c3f3819cb5029033d (patch)
treea32d3767edc757899184c4becf4f3d975a05e2ea /target/linux/ifxmips/files
parent2fdfd541da1e7f4c038c650ee15f14e7dd9de380 (diff)
downloadmtk-20170518-b3331b3d034e64d6ad70b61c3f3819cb5029033d.zip
mtk-20170518-b3331b3d034e64d6ad70b61c3f3819cb5029033d.tar.gz
mtk-20170518-b3331b3d034e64d6ad70b61c3f3819cb5029033d.tar.bz2
adds gpiodev support to ifxmips
SVN-Revision: 11405
Diffstat (limited to 'target/linux/ifxmips/files')
-rw-r--r--target/linux/ifxmips/files/arch/mips/ifxmips/board.c28
-rw-r--r--target/linux/ifxmips/files/include/asm-mips/mach-ifxmips/gpio.h1
2 files changed, 25 insertions, 4 deletions
diff --git a/target/linux/ifxmips/files/arch/mips/ifxmips/board.c b/target/linux/ifxmips/files/arch/mips/ifxmips/board.c
index bcbf117..d925cf2 100644
--- a/target/linux/ifxmips/files/arch/mips/ifxmips/board.c
+++ b/target/linux/ifxmips/files/arch/mips/ifxmips/board.c
@@ -35,7 +35,7 @@
#include <asm/io.h>
#include <asm/ifxmips/ifxmips.h>
-#define MAX_IFXMIPS_DEVS 5
+#define MAX_IFXMIPS_DEVS 6
#define BOARD_DANUBE "Danube"
#define BOARD_DANUBE_CHIPID 0x10129083
@@ -96,6 +96,26 @@ static struct platform_device ifxmips_mtd[] =
},
};
+#ifdef CONFIG_GPIO_DEVICE
+static struct resource ifxmips_gpio_dev_resources[] = {
+ {
+ .name = "gpio",
+ .flags = 0,
+ .start = (1 << 0) | (1 << 1) | (1 << 2) | (1 << 3) | (1 << 4) | (1 << 5) | (1 << 8) | (1 << 9) | (1 << 12),
+ .end = (1 << 0) | (1 << 1) | (1 << 2) | (1 << 3) | (1 << 4) | (1 << 5) | (1 << 8) | (1 << 9) | (1 << 12),
+ },
+};
+
+static struct platform_device ifxmips_gpio_dev[] = {
+ {
+ .name = "GPIODEV",
+ .id = -1,
+ .num_resources = ARRAY_SIZE(ifxmips_gpio_dev_resources),
+ .resource = ifxmips_gpio_dev_resources,
+ }
+};
+#endif
+
const char*
get_system_type (void)
{
@@ -119,18 +139,18 @@ int __init ifxmips_init_devices(void)
* Currently we support 3 chips
* 1.) Danube
* 2.) Twinpass (Danube without dsl phy)
- * 3.) KDbg74 (used for debuging)
*/
int dev = 0;
/* the following devices are generic for all targets */
-
ifxmips_devs[dev++] = ifxmips_led;
ifxmips_devs[dev++] = ifxmips_gpio;
ifxmips_devs[dev++] = ifxmips_mii;
ifxmips_devs[dev++] = ifxmips_mtd;
-
+#ifdef CONFIG_GPIO_DEVICE
+ ifxmips_devs[dev++] = ifxmips_gpio_dev;
+#endif
return platform_add_devices(ifxmips_devs, dev);
}
diff --git a/target/linux/ifxmips/files/include/asm-mips/mach-ifxmips/gpio.h b/target/linux/ifxmips/files/include/asm-mips/mach-ifxmips/gpio.h
index 3083b88..18fd49e 100644
--- a/target/linux/ifxmips/files/include/asm-mips/mach-ifxmips/gpio.h
+++ b/target/linux/ifxmips/files/include/asm-mips/mach-ifxmips/gpio.h
@@ -24,6 +24,7 @@
#define _IFXMIPS_GPIO_H_
#include <asm/ifxmips/ifxmips.h>
+#include <asm/ifxmips/ifxmips_gpio.h>
static inline int gpio_direction_input(unsigned gpio) {
ifxmips_port_set_dir_in(0, gpio);