Skip to content

Commit

Permalink
Input: add Tosa keyboard driver
Browse files Browse the repository at this point in the history
Add keyboard support on tosa (Sharp Zaurus SL-6000x).
Largely based on patches by Dirk Opfer.

Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
  • Loading branch information
Dmitry Baryshkov authored and Dmitry Torokhov committed Jan 21, 2008
1 parent 52fe0cd commit 93e9012
Show file tree
Hide file tree
Showing 5 changed files with 510 additions and 0 deletions.
43 changes: 43 additions & 0 deletions arch/arm/mach-pxa/tosa.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
#include <linux/mmc/host.h>
#include <linux/pm.h>
#include <linux/delay.h>
#include <linux/gpio_keys.h>
#include <linux/input.h>

#include <asm/setup.h>
#include <asm/memory.h>
Expand Down Expand Up @@ -253,6 +255,46 @@ static struct platform_device tosakbd_device = {
.id = -1,
};

static struct gpio_keys_button tosa_gpio_keys[] = {
{
.type = EV_PWR,
.code = KEY_SUSPEND,
.gpio = TOSA_GPIO_ON_KEY,
.desc = "On key",
.wakeup = 1,
.active_low = 1,
},
{
.type = EV_KEY,
.code = TOSA_KEY_RECORD,
.gpio = TOSA_GPIO_RECORD_BTN,
.desc = "Record Button",
.wakeup = 1,
.active_low = 1,
},
{
.type = EV_KEY,
.code = TOSA_KEY_SYNC,
.gpio = TOSA_GPIO_SYNC,
.desc = "Sync Button",
.wakeup = 1,
.active_low = 1,
},
};

static struct gpio_keys_platform_data tosa_gpio_keys_platform_data = {
.buttons = tosa_gpio_keys,
.nbuttons = ARRAY_SIZE(tosa_gpio_keys),
};

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

/*
* Tosa LEDs
*/
Expand All @@ -265,6 +307,7 @@ static struct platform_device *devices[] __initdata = {
&tosascoop_device,
&tosascoop_jc_device,
&tosakbd_device,
&tosa_gpio_keys_device,
&tosaled_device,
};

Expand Down
21 changes: 21 additions & 0 deletions drivers/input/keyboard/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,27 @@ config KEYBOARD_SPITZ
To compile this driver as a module, choose M here: the
module will be called spitzkbd.

config KEYBOARD_TOSA
tristate "Tosa keyboard"
depends on MACH_TOSA
default y
help
Say Y here to enable the keyboard on the Sharp Zaurus SL-6000x (Tosa)

To compile this driver as a module, choose M here: the
module will be called tosakbd.

config KEYBOARD_TOSA_USE_EXT_KEYCODES
bool "Tosa keyboard: use extended keycodes"
depends on KEYBOARD_TOSA
default n
help
Say Y here to enable the tosa keyboard driver to generate extended
(>= 127) keycodes. Be aware, that they can't be correctly interpreted
by either console keyboard driver or by Kdrive keybd driver.

Say Y only if you know, what you are doing!

config KEYBOARD_AMIGA
tristate "Amiga keyboard"
depends on AMIGA
Expand Down
1 change: 1 addition & 0 deletions drivers/input/keyboard/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ obj-$(CONFIG_KEYBOARD_NEWTON) += newtonkbd.o
obj-$(CONFIG_KEYBOARD_STOWAWAY) += stowaway.o
obj-$(CONFIG_KEYBOARD_CORGI) += corgikbd.o
obj-$(CONFIG_KEYBOARD_SPITZ) += spitzkbd.o
obj-$(CONFIG_KEYBOARD_TOSA) += tosakbd.o
obj-$(CONFIG_KEYBOARD_HIL) += hil_kbd.o
obj-$(CONFIG_KEYBOARD_HIL_OLD) += hilkbd.o
obj-$(CONFIG_KEYBOARD_OMAP) += omap-keypad.o
Expand Down
Loading

0 comments on commit 93e9012

Please sign in to comment.