Commit 93e9012f authored by Dmitry Baryshkov's avatar Dmitry Baryshkov Committed by Dmitry Torokhov

Input: add Tosa keyboard driver

Add keyboard support on tosa (Sharp Zaurus SL-6000x).
Largely based on patches by Dirk Opfer.
Signed-off-by: default avatarDmitry Baryshkov <dbaryshkov@gmail.com>
Signed-off-by: default avatarDmitry Torokhov <dtor@mail.ru>
parent 52fe0cdb
......@@ -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>
......@@ -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
*/
......@@ -265,6 +307,7 @@ static struct platform_device *devices[] __initdata = {
&tosascoop_device,
&tosascoop_jc_device,
&tosakbd_device,
&tosa_gpio_keys_device,
&tosaled_device,
};
......
......@@ -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
......
......@@ -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
......
This diff is collapsed.
......@@ -163,4 +163,34 @@
extern struct platform_device tosascoop_jc_device;
extern struct platform_device tosascoop_device;
#define TOSA_KEY_SYNC KEY_102ND /* ??? */
#ifndef CONFIG_KEYBOARD_TOSA_USE_EXT_KEYCODES
#define TOSA_KEY_RECORD KEY_YEN
#define TOSA_KEY_ADDRESSBOOK KEY_KATAKANA
#define TOSA_KEY_CANCEL KEY_ESC
#define TOSA_KEY_CENTER KEY_HIRAGANA
#define TOSA_KEY_OK KEY_HENKAN
#define TOSA_KEY_CALENDAR KEY_KATAKANAHIRAGANA
#define TOSA_KEY_HOMEPAGE KEY_HANGEUL
#define TOSA_KEY_LIGHT KEY_MUHENKAN
#define TOSA_KEY_MENU KEY_HANJA
#define TOSA_KEY_FN KEY_RIGHTALT
#define TOSA_KEY_MAIL KEY_ZENKAKUHANKAKU
#else
#define TOSA_KEY_RECORD KEY_RECORD
#define TOSA_KEY_ADDRESSBOOK KEY_ADDRESSBOOK
#define TOSA_KEY_CANCEL KEY_CANCEL
#define TOSA_KEY_CENTER KEY_SELECT /* ??? */
#define TOSA_KEY_OK KEY_OK
#define TOSA_KEY_CALENDAR KEY_CALENDAR
#define TOSA_KEY_HOMEPAGE KEY_HOMEPAGE
#define TOSA_KEY_LIGHT KEY_KBDILLUMTOGGLE
#define TOSA_KEY_MENU KEY_MENU
#define TOSA_KEY_FN KEY_FN
#define TOSA_KEY_MAIL KEY_MAIL
#endif
#endif /* _ASM_ARCH_TOSA_H_ */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment