This patch makes the jornada 7xx touchscreen work without tsdev. It changes
the ABS values and makes sure the report_key is done in right order (for tslib).
We also change the printk's to use ERR instead of INFO.

Signed-off-by: Kristoffer Ericson <[EMAIL PROTECTED]>

diff --git a/drivers/input/touchscreen/jornada720_ts.c 
b/drivers/input/touchscreen/jornada720_ts.c
index 42a1c9a..5d68fad 100644
--- a/drivers/input/touchscreen/jornada720_ts.c
+++ b/drivers/input/touchscreen/jornada720_ts.c
@@ -1,6 +1,8 @@
 /*
  * drivers/input/touchscreen/jornada720_ts.c
  *
+ * HP Jornada 710/720/728 Touchscreen Driver
+ *
  * Copyright (C) 2007 Kristoffer Ericson <[EMAIL PROTECTED]>
  *
  *  Copyright (C) 2006 Filip Zyzniewski <[EMAIL PROTECTED]>
@@ -10,7 +12,6 @@
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
  *
- * HP Jornada 710/720/729 Touchscreen Driver
  */
 
 #include <linux/platform_device.h>
@@ -72,6 +73,7 @@ static irqreturn_t jornada720_ts_interrupt(int irq, void 
*dev_id)
 
        /* If GPIO_GPIO9 is set to high then report pen up */
        if (GPLR & GPIO_GPIO(9)) {
+               input_report_abs(input, ABS_PRESSURE, 0);
                input_report_key(input, BTN_TOUCH, 0);
                input_sync(input);
        } else {
@@ -84,12 +86,12 @@ static irqreturn_t jornada720_ts_interrupt(int irq, void 
*dev_id)
                        x = jornada720_ts_average(jornada_ts->x_data);
                        y = jornada720_ts_average(jornada_ts->y_data);
 
-                       input_report_key(input, BTN_TOUCH, 1);
                        input_report_abs(input, ABS_X, x);
                        input_report_abs(input, ABS_Y, y);
+                       input_report_abs(input, ABS_PRESSURE, 1);
+                       input_report_key(input, BTN_TOUCH, 1);
                        input_sync(input);
                }
-
                jornada_ssp_end();
        }
 
@@ -118,24 +120,27 @@ static int __devinit jornada720_ts_probe(struct 
platform_device *pdev)
        input_dev->phys = "jornadats/input0";
        input_dev->id.bustype = BUS_HOST;
        input_dev->dev.parent = &pdev->dev;
+       input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS);
+       input_dev->absbit[0] = BIT_MASK(ABS_X) | BIT_MASK(ABS_Y) | 
BIT_MASK(ABS_PRESSURE);
+       input_dev->keybit[BIT_WORD(BTN_TOUCH)] = BIT_MASK(BTN_TOUCH);
 
-       input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS);
-       input_dev->keybit[LONG(BTN_TOUCH)] = BIT(BTN_TOUCH);
-       input_set_abs_params(input_dev, ABS_X, 270, 3900, 0, 0);
-       input_set_abs_params(input_dev, ABS_Y, 180, 3700, 0, 0);
+       input_set_abs_params(input_dev, ABS_X, 79, 995, 0, 0);
+       input_set_abs_params(input_dev, ABS_Y, 75, 910, 0, 0);
 
        error = request_irq(IRQ_GPIO9,
                        jornada720_ts_interrupt,
                        IRQF_DISABLED | IRQF_TRIGGER_RISING,
                        "HP7XX Touchscreen driver", pdev);
        if (error) {
-               printk(KERN_INFO "HP7XX TS : Unable to acquire irq!\n");
+               printk(KERN_ERR "ts : unable to acquire irq!\n");
                goto fail1;
        }
 
        error = input_register_device(jornada_ts->dev);
-       if (error)
+       if (error) {
+               printk(KERN_ERR "ts : unable to register device\n");
                goto fail2;
+       }
 
        return 0;
 


-- 
Kristoffer Ericson <[EMAIL PROTECTED]>

Reply via email to