public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
From: Dirk Behme <dirk.behme@de.bosch.com>
To: linux-omap-open-source@linux.omap.com
Subject: [PATCH] Convert touchscreen to input_allocate_device
Date: Sun, 04 Dec 2005 16:52:34 +0100	[thread overview]
Message-ID: <439310C2.3080406@de.bosch.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 427 bytes --]

ARM: OMAP: Convert touchscreen to input_allocate_device() to remove:

input: device omap_ts is statically allocated, will not register
Please convert to input_allocate_device() or contact dtor_core@ameritech.net

ARM: OMAP: Check in omap_ts_handler() if timer is still running. Delete
it if necessary. Else we will get Oops "kernel BUG at
include/linux/timer.h:83!"

Signed-off-by: Dirk Behme <dirk.behme_at_de.bosch.com>






[-- Attachment #2: touchscreen_input_allocate_device.patch --]
[-- Type: text/plain, Size: 3799 bytes --]

--- ./drivers/input/touchscreen/omap/omap_ts.c_orig	2005-12-02 17:41:07.000000000 +0100
+++ ./drivers/input/touchscreen/omap/omap_ts.c	2005-12-02 18:11:32.000000000 +0100
@@ -65,10 +65,10 @@ static int omap_ts_read(void)
 
 	ts_omap.dev->read(data);
 
-	input_report_abs(&(ts_omap.inputdevice), ABS_X, data[0]);
-	input_report_abs(&(ts_omap.inputdevice), ABS_Y, data[1]);
-	input_report_abs(&(ts_omap.inputdevice), ABS_PRESSURE, data[2]);
-	input_sync(&(ts_omap.inputdevice));
+	input_report_abs(ts_omap.inputdevice, ABS_X, data[0]);
+	input_report_abs(ts_omap.inputdevice, ABS_Y, data[1]);
+	input_report_abs(ts_omap.inputdevice, ABS_PRESSURE, data[2]);
+	input_sync(ts_omap.inputdevice);
 
 	DEBUG_TS("omap_ts_read: read x=%d,y=%d,p=%d\n", data[0], data[1],
 		 data[2]);
@@ -85,7 +85,7 @@ static void omap_ts_timer(unsigned long 
 	if (!ts_omap.dev->penup()) {
 		if (!ts_omap.touched) {
 			DEBUG_TS("omap_ts_timer: pen down\n");
-			input_report_key(&(ts_omap.inputdevice), BTN_TOUCH, 1);
+			input_report_key(ts_omap.inputdevice, BTN_TOUCH, 1);
 		}
 		ts_omap.touched = 1;
 		omap_ts_read();
@@ -95,12 +95,12 @@ static void omap_ts_timer(unsigned long 
 		if (ts_omap.touched) {
 			DEBUG_TS("omap_ts_timer: pen up\n");
 			ts_omap.touched = 0;
-			input_report_abs(&(ts_omap.inputdevice), ABS_X, 0);
-			input_report_abs(&(ts_omap.inputdevice), ABS_Y, 0);
-			input_report_abs(&(ts_omap.inputdevice), ABS_PRESSURE,
+			input_report_abs(ts_omap.inputdevice, ABS_X, 0);
+			input_report_abs(ts_omap.inputdevice, ABS_Y, 0);
+			input_report_abs(ts_omap.inputdevice, ABS_PRESSURE,
 					 0);
-			input_sync(&(ts_omap.inputdevice));
-			input_report_key(&(ts_omap.inputdevice), BTN_TOUCH, 0);
+			input_sync(ts_omap.inputdevice);
+			input_report_key(ts_omap.inputdevice, BTN_TOUCH, 0);
 		}
 		if (!ts_omap.irq_enabled) {
 			ts_omap.irq_enabled = 1;
@@ -119,7 +119,10 @@ static irqreturn_t omap_ts_handler(int i
 		ts_omap.irq_enabled = 0;
 		disable_irq(irq);
 	}
-	// restart acquire
+	// check for still pending timer, delete it if neccessary
+        if(timer_pending(&(ts_omap.ts_timer)))
+		del_timer(&(ts_omap.ts_timer));
+        // restart acquire
 	ts_omap.ts_timer.expires = jiffies + HZ / 100;
 	add_timer(&(ts_omap.ts_timer));
 
@@ -168,14 +171,14 @@ static int __init omap_ts_probe(struct p
 		return -EINVAL;
 	}
 
-	init_input_dev(&(ts_omap.inputdevice));
-	ts_omap.inputdevice.name = OMAP_TS_NAME;
-	ts_omap.inputdevice.dev = &pdev->dev;
-	ts_omap.inputdevice.evbit[0] = BIT(EV_KEY) | BIT(EV_ABS);
-	ts_omap.inputdevice.keybit[LONG(BTN_TOUCH)] |= BIT(BTN_TOUCH);
-	ts_omap.inputdevice.absbit[0] =
+	ts_omap.inputdevice = input_allocate_device();
+	ts_omap.inputdevice->name = OMAP_TS_NAME;
+	ts_omap.inputdevice->dev = &pdev->dev;
+	ts_omap.inputdevice->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS);
+	ts_omap.inputdevice->keybit[LONG(BTN_TOUCH)] |= BIT(BTN_TOUCH);
+	ts_omap.inputdevice->absbit[0] =
 	    BIT(ABS_X) | BIT(ABS_Y) | BIT(ABS_PRESSURE);
-	input_register_device(&(ts_omap.inputdevice));
+	input_register_device(ts_omap.inputdevice);
 
 	ts_omap.dev->enable();
 
@@ -187,7 +190,7 @@ static int __init omap_ts_probe(struct p
 static int omap_ts_remove(struct platform_device *pdev)
 {
 	ts_omap.dev->disable();
-	input_unregister_device(&ts_omap.inputdevice);
+	input_unregister_device(ts_omap.inputdevice);
 	if (ts_omap.irq != -1)
 		free_irq(ts_omap.irq, &ts_omap);
 
--- ./drivers/input/touchscreen/omap/omap_ts.h_orig	2005-12-02 17:42:30.000000000 +0100
+++ ./drivers/input/touchscreen/omap/omap_ts.h	2005-12-02 17:43:05.000000000 +0100
@@ -42,7 +42,7 @@ struct ts_device {
 };
 
 struct omap_ts_t{
-	struct input_dev inputdevice;
+	struct input_dev * inputdevice;
 	struct timer_list ts_timer;      // Timer for triggering acquisitions
 	int touched;
 	int irq;






[-- Attachment #3: Type: text/plain, Size: 0 bytes --]



             reply	other threads:[~2005-12-04 15:52 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-04 15:52 Dirk Behme [this message]
  -- strict thread matches above, loose matches on Subject: below --
2005-12-27  9:51 Pending patches Dirk Behme
2005-12-30 22:28 ` Tony Lindgren
2006-01-03 19:13   ` Pending patches mostly pushed, please check Tony Lindgren
2006-01-06 19:37     ` [PATCH] Convert touchscreen to input_allocate_device Dirk Behme
2006-01-14  0:18       ` Tony Lindgren
2006-01-16 11:59 Mikko.Soikkala
2006-01-16 18:15 ` Dirk Behme
2006-01-17 13:24 Mikko.Soikkala
2006-01-17 15:12 ` Komal Shah
2006-01-18  9:34 Mikko.Soikkala
2006-01-18 10:10 ` Komal Shah
2006-01-18 11:21   ` Juha Yrjölä
2006-01-18 16:39     ` Komal Shah
2006-01-20 23:07       ` Tony Lindgren

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=439310C2.3080406@de.bosch.com \
    --to=dirk.behme@de.bosch.com \
    --cc=linux-omap-open-source@linux.omap.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox