summaryrefslogtreecommitdiff
path: root/recipes/linux/linux-jlime-jornada7xx-2.6.17/Newfile-Jornada720_ts.patch
diff options
context:
space:
mode:
authorDenys Dmytriyenko <denis@denix.org>2009-03-17 14:32:59 -0400
committerDenys Dmytriyenko <denis@denix.org>2009-03-17 14:32:59 -0400
commit709c4d66e0b107ca606941b988bad717c0b45d9b (patch)
tree37ee08b1eb308f3b2b6426d5793545c38396b838 /recipes/linux/linux-jlime-jornada7xx-2.6.17/Newfile-Jornada720_ts.patch
parentfa6cd5a3b993f16c27de4ff82b42684516d433ba (diff)
rename packages/ to recipes/ per earlier agreement
See links below for more details: http://thread.gmane.org/gmane.comp.handhelds.openembedded/21326 http://thread.gmane.org/gmane.comp.handhelds.openembedded/21816 Signed-off-by: Denys Dmytriyenko <denis@denix.org> Acked-by: Mike Westerhof <mwester@dls.net> Acked-by: Philip Balister <philip@balister.org> Acked-by: Khem Raj <raj.khem@gmail.com> Acked-by: Marcin Juszkiewicz <hrw@openembedded.org> Acked-by: Koen Kooi <koen@openembedded.org> Acked-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
Diffstat (limited to 'recipes/linux/linux-jlime-jornada7xx-2.6.17/Newfile-Jornada720_ts.patch')
-rw-r--r--recipes/linux/linux-jlime-jornada7xx-2.6.17/Newfile-Jornada720_ts.patch106
1 files changed, 106 insertions, 0 deletions
diff --git a/recipes/linux/linux-jlime-jornada7xx-2.6.17/Newfile-Jornada720_ts.patch b/recipes/linux/linux-jlime-jornada7xx-2.6.17/Newfile-Jornada720_ts.patch
new file mode 100644
index 0000000000..b565d1077b
--- /dev/null
+++ b/recipes/linux/linux-jlime-jornada7xx-2.6.17/Newfile-Jornada720_ts.patch
@@ -0,0 +1,106 @@
+--- linux-2.6.17-vanilla/drivers/input/touchscreen/jornada720_ts.c 1970-01-01 00:00:00.000000000 +0000
++++ linux-2.6.17/drivers/input/touchscreen/jornada720_ts.c 2006-07-10 17:06:11.000000000 +0000
+@@ -0,0 +1,103 @@
++/*
++ * Jornada 720 touchscreen interface based on Jornada 56x 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 touchscreen driver");
++MODULE_LICENSE("GPL");
++
++static char jornada720_ts_name[] = "Jornada 720 touchscreen";
++
++static struct input_dev *dev;
++
++static irqreturn_t jornada720_mouse_interrupt(int irq, void *dev_id, struct pt_regs *regs)
++{
++ int down;
++ int X[3], Y[3], high_x, high_y, x, y;
++
++ udelay(1);
++
++ down = ( (GPLR & GPIO_JORNADA720_MOUSE) == 0);
++
++ if(!down) {
++ input_report_key(dev, BTN_TOUCH, down); /* report a pen up */
++ input_report_abs(dev, ABS_PRESSURE, 0);
++ input_sync(dev);
++ return IRQ_HANDLED;
++ }
++
++ /* read x & y data from mcu interface and pass it on */
++
++ jornada720_mcu_start(MCU_GetTouchSamples);
++ X[0] = jornada720_mcu_read();
++ X[1] = jornada720_mcu_read();
++ X[2] = jornada720_mcu_read();
++ Y[0] = jornada720_mcu_read();
++ Y[1] = jornada720_mcu_read();
++ Y[2] = jornada720_mcu_read();
++ high_x = jornada720_mcu_read(); /* msbs of samples */
++ high_y = jornada720_mcu_read();
++ jornada720_mcu_end();
++
++ X[0] |= (high_x & 3) << 8;
++ X[1] |= (high_x & 0xc) << 6;
++ X[2] |= (high_x & 0x30) << 4;
++
++ Y[0] |= (high_y & 3) << 8;
++ Y[1] |= (high_y & 0xc) << 6;
++ Y[2] |= (high_y & 0x30) << 4;
++
++ /* simple averaging filter */
++ x = (X[0] + X[1] + X[2])/3;
++ y = (Y[0] + Y[1] + Y[2])/3;
++
++ input_report_key(dev, BTN_TOUCH, down);
++ input_report_abs(dev, ABS_X, x);
++ input_report_abs(dev, ABS_Y, y);
++ input_report_abs(dev, ABS_PRESSURE, 1);
++ input_sync(dev);
++
++ return IRQ_HANDLED;
++
++}
++
++static int __init jornada720_ts_init(void)
++{
++ printk("jornada720_ts: Jornada 720 touchscreen\n");
++
++ dev = input_allocate_device();
++ dev->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS);
++ dev->absbit[0] = BIT(ABS_X) | BIT(ABS_Y) | BIT(ABS_PRESSURE);
++ dev->keybit[LONG(BTN_TOUCH)] = BIT(BTN_TOUCH);
++
++ dev->absmin[ABS_X] = 270; dev->absmin[ABS_Y] = 180;
++ dev->absmax[ABS_X] = 3900; dev->absmax[ABS_Y] = 3700;
++
++ dev->name = jornada720_ts_name;
++
++ if (request_irq(GPIO_JORNADA720_MOUSE_IRQ, jornada720_mouse_interrupt, SA_INTERRUPT, "Jornada720 Mouse", NULL))
++ printk("Unable to grab Jornada 720 touchscreen IRQ!\n");
++
++ set_irq_type(GPIO_JORNADA720_MOUSE_IRQ, IRQT_RISING);
++
++ input_register_device(dev);
++
++ return 0;
++}
++
++module_init(jornada720_ts_init);
++