Skip to contentSkip to conversation

- Fix broken ABS values + minor changes

HP7xx/patch Kristoffer Ericson 1 participant 1 message Apr 27, 2008

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

This patch fixes MAX/MIN values of ABSX/ABSY. This is needed because we earlier dependend on tsdev emulation layer. We also change :
* all error output is going through KERN_ERR and not KERN_INFO.
* added comment regarding usage with tslib.
* use BIT_MASK() instead of BIT()

drivers/input/touchscreen/jornada720_ts.c +14 -10
index 7422421..26e85e8 100644
@@ -1,7 +1,8 @@
 /*
  * drivers/input/touchscreen/jornada720_ts.c
  *
- * Copyright (C) 2007 Kristoffer Ericson <[email protected]>
+ * HP Jornada 710/720/728 Touchscreen Driver
+ * Copyright (C) 2007-2008 Kristoffer Ericson <[email protected]>
  *
  *  Copyright (C) 2006 Filip Zyzniewski <[email protected]>
  *  based on HP Jornada 56x touchscreen driver by Alex Lange <[email protected]>
@@ -10,7 +11,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 +72,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)) {
+		/* note tslib currently expects ABS_PRESSURE report */
 		input_report_key(input, BTN_TOUCH, 0);
 		input_sync(input);
 	} else {
@@ -84,9 +85,10 @@ 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);
+			/* note tslib currently expects ABS_PRESSURE report */
 			input_report_abs(input, ABS_X, x);
 			input_report_abs(input, ABS_Y, y);
+			input_report_key(input, BTN_TOUCH, 1);
 			input_sync(input);
 		}
 
@@ -118,24 +120,26 @@ 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(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_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS);
+	input_dev->absbit[0] = BIT_MASK(ABS_X) | BIT_MASK(ABS_Y);
+	input_dev->keybit[BIT_WORD(BTN_TOUCH)] = BIT_MASK(BTN_TOUCH);
+	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;
 
Signature · 1 line
Kristoffer Ericson <[email protected]>
drivers/input/touchscreen/jornada720_ts.c +14 -10
index 7422421..26e85e8 100644
@@ -1,7 +1,8 @@
 /*
  * drivers/input/touchscreen/jornada720_ts.c
  *
- * Copyright (C) 2007 Kristoffer Ericson <[email protected]>
+ * HP Jornada 710/720/728 Touchscreen Driver
+ * Copyright (C) 2007-2008 Kristoffer Ericson <[email protected]>
  *
  *  Copyright (C) 2006 Filip Zyzniewski <[email protected]>
  *  based on HP Jornada 56x touchscreen driver by Alex Lange <[email protected]>
@@ -10,7 +11,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 +72,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)) {
+		/* note tslib currently expects ABS_PRESSURE report */
 		input_report_key(input, BTN_TOUCH, 0);
 		input_sync(input);
 	} else {
@@ -84,9 +85,10 @@ 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);
+			/* note tslib currently expects ABS_PRESSURE report */
 			input_report_abs(input, ABS_X, x);
 			input_report_abs(input, ABS_Y, y);
+			input_report_key(input, BTN_TOUCH, 1);
 			input_sync(input);
 		}
 
@@ -118,24 +120,26 @@ 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(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_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS);
+	input_dev->absbit[0] = BIT_MASK(ABS_X) | BIT_MASK(ABS_Y);
+	input_dev->keybit[BIT_WORD(BTN_TOUCH)] = BIT_MASK(BTN_TOUCH);
+	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;
 

-------------------------------------------------------------------

List admin: http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm-kernel
FAQ:        http://www.arm.linux.org.uk/mailinglists/faq.php
Etiquette:  http://www.arm.linux.org.uk/mailinglists/etiquette.php