summaryrefslogtreecommitdiff
path: root/packages/linux/linux-jlime-arm-2.6.17/Newfile-Jornada720_ts.patch
diff options
context:
space:
mode:
Diffstat (limited to 'packages/linux/linux-jlime-arm-2.6.17/Newfile-Jornada720_ts.patch')
-rw-r--r--packages/linux/linux-jlime-arm-2.6.17/Newfile-Jornada720_ts.patch106
1 files changed, 106 insertions, 0 deletions
diff --git a/packages/linux/linux-jlime-arm-2.6.17/Newfile-Jornada720_ts.patch b/packages/linux/linux-jlime-arm-2.6.17/Newfile-Jornada720_ts.patch
new file mode 100644
index 0000000000..6cfab690f3
--- /dev/null
+++ b/packages/linux/linux-jlime-arm-2.6.17/Newfile-Jornada720_ts.patch
@@ -0,0 +1,106 @@
+--- linux-2.6.17/drivers/input/touchscreen/jornada720_ts.c_orig 2006-07-03 00:17:18.000000000 +0000
++++ linux-2.6.17/drivers/input/touchscreen/jornada720_ts.c 2006-07-03 00:16:37.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");
++
++ init_input_dev(&dev);
++ 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);
++