18 #include <linux/device.h>
19 #include <linux/errno.h>
22 #include <linux/input.h>
23 #include <linux/kernel.h>
24 #include <linux/module.h>
26 #include <linux/slab.h>
29 #include <mach/hardware.h>
30 #include <mach/irqs.h>
36 static unsigned short jornada_std_keymap[128] = {
39 0,
KEY_1,
KEY_2,
KEY_3,
KEY_4,
KEY_5,
KEY_6,
KEY_7,
KEY_8,
KEY_9,
41 0,
KEY_Q,
KEY_W,
KEY_E,
KEY_R,
KEY_T,
KEY_Y,
KEY_U,
KEY_I,
KEY_O,
43 0,
KEY_A,
KEY_S,
KEY_D,
KEY_F,
KEY_G,
KEY_H,
KEY_J,
KEY_K,
KEY_L,
47 0,
KEY_TAB, 0,
KEY_LEFTSHIFT, 0,
KEY_APOSTROPHE, 0, 0, 0, 0,
48 KEY_UP, 0,
KEY_RIGHTSHIFT, 0, 0, 0,0, 0, 0, 0, 0,
KEY_LEFTALT,
KEY_GRAVE,
49 0, 0,
KEY_LEFT,
KEY_DOWN,
KEY_RIGHT, 0, 0, 0, 0,0,
KEY_KPASTERISK,
50 KEY_LEFTCTRL, 0,
KEY_SPACE, 0, 0, 0,
KEY_SLASH,
KEY_DELETE, 0, 0,
72 "GetKeycode command failed with ETIMEDOUT, "
82 scan_code = kbd_data & 0x7f;
85 input_report_key(input, jornadakbd->
keymap[scan_code],
99 struct jornadakbd *jornadakbd;
100 struct input_dev *input_dev;
103 jornadakbd = kzalloc(
sizeof(
struct jornadakbd),
GFP_KERNEL);
104 input_dev = input_allocate_device();
105 if (!jornadakbd || !input_dev) {
110 platform_set_drvdata(pdev, jornadakbd);
113 sizeof(jornada_std_keymap));
114 jornadakbd->
input = input_dev;
117 input_dev->name =
"HP Jornada 720 keyboard";
118 input_dev->phys =
"jornadakbd/input0";
119 input_dev->keycode = jornadakbd->
keymap;
120 input_dev->keycodesize =
sizeof(
unsigned short);
121 input_dev->keycodemax =
ARRAY_SIZE(jornada_std_keymap);
123 input_dev->dev.parent = &pdev->
dev;
132 jornada720_kbd_interrupt,
140 err = input_register_device(jornadakbd->
input);
149 platform_set_drvdata(pdev,
NULL);
150 input_free_device(input_dev);
157 struct jornadakbd *jornadakbd = platform_get_drvdata(pdev);
160 platform_set_drvdata(pdev,
NULL);
161 input_unregister_device(jornadakbd->
input);
172 .name =
"jornada720_kbd",
175 .probe = jornada720_kbd_probe,