20 #include <linux/input.h>
24 #include <linux/kernel.h>
25 #include <linux/module.h>
27 #include <linux/slab.h>
29 #include <asm/delay.h>
32 #define PCCR 0xa4000104
33 #define PDCR 0xa4000106
34 #define PECR 0xa4000108
35 #define PFCR 0xa400010a
36 #define PCDR 0xa4000124
37 #define PDDR 0xa4000126
38 #define PEDR 0xa4000128
39 #define PFDR 0xa400012a
40 #define PGDR 0xa400012c
41 #define PHDR 0xa400012e
42 #define PJDR 0xa4000130
43 #define PKDR 0xa4000132
44 #define PLDR 0xa4000134
46 static const unsigned short jornada_scancodes[] = {
63 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
67 #define JORNADA_SCAN_SIZE 18
79 struct input_dev *input_dev = jornadakbd->
poll_dev->input;
80 unsigned short *keymap = jornadakbd->
keymap;
81 unsigned int sync_me = 0;
85 unsigned char new = jornadakbd->
new_scan[
i];
86 unsigned char old = jornadakbd->
old_scan[
i];
87 unsigned int xor =
new ^ old;
92 for (j = 0; j < 8; j++) {
93 unsigned int bit = 1 <<
j;
95 unsigned int scancode = (i << 3) + j;
98 input_report_key(input_dev,
107 input_sync(input_dev);
110 static void jornada_scan_keyb(
unsigned char *
s)
113 unsigned short ec_static, dc_static;
114 unsigned char matrix_switch[] = {
123 }, *
t = matrix_switch;
130 unsigned short matrix_PDE[] = {
145 for (i = 0; i < 8; i++) {
173 static void jornadakbd680_poll(
struct input_polled_dev *
dev)
175 struct jornadakbd *jornadakbd = dev->private;
177 jornada_scan_keyb(jornadakbd->
new_scan);
178 jornada_parse_kbd(jornadakbd);
184 struct jornadakbd *jornadakbd;
185 struct input_polled_dev *poll_dev;
186 struct input_dev *input_dev;
189 jornadakbd = kzalloc(
sizeof(
struct jornadakbd),
GFP_KERNEL);
199 platform_set_drvdata(pdev, jornadakbd);
204 sizeof(jornadakbd->
keymap));
206 poll_dev->private = jornadakbd;
207 poll_dev->poll = jornadakbd680_poll;
208 poll_dev->poll_interval = 50;
210 input_dev = poll_dev->input;
212 input_dev->name =
"HP Jornada 680 keyboard";
213 input_dev->phys =
"jornadakbd/input0";
214 input_dev->keycode = jornadakbd->
keymap;
215 input_dev->keycodesize =
sizeof(
unsigned short);
216 input_dev->keycodemax =
ARRAY_SIZE(jornada_scancodes);
217 input_dev->dev.parent = &pdev->
dev;
220 for (i = 0; i < 128; i++)
221 if (jornadakbd->
keymap[i])
234 printk(
KERN_ERR "Jornadakbd: failed to register driver, error: %d\n",
236 platform_set_drvdata(pdev,
NULL);
245 struct jornadakbd *jornadakbd = platform_get_drvdata(pdev);
247 platform_set_drvdata(pdev,
NULL);
257 .name =
"jornada680_kbd",
260 .probe = jornada680kbd_probe,