aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux
diff options
context:
space:
mode:
authorJohn Crispin <john@openwrt.org>2008-07-06 00:59:48 +0000
committerJohn Crispin <john@openwrt.org>2008-07-06 00:59:48 +0000
commit9e6c38917c9b612bc46a6a94ee406151193641a6 (patch)
treec514352597d2596a465e53e7d6dd43f4b6daeedc /target/linux
parent9be32c744bbbe93bb5f2697129b91d80f9d818ca (diff)
downloadupstream-9e6c38917c9b612bc46a6a94ee406151193641a6.tar.gz
upstream-9e6c38917c9b612bc46a6a94ee406151193641a6.tar.bz2
upstream-9e6c38917c9b612bc46a6a94ee406151193641a6.zip
make atheros wifi cards used on arcaydian 4519 ifxmips based boards work
SVN-Revision: 11676
Diffstat (limited to 'target/linux')
-rw-r--r--target/linux/ifxmips/config-2.6.252
-rw-r--r--target/linux/ifxmips/files/arch/mips/ifxmips/board.c32
-rw-r--r--target/linux/ifxmips/files/drivers/watchdog/ifxmips_wdt.c1
-rw-r--r--target/linux/ifxmips/files/include/asm-mips/mach-ifxmips/gpio.h20
4 files changed, 48 insertions, 7 deletions
diff --git a/target/linux/ifxmips/config-2.6.25 b/target/linux/ifxmips/config-2.6.25
index c15aa0be66..5cfa773ed7 100644
--- a/target/linux/ifxmips/config-2.6.25
+++ b/target/linux/ifxmips/config-2.6.25
@@ -93,7 +93,7 @@ CONFIG_INITRAMFS_SOURCE=""
CONFIG_IRQ_CPU=y
CONFIG_KALLSYMS=y
# CONFIG_LEDS_ALIX is not set
-# CONFIG_LEDS_GPIO is not set
+CONFIG_LEDS_GPIO=y
CONFIG_LEDS_IFXMIPS=y
# CONFIG_LEMOTE_FULONG is not set
CONFIG_LZO_COMPRESS=m
diff --git a/target/linux/ifxmips/files/arch/mips/ifxmips/board.c b/target/linux/ifxmips/files/arch/mips/ifxmips/board.c
index f0c2f70321..25cc03c6d3 100644
--- a/target/linux/ifxmips/files/arch/mips/ifxmips/board.c
+++ b/target/linux/ifxmips/files/arch/mips/ifxmips/board.c
@@ -32,6 +32,7 @@
#include <asm/io.h>
#include <linux/etherdevice.h>
#include <asm/ifxmips/ifxmips.h>
+#include <linux/leds.h>
#define MAX_BOARD_NAME_LEN 32
#define MAX_IFXMIPS_DEVS 9
@@ -120,6 +121,31 @@ ifxmips_gpio_dev = {
.num_resources = 1,
};
+#ifdef CONFIG_LEDS_GPIO
+static struct gpio_led arv4519_leds[] = {
+ { .name = "ifxmips:green:power0", .gpio = 3, .active_low = 0, },
+ { .name = "ifxmips:red:power1", .gpio = 7, .active_low = 1, },
+ { .name = "ifxmips:green:adsl", .gpio = 4, .active_low = 1, },
+ { .name = "ifxmips:green:internet0", .gpio = 5, .active_low = 0, },
+ { .name = "ifxmips:red:internet1", .gpio = 8, .active_low = 1, },
+ { .name = "ifxmips:green:wlan", .gpio = 6, .active_low = 1, },
+ { .name = "ifxmips:green:usb", .gpio = 19, .active_low = 1, },
+};
+
+static const struct gpio_led_platform_data arv4519_led_data = {
+ .num_leds = ARRAY_SIZE(arv4519_leds),
+ .leds = (void *) arv4519_leds,
+};
+
+static struct platform_device arv4519_gpio_leds = {
+ .name = "leds-gpio",
+ .id = -1,
+ .dev = {
+ .platform_data = (void *) &arv4519_led_data,
+ }
+};
+#endif
+
const char*
get_system_type(void)
{
@@ -235,8 +261,11 @@ static struct ifxmips_board boards[] =
.system_type = SYSTEM_DANUBE_CHIPID2,
.devs =
{
- &ifxmips_led, &ifxmips_gpio, &ifxmips_mii,
+ &ifxmips_gpio, &ifxmips_mii,
&ifxmips_mtd, &ifxmips_wdt, &ifxmips_gpio_dev,
+#ifdef CONFIG_LEDS_GPIO
+ &arv4519_gpio_leds,
+#endif
},
.reset_resource =
{
@@ -277,6 +306,7 @@ ifxmips_has_brn_block(void)
{
return ifxmips_brn;
}
+EXPORT_SYMBOL(ifxmips_has_brn_block);
struct ifxmips_board*
ifxmips_find_board(void)
diff --git a/target/linux/ifxmips/files/drivers/watchdog/ifxmips_wdt.c b/target/linux/ifxmips/files/drivers/watchdog/ifxmips_wdt.c
index 1556a23247..58e2161489 100644
--- a/target/linux/ifxmips/files/drivers/watchdog/ifxmips_wdt.c
+++ b/target/linux/ifxmips/files/drivers/watchdog/ifxmips_wdt.c
@@ -122,7 +122,6 @@ static int
ifxmips_wdt_open(struct inode *inode, struct file *file)
{
ifxmips_wdt_enable(wdt_timeout);
- printk("ifxmips_wdt: activated");
return nonseekable_open(inode, file);
}
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 0d207b0938..76d42c2e3b 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
@@ -26,23 +26,35 @@
#include <asm/ifxmips/ifxmips.h>
#include <asm/ifxmips/ifxmips_gpio.h>
+#define GPIO_TO_PORT(x) ((x > 15)?(1):(0))
+#define GPIO_TO_GPIO(x) ((x > 15)?(x-16):(x))
+
static inline int gpio_direction_input(unsigned gpio) {
- ifxmips_port_set_dir_in(0, gpio);
+ ifxmips_port_set_open_drain(GPIO_TO_PORT(gpio), GPIO_TO_GPIO(gpio));
+ ifxmips_port_clear_altsel0(GPIO_TO_PORT(gpio), GPIO_TO_GPIO(gpio));
+ ifxmips_port_clear_altsel1(GPIO_TO_PORT(gpio), GPIO_TO_GPIO(gpio));
+ ifxmips_port_set_dir_in(GPIO_TO_PORT(gpio), GPIO_TO_GPIO(gpio));
return 0;
}
static inline int gpio_direction_output(unsigned gpio, int value) {
- ifxmips_port_set_dir_out(0, gpio);
+ ifxmips_port_clear_open_drain(GPIO_TO_PORT(gpio), GPIO_TO_GPIO(gpio));
+ ifxmips_port_clear_altsel0(GPIO_TO_PORT(gpio), GPIO_TO_GPIO(gpio));
+ ifxmips_port_clear_altsel1(GPIO_TO_PORT(gpio), GPIO_TO_GPIO(gpio));
+ ifxmips_port_set_dir_out(GPIO_TO_PORT(gpio), GPIO_TO_GPIO(gpio));
return 0;
}
static inline int gpio_get_value(unsigned gpio) {
- ifxmips_port_get_input(0, gpio);
+ ifxmips_port_get_input(GPIO_TO_PORT(gpio), GPIO_TO_GPIO(gpio));
return 0;
}
static inline void gpio_set_value(unsigned gpio, int value) {
- ifxmips_port_set_output(0, gpio);
+ if(value)
+ ifxmips_port_set_output(GPIO_TO_PORT(gpio), GPIO_TO_GPIO(gpio));
+ else
+ ifxmips_port_clear_output(GPIO_TO_PORT(gpio), GPIO_TO_GPIO(gpio));
}
static inline int gpio_request(unsigned gpio, const char *label) {