Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 149195
b: refs/heads/master
c: 96e7d21
h: refs/heads/master
i:
  149193: c41bfec
  149191: 5f77f2e
v: v3
  • Loading branch information
Siddarth Gore authored and Nicolas Pitre committed Jun 8, 2009
1 parent c8a5db1 commit 8a078a6
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 91af7bb2f48e14892c5c961bca1fae5c7886532e
refs/heads/master: 96e7d211b46ce838ceca5d9734d6e166cfafdef4
74 changes: 74 additions & 0 deletions trunk/arch/arm/mach-kirkwood/mv88f6281gtw_ge-setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
#include <linux/timer.h>
#include <linux/mv643xx_eth.h>
#include <linux/ethtool.h>
#include <linux/gpio.h>
#include <linux/leds.h>
#include <linux/input.h>
#include <linux/gpio_keys.h>
#include <linux/spi/flash.h>
#include <linux/spi/spi.h>
#include <linux/spi/orion_spi.h>
Expand All @@ -26,6 +30,7 @@
#include <asm/mach/pci.h>
#include <mach/kirkwood.h>
#include "common.h"
#include "mpp.h"

static struct mv643xx_eth_platform_data mv88f6281gtw_ge_ge00_data = {
.phy_addr = MV643XX_ETH_PHY_NONE,
Expand Down Expand Up @@ -62,12 +67,79 @@ static struct spi_board_info __initdata mv88f6281gtw_ge_spi_slave_info[] = {
},
};

static struct gpio_keys_button mv88f6281gtw_ge_button_pins[] = {
{
.code = KEY_RESTART,
.gpio = 47,
.desc = "SWR Button",
.active_low = 1,
}, {
.code = KEY_F1,
.gpio = 46,
.desc = "WPS Button(F1)",
.active_low = 1,
},
};

static struct gpio_keys_platform_data mv88f6281gtw_ge_button_data = {
.buttons = mv88f6281gtw_ge_button_pins,
.nbuttons = ARRAY_SIZE(mv88f6281gtw_ge_button_pins),
};

static struct platform_device mv88f6281gtw_ge_buttons = {
.name = "gpio-keys",
.id = -1,
.num_resources = 0,
.dev = {
.platform_data = &mv88f6281gtw_ge_button_data,
},
};

static struct gpio_led mv88f6281gtw_ge_led_pins[] = {
{
.name = "gtw:green:Status",
.gpio = 20,
.active_low = 0,
}, {
.name = "gtw:red:Status",
.gpio = 21,
.active_low = 0,
}, {
.name = "gtw:green:USB",
.gpio = 12,
.active_low = 0,
},
};

static struct gpio_led_platform_data mv88f6281gtw_ge_led_data = {
.leds = mv88f6281gtw_ge_led_pins,
.num_leds = ARRAY_SIZE(mv88f6281gtw_ge_led_pins),
};

static struct platform_device mv88f6281gtw_ge_leds = {
.name = "leds-gpio",
.id = -1,
.dev = {
.platform_data = &mv88f6281gtw_ge_led_data,
},
};

static unsigned int mv88f6281gtw_ge_mpp_config[] __initdata = {
MPP12_GPO, /* Status#_USB pin */
MPP20_GPIO, /* Status#_GLED pin */
MPP21_GPIO, /* Status#_RLED pin */
MPP46_GPIO, /* WPS_Switch pin */
MPP47_GPIO, /* SW_Init pin */
0
};

static void __init mv88f6281gtw_ge_init(void)
{
/*
* Basic setup. Needs to be called early.
*/
kirkwood_init();
kirkwood_mpp_conf(mv88f6281gtw_ge_mpp_config);

kirkwood_ehci_init();
kirkwood_ge00_init(&mv88f6281gtw_ge_ge00_data);
Expand All @@ -76,6 +148,8 @@ static void __init mv88f6281gtw_ge_init(void)
ARRAY_SIZE(mv88f6281gtw_ge_spi_slave_info));
kirkwood_spi_init();
kirkwood_uart0_init();
platform_device_register(&mv88f6281gtw_ge_leds);
platform_device_register(&mv88f6281gtw_ge_buttons);
}

static int __init mv88f6281gtw_ge_pci_init(void)
Expand Down

0 comments on commit 8a078a6

Please sign in to comment.