Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 96e7d211 authored by Siddarth Gore's avatar Siddarth Gore Committed by Nicolas Pitre
Browse files

[ARM] Kirkwood: enable gpio leds/buttons for the mv88f6281gtw_ge board

parent 91af7bb2
Loading
Loading
Loading
Loading
+74 −0
Original line number Original line Diff line number Diff line
@@ -17,6 +17,10 @@
#include <linux/timer.h>
#include <linux/timer.h>
#include <linux/mv643xx_eth.h>
#include <linux/mv643xx_eth.h>
#include <linux/ethtool.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/flash.h>
#include <linux/spi/spi.h>
#include <linux/spi/spi.h>
#include <linux/spi/orion_spi.h>
#include <linux/spi/orion_spi.h>
@@ -26,6 +30,7 @@
#include <asm/mach/pci.h>
#include <asm/mach/pci.h>
#include <mach/kirkwood.h>
#include <mach/kirkwood.h>
#include "common.h"
#include "common.h"
#include "mpp.h"


static struct mv643xx_eth_platform_data mv88f6281gtw_ge_ge00_data = {
static struct mv643xx_eth_platform_data mv88f6281gtw_ge_ge00_data = {
	.phy_addr	= MV643XX_ETH_PHY_NONE,
	.phy_addr	= MV643XX_ETH_PHY_NONE,
@@ -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)
static void __init mv88f6281gtw_ge_init(void)
{
{
	/*
	/*
	 * Basic setup. Needs to be called early.
	 * Basic setup. Needs to be called early.
	 */
	 */
	kirkwood_init();
	kirkwood_init();
	kirkwood_mpp_conf(mv88f6281gtw_ge_mpp_config);


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


static int __init mv88f6281gtw_ge_pci_init(void)
static int __init mv88f6281gtw_ge_pci_init(void)