diff options
Diffstat (limited to 'packages/linux/linux-jlime-arm-2.6.17/Newfile-Jornada720_kbd.patch')
-rw-r--r-- | packages/linux/linux-jlime-arm-2.6.17/Newfile-Jornada720_kbd.patch | 100 |
1 files changed, 100 insertions, 0 deletions
diff --git a/packages/linux/linux-jlime-arm-2.6.17/Newfile-Jornada720_kbd.patch b/packages/linux/linux-jlime-arm-2.6.17/Newfile-Jornada720_kbd.patch new file mode 100644 index 0000000000..d75cc7cd85 --- /dev/null +++ b/packages/linux/linux-jlime-arm-2.6.17/Newfile-Jornada720_kbd.patch @@ -0,0 +1,100 @@ +--- linux-2.6.17/drivers/input/keyboard/jornada720_kbd.c_orig 2006-07-03 00:18:52.000000000 +0000 ++++ linux-2.6.17/drivers/input/keyboard/jornada720_kbd.c 2006-07-03 00:16:36.000000000 +0000 +@@ -0,0 +1,97 @@ ++/* ++ * Jornada 720 keyboard interface ++ */ ++ ++#include <linux/input.h> ++#include <linux/module.h> ++#include <linux/kernel.h> ++#include <linux/init.h> ++#include <linux/delay.h> ++#include <linux/slab.h> ++#include <linux/errno.h> ++#include <linux/interrupt.h> ++ ++#include <asm/arch/hardware.h> ++#include <asm/arch/jornada720.h> ++#include <asm/irq.h> ++#include <asm/mach/irq.h> ++ ++MODULE_AUTHOR("Alex Lange <chicken@handhelds.org>"); ++MODULE_DESCRIPTION("Jornada 720 keyboard driver"); ++MODULE_LICENSE("GPL"); ++ ++static char jornada720_kbd_name[] = "Jornada 720 keyboard"; ++ ++static struct input_dev dev; ++ ++static unsigned char jornada720_normal_keymap[128] = { ++ 0, 1, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 87, KEY_VOLUMEUP, KEY_VOLUMEDOWN, KEY_MUTE, ++ 0, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 0, 0, 0, ++ 0, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 43, 14, 0, 0, 0, ++ 0, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, KEY_LEFTBRACE, KEY_RIGHTBRACE, 0, 0, 0, ++ 0, 44, 45, 46, 47, 48, 49, 50, 51, 52, KEY_KPMINUS, 40, 28, 0, 0, 0, ++ 0, 15, 0, 42, 0, 40, 0, 0, 0, 0, 103, 0, 54, 0, 0, 0, ++ 0, 0, 0, 0, 0, 56, KEY_GRAVE, 0, 0, 105, 108, 106, 0, 0, 0, 0, ++ 0, 55, 29, 0, 57, 0, 0, 0, 53, 111, 0, 0, 0, 0, 0, 116, ++}; ++ ++static irqreturn_t jornada720_keyboard_interrupt(int irq, void *dev_id, struct pt_regs *regs) ++{ ++ int key, keycode; ++ int count, mcu_data=0; ++ ++ jornada720_mcu_start(MCU_GetScanKeyCode); ++ count = jornada720_mcu_read(); ++ ++ while (count-- > 0) { ++ key = mcu_data = jornada720_mcu_read(); ++ ++ if (key > 128) ++ key = key - 128; ++ ++ keycode = jornada720_normal_keymap[key]; ++ ++ if (mcu_data < 128) { ++ input_report_key(&dev, keycode, 1); ++ input_sync(&dev); ++ } ++ else { ++ input_report_key(&dev, keycode, 0); ++ input_sync(&dev); ++ } ++ } ++ ++ jornada720_mcu_end(); ++ ++ return IRQ_HANDLED; ++} ++ ++static int __init jornada720_kbd_init(void) ++{ ++ int i; ++ printk("jorada720_kbd: Jornada 720 keyboard\n"); ++ ++ init_input_dev(&dev); ++ dev.evbit[0] = BIT(EV_KEY) | BIT(EV_REP); ++ dev.keybit[LONG(KEY_SUSPEND)] |= BIT(KEY_SUSPEND); ++ ++ for ( i=0 ; i<=128 ; i++ ) { ++ if (!(jornada720_normal_keymap[i])) { ++ } ++ else ++ set_bit(jornada720_normal_keymap[i], dev.keybit); ++ } ++ ++ dev.name = jornada720_kbd_name; ++ ++ if (request_irq(GPIO_JORNADA720_KEYBOARD_IRQ, jornada720_keyboard_interrupt, SA_INTERRUPT, "Jornada720 Keyboard", NULL)) ++ printk("Unable to grab Jornada 720 keyboard IRQ!\n"); ++ ++ set_irq_type(GPIO_JORNADA720_KEYBOARD_IRQ, IRQT_FALLING); ++ ++ input_register_device(&dev); ++ ++ return 0; ++} ++ ++module_init(jornada720_kbd_init); |