Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 172647
b: refs/heads/master
c: c463eb6
h: refs/heads/master
i:
  172645: 997ad23
  172643: f889854
  172639: adde30c
v: v3
  • Loading branch information
Dmitry Artamonow authored and Russell King committed Dec 6, 2009
1 parent adcde24 commit 8df76c8
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4aa9755580650c7135c154bd4276411739e8fb60
refs/heads/master: c463eb62ac5bd8c26578cae42e1d5bb397aed100
39 changes: 38 additions & 1 deletion trunk/arch/arm/mach-sa1100/h3xxx.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@

#include <linux/kernel.h>
#include <linux/gpio.h>
#include <linux/gpio_keys.h>
#include <linux/input.h>
#include <linux/mfd/htc-egpio.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/partitions.h>
Expand Down Expand Up @@ -212,8 +214,44 @@ static struct platform_device h3xxx_egpio = {
},
};

/*
* GPIO keys
*/

static struct gpio_keys_button h3xxx_button_table[] = {
{
.code = KEY_POWER,
.gpio = H3XXX_GPIO_PWR_BUTTON,
.desc = "Power Button",
.active_low = 1,
.type = EV_KEY,
.wakeup = 1,
}, {
.code = KEY_ENTER,
.gpio = H3XXX_GPIO_ACTION_BUTTON,
.active_low = 1,
.desc = "Action button",
.type = EV_KEY,
.wakeup = 0,
},
};

static struct gpio_keys_platform_data h3xxx_keys_data = {
.buttons = h3xxx_button_table,
.nbuttons = ARRAY_SIZE(h3xxx_button_table),
};

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

static struct platform_device *h3xxx_devices[] = {
&h3xxx_egpio,
&h3xxx_keys,
};

void __init h3xxx_mach_init(void)
Expand Down Expand Up @@ -260,7 +298,6 @@ void __init h3xxx_map_io(void)

/* Configure suspend conditions */
PGSR = 0;
PWER = PWER_GPIO0;
PCFR = PCFR_OPDE;
PSDR = 0;

Expand Down

0 comments on commit 8df76c8

Please sign in to comment.