aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2007-10-11 00:48:48 -0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2007-10-11 00:48:48 -0400
commit72f9df4023f9e44b29a48a5ea4954d89b18363fe (patch)
tree3b7c4b55fa47d032ee2957ca0fff40f99db7193c /drivers/input
parent5637f02a9cf84f2c00fd8a0f6561c375bb19103b (diff)
Input: jornada720_kbd - send MSC_SCAN events
Send MSC_SCAN events to userspace to ease task of adjusting keymap. Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input')
-rw-r--r--drivers/input/keyboard/jornada720_kbd.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/input/keyboard/jornada720_kbd.c b/drivers/input/keyboard/jornada720_kbd.c
index dd8a037f7281..e6696b3c9416 100644
--- a/drivers/input/keyboard/jornada720_kbd.c
+++ b/drivers/input/keyboard/jornada720_kbd.c
@@ -59,7 +59,8 @@ static irqreturn_t jornada720_kbd_interrupt(int irq, void *dev_id)
59{ 59{
60 struct platform_device *pdev = dev_id; 60 struct platform_device *pdev = dev_id;
61 struct jornadakbd *jornadakbd = platform_get_drvdata(pdev); 61 struct jornadakbd *jornadakbd = platform_get_drvdata(pdev);
62 u8 count, kbd_data; 62 struct input_dev *input = jornadakbd->input;
63 u8 count, kbd_data, scan_code;
63 64
64 /* startup ssp with spinlock */ 65 /* startup ssp with spinlock */
65 jornada_ssp_start(); 66 jornada_ssp_start();
@@ -77,11 +78,12 @@ static irqreturn_t jornada720_kbd_interrupt(int irq, void *dev_id)
77 while (count--) { 78 while (count--) {
78 /* Exchange TxDummy for location (keymap[kbddata]) */ 79 /* Exchange TxDummy for location (keymap[kbddata]) */
79 kbd_data = jornada_ssp_byte(TXDUMMY); 80 kbd_data = jornada_ssp_byte(TXDUMMY);
81 scan_code = kbd_data & 0x7f;
80 82
81 input_report_key(jornadakbd->input, 83 input_event(input, EV_MSC, MSC_SCAN, scan_code);
82 jornadakbd->keymap[kbd_data & 0x7f], 84 input_report_key(input, jornadakbd->keymap[scan_code],
83 !(kbd_data & 0x80)); 85 !(kbd_data & 0x80));
84 input_sync(jornadakbd->input); 86 input_sync(input);
85 } 87 }
86 } 88 }
87 89
@@ -123,6 +125,8 @@ static int __devinit jornada720_kbd_probe(struct platform_device *pdev)
123 __set_bit(jornadakbd->keymap[i], input_dev->keybit); 125 __set_bit(jornadakbd->keymap[i], input_dev->keybit);
124 __clear_bit(KEY_RESERVED, input_dev->keybit); 126 __clear_bit(KEY_RESERVED, input_dev->keybit);
125 127
128 input_set_capability(input_dev, EV_MSC, MSC_SCAN);
129
126 err = request_irq(IRQ_GPIO0, 130 err = request_irq(IRQ_GPIO0,
127 jornada720_kbd_interrupt, 131 jornada720_kbd_interrupt,
128 IRQF_DISABLED | IRQF_TRIGGER_FALLING, 132 IRQF_DISABLED | IRQF_TRIGGER_FALLING,