[PATCH 2/2] Maple bus support for the SEGA Dreamcast - Dreamcast keyboard support

Previous thread: [PATCH 0/2] Maple bus support for the SEGA Dreamcast by Adrian McMenamin on Monday, September 10, 2007 - 7:16 pm. (1 message)

Next thread: [PATCH 1/2] Maple Bus support for SEGA Dreamcast by Adrian McMenamin on Monday, September 10, 2007 - 7:16 pm. (6 messages)
To: Dmitry Torokhov <dmitry.torokhov@...>, Paul Mundt <lethal@...>, <linux-kernel@...>, <linuxsh-dev@...>
Date: Monday, September 10, 2007 - 7:17 pm

Support for the Maple bus keyboard on the SEGA Dreamcast.

Signed-off by: Adrian McMenamin <adrian@mcmen.demon.co.uk>

diff --git a/drivers/input/keyboard/Kconfig b/drivers/input/keyboard/Kconfig
index c97d5eb..056cc52 100644
--- a/drivers/input/keyboard/Kconfig
+++ b/drivers/input/keyboard/Kconfig
@@ -253,4 +253,14 @@ config KEYBOARD_GPIO
To compile this driver as a module, choose M here: the
module will be called gpio-keys.

+
+config KEYBOARD_MAPLE
+ tristate "Maple bus keyboard"
+ depends on SH_DREAMCAST && MAPLE
+ help
+ Say Y here if you have a Dreamcast console running Linux and have
+ a keyboard attached to its Maple bus.
+
+ To compile this driver as a module, choose M here: the
+ module will be called maple_keyb.
endif
diff --git a/drivers/input/keyboard/Makefile b/drivers/input/keyboard/Makefile
index 28d211b..3f775ed 100644
--- a/drivers/input/keyboard/Makefile
+++ b/drivers/input/keyboard/Makefile
@@ -21,4 +21,5 @@ obj-$(CONFIG_KEYBOARD_OMAP) += omap-keypad.o
obj-$(CONFIG_KEYBOARD_PXA27x) += pxa27x_keyboard.o
obj-$(CONFIG_KEYBOARD_AAED2000) += aaed2000_kbd.o
obj-$(CONFIG_KEYBOARD_GPIO) += gpio_keys.o
+obj-$(CONFIG_KEYBOARD_MAPLE) += maple_keyb.o

diff --git a/drivers/input/keyboard/maple_keyb.c
b/drivers/input/keyboard/maple_keyb.c
new file mode 100644
index 0000000..c368b54
--- /dev/null
+++ b/drivers/input/keyboard/maple_keyb.c
@@ -0,0 +1,234 @@
+/*
+ * SEGA Dreamcast keyboard driver
+ * Based on drivers/usb/usbkbd.c
+ * Copyright YAEGASHI Takeshi, 2001
+ * Porting to 2.6 Copyright Adrian McMenamin, 2007
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHAN...

To: Adrian McMenamin <lkmladrian@...>
Cc: Paul Mundt <lethal@...>, <linux-kernel@...>, <linuxsh-dev@...>
Date: Tuesday, September 11, 2007 - 1:25 am

Ahem... That's not what I had in mind when I asked for memcpy. How about:

memcpy(kbd->keycode, dc_kbd_keycode, sizeof(kbd->keycode);

?

Thanks.

--
Dmitry
-

Previous thread: [PATCH 0/2] Maple bus support for the SEGA Dreamcast by Adrian McMenamin on Monday, September 10, 2007 - 7:16 pm. (1 message)

Next thread: [PATCH 1/2] Maple Bus support for SEGA Dreamcast by Adrian McMenamin on Monday, September 10, 2007 - 7:16 pm. (6 messages)