Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 112514
b: refs/heads/master
c: 3d014b0
h: refs/heads/master
v: v3
  • Loading branch information
Albert Aribaud authored and Nicolas Pitre committed Sep 25, 2008
1 parent bce403a commit a88ca6b
Show file tree
Hide file tree
Showing 2 changed files with 61 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: 2d0c9e735ab8413d3cf29576ab14e07f7aa8eab9
refs/heads/master: 3d014b01e54ce08d15a598f0bfb3ce597f14ca03
60 changes: 60 additions & 0 deletions trunk/arch/arm/mach-orion5x/edmini_v2-setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
#include <linux/irq.h>
#include <linux/mtd/physmap.h>
#include <linux/mv643xx_eth.h>
#include <linux/leds.h>
#include <linux/gpio_keys.h>
#include <linux/input.h>
#include <linux/i2c.h>
#include <linux/ata_platform.h>
#include <linux/gpio.h>
Expand Down Expand Up @@ -119,6 +122,61 @@ static struct mv_sata_platform_data edmini_v2_sata_data = {
.n_ports = 2,
};

/*****************************************************************************
* GPIO LED (simple - doesn't use hardware blinking support)
****************************************************************************/

#define EDMINI_V2_GPIO_LED_POWER 16

static struct gpio_led edmini_v2_leds[] = {
{
.name = "power:blue",
.gpio = EDMINI_V2_GPIO_LED_POWER,
.active_low = 1,
},
};

static struct gpio_led_platform_data edmini_v2_led_data = {
.num_leds = ARRAY_SIZE(edmini_v2_leds),
.leds = edmini_v2_leds,
};

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

/****************************************************************************
* GPIO key
****************************************************************************/

#define EDMINI_V2_GPIO_KEY_POWER 18

static struct gpio_keys_button edmini_v2_buttons[] = {
{
.code = KEY_POWER,
.gpio = EDMINI_V2_GPIO_KEY_POWER,
.desc = "Power Button",
.active_low = 0,
},
};

static struct gpio_keys_platform_data edmini_v2_button_data = {
.buttons = edmini_v2_buttons,
.nbuttons = ARRAY_SIZE(edmini_v2_buttons),
};

static struct platform_device edmini_v2_gpio_buttons = {
.name = "gpio-keys",
.id = -1,
.dev = {
.platform_data = &edmini_v2_button_data,
},
};

/*****************************************************************************
* General Setup
****************************************************************************/
Expand Down Expand Up @@ -170,6 +228,8 @@ static void __init edmini_v2_init(void)
orion5x_setup_dev_boot_win(EDMINI_V2_NOR_BOOT_BASE,
EDMINI_V2_NOR_BOOT_SIZE);
platform_device_register(&edmini_v2_nor_flash);
platform_device_register(&edmini_v2_gpio_leds);
platform_device_register(&edmini_v2_gpio_buttons);

pr_notice("edmini_v2: USB device port, flash write and power-off "
"are not yet supported.\n");
Expand Down

0 comments on commit a88ca6b

Please sign in to comment.