Commit 72f9df40 authored by Dmitry Torokhov's avatar Dmitry Torokhov

Input: jornada720_kbd - send MSC_SCAN events

Send MSC_SCAN events to userspace to ease task of adjusting
keymap.
Signed-off-by: default avatarDmitry Torokhov <dtor@mail.ru>
parent 5637f02a
...@@ -59,7 +59,8 @@ static irqreturn_t jornada720_kbd_interrupt(int irq, void *dev_id) ...@@ -59,7 +59,8 @@ static irqreturn_t jornada720_kbd_interrupt(int irq, void *dev_id)
{ {
struct platform_device *pdev = dev_id; struct platform_device *pdev = dev_id;
struct jornadakbd *jornadakbd = platform_get_drvdata(pdev); struct jornadakbd *jornadakbd = platform_get_drvdata(pdev);
u8 count, kbd_data; struct input_dev *input = jornadakbd->input;
u8 count, kbd_data, scan_code;
/* startup ssp with spinlock */ /* startup ssp with spinlock */
jornada_ssp_start(); jornada_ssp_start();
...@@ -77,11 +78,12 @@ static irqreturn_t jornada720_kbd_interrupt(int irq, void *dev_id) ...@@ -77,11 +78,12 @@ static irqreturn_t jornada720_kbd_interrupt(int irq, void *dev_id)
while (count--) { while (count--) {
/* Exchange TxDummy for location (keymap[kbddata]) */ /* Exchange TxDummy for location (keymap[kbddata]) */
kbd_data = jornada_ssp_byte(TXDUMMY); kbd_data = jornada_ssp_byte(TXDUMMY);
scan_code = kbd_data & 0x7f;
input_report_key(jornadakbd->input, input_event(input, EV_MSC, MSC_SCAN, scan_code);
jornadakbd->keymap[kbd_data & 0x7f], input_report_key(input, jornadakbd->keymap[scan_code],
!(kbd_data & 0x80)); !(kbd_data & 0x80));
input_sync(jornadakbd->input); input_sync(input);
} }
} }
...@@ -123,6 +125,8 @@ static int __devinit jornada720_kbd_probe(struct platform_device *pdev) ...@@ -123,6 +125,8 @@ static int __devinit jornada720_kbd_probe(struct platform_device *pdev)
__set_bit(jornadakbd->keymap[i], input_dev->keybit); __set_bit(jornadakbd->keymap[i], input_dev->keybit);
__clear_bit(KEY_RESERVED, input_dev->keybit); __clear_bit(KEY_RESERVED, input_dev->keybit);
input_set_capability(input_dev, EV_MSC, MSC_SCAN);
err = request_irq(IRQ_GPIO0, err = request_irq(IRQ_GPIO0,
jornada720_kbd_interrupt, jornada720_kbd_interrupt,
IRQF_DISABLED | IRQF_TRIGGER_FALLING, IRQF_DISABLED | IRQF_TRIGGER_FALLING,
......
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