Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 172779
b: refs/heads/master
c: f014ee3
h: refs/heads/master
i:
  172777: efbea38
  172775: 79f84e4
v: v3
  • Loading branch information
Jani Nikula authored and Tony Lindgren committed Nov 22, 2009
1 parent 6e84d9b commit f3cb05a
Show file tree
Hide file tree
Showing 3 changed files with 84 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: 76b5c84f77c3abc92a3c4e185e7b78f17a0ed204
refs/heads/master: f014ee320e8779c1798998f75bfc3cef2b46286f
2 changes: 1 addition & 1 deletion trunk/arch/arm/configs/rx51_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -784,7 +784,7 @@ CONFIG_INPUT_KEYBOARD=y
# CONFIG_KEYBOARD_XTKBD is not set
# CONFIG_KEYBOARD_NEWTON is not set
# CONFIG_KEYBOARD_STOWAWAY is not set
# CONFIG_KEYBOARD_GPIO is not set
CONFIG_KEYBOARD_GPIO=m
# CONFIG_INPUT_MOUSE is not set
# CONFIG_INPUT_JOYSTICK is not set
# CONFIG_INPUT_TABLET is not set
Expand Down
82 changes: 82 additions & 0 deletions trunk/arch/arm/mach-omap2/board-rx51-peripherals.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include <linux/delay.h>
#include <linux/regulator/machine.h>
#include <linux/gpio.h>
#include <linux/gpio_keys.h>
#include <linux/mmc/host.h>

#include <plat/mcspi.h>
Expand All @@ -36,6 +37,86 @@
#define SYSTEM_REV_B_USES_VAUX3 0x1699
#define SYSTEM_REV_S_USES_VAUX3 0x8

#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)

#define RX51_GPIO_CAMERA_LENS_COVER 110
#define RX51_GPIO_CAMERA_FOCUS 68
#define RX51_GPIO_CAMERA_CAPTURE 69
#define RX51_GPIO_KEYPAD_SLIDE 71
#define RX51_GPIO_LOCK_BUTTON 113
#define RX51_GPIO_PROXIMITY 89

#define RX51_GPIO_DEBOUNCE_TIMEOUT 10

static struct gpio_keys_button rx51_gpio_keys[] = {
{
.desc = "Camera Lens Cover",
.type = EV_SW,
.code = SW_CAMERA_LENS_COVER,
.gpio = RX51_GPIO_CAMERA_LENS_COVER,
.active_low = 1,
.debounce_interval = RX51_GPIO_DEBOUNCE_TIMEOUT,
}, {
.desc = "Camera Focus",
.type = EV_KEY,
.code = KEY_CAMERA_FOCUS,
.gpio = RX51_GPIO_CAMERA_FOCUS,
.active_low = 1,
.debounce_interval = RX51_GPIO_DEBOUNCE_TIMEOUT,
}, {
.desc = "Camera Capture",
.type = EV_KEY,
.code = KEY_CAMERA,
.gpio = RX51_GPIO_CAMERA_CAPTURE,
.active_low = 1,
.debounce_interval = RX51_GPIO_DEBOUNCE_TIMEOUT,
}, {
.desc = "Lock Button",
.type = EV_KEY,
.code = KEY_SCREENLOCK,
.gpio = RX51_GPIO_LOCK_BUTTON,
.active_low = 1,
.debounce_interval = RX51_GPIO_DEBOUNCE_TIMEOUT,
}, {
.desc = "Keypad Slide",
.type = EV_SW,
.code = SW_KEYPAD_SLIDE,
.gpio = RX51_GPIO_KEYPAD_SLIDE,
.active_low = 1,
.debounce_interval = RX51_GPIO_DEBOUNCE_TIMEOUT,
}, {
.desc = "Proximity Sensor",
.type = EV_SW,
.code = SW_FRONT_PROXIMITY,
.gpio = RX51_GPIO_PROXIMITY,
.active_low = 0,
.debounce_interval = RX51_GPIO_DEBOUNCE_TIMEOUT,
}
};

static struct gpio_keys_platform_data rx51_gpio_keys_data = {
.buttons = rx51_gpio_keys,
.nbuttons = ARRAY_SIZE(rx51_gpio_keys),
};

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

static void __init rx51_add_gpio_keys(void)
{
platform_device_register(&rx51_gpio_keys_device);
}
#else
static void __init rx51_add_gpio_keys(void)
{
}
#endif /* CONFIG_KEYBOARD_GPIO || CONFIG_KEYBOARD_GPIO_MODULE */

static int board_keymap[] = {
KEY(0, 0, KEY_Q),
KEY(0, 1, KEY_O),
Expand Down Expand Up @@ -541,5 +622,6 @@ void __init rx51_peripherals_init(void)
rx51_i2c_init();
board_onenand_init();
board_smc91x_init();
rx51_add_gpio_keys();
}

0 comments on commit f3cb05a

Please sign in to comment.