public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
* Convert input devices to input_allocate_device
@ 2005-11-22 19:46 Dirk Behme
  2005-11-22 21:49 ` Dirk Behme
  2005-11-28  9:54 ` [PATCH] " Dirk Behme
  0 siblings, 2 replies; 4+ messages in thread
From: Dirk Behme @ 2005-11-22 19:46 UTC (permalink / raw)
  To: linux-omap-open-source

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

Hi,

while loading omapts and omap-keypad drivers as modules in
2.6.15-rc1-omap1 I get:

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

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

Converting them to input_allocate_device() (patch in the attachment)
results in clean loading:

OMAP Keypad Driver
MUX: initialized N14_1610_UWIRE_CS0
MUX: initialized P15_1610_UWIRE_CS3
MUX: initialized P20_1610_GPIO4
input: omap_ts as /class/input/input0
OMAP touchscreen driver initialized

But then ts_calibrate doesn't want to open touchscreen driver:

# ts_calibrate
ts_open: No such device

My standard TS configuration (worked quite good with the old
configuration) is:

./profile:4:export TSLIB_TSDEVICE='/dev/input/event1'
./ts.conf:2:module_raw input

Any ideas?

Thanks

Dirk











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

--- ./drivers/input/touchscreen/omap/omap_ts.c_orig	2005-11-22 20:14:23.258389432 +0100
+++ ./drivers/input/touchscreen/omap/omap_ts.c	2005-11-22 20:20:24.437481864 +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;
@@ -168,14 +168,14 @@ static int __init omap_ts_probe(struct d
 		return -EINVAL;
 	}
 
-	init_input_dev(&(ts_omap.inputdevice));
-	ts_omap.inputdevice.name = OMAP_TS_NAME;
-	ts_omap.inputdevice.dev = 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 = 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 +187,7 @@ static int __init omap_ts_probe(struct d
 static int __exit omap_ts_remove(struct device *dev)
 {
 	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-11-22 19:47:37.137556912 +0100
+++ ./drivers/input/touchscreen/omap/omap_ts.h	2005-11-22 20:09:03.938933368 +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;
--- ./drivers/input/keyboard/omap-keypad.c_orig	2005-11-22 20:17:15.222246952 +0100
+++ ./drivers/input/keyboard/omap-keypad.c	2005-11-22 20:20:56.918543992 +0100
@@ -44,7 +44,7 @@
 static void omap_kp_tasklet(unsigned long);
 static void omap_kp_timer(unsigned long);
 
-static struct input_dev omap_kp_dev;
+static struct input_dev * omap_kp_dev;
 static unsigned char keypad_state[8];
 static unsigned int keypad_irq = INT_KEYBOARD;
 
@@ -246,7 +246,7 @@ static void omap_kp_tasklet(unsigned lon
 				continue;
 			}
 
-			input_report_key(&omap_kp_dev, key,
+			input_report_key(omap_kp_dev, key,
 					 new_state[col] & (1 << row));
 #endif
 		}
@@ -277,7 +277,7 @@ static int __init omap_kp_init(void)
 
 	if (machine_is_omap_h2() || machine_is_omap_h3()) {
 		keymap = h2_keymap;
-		set_bit(EV_REP, omap_kp_dev.evbit);
+		set_bit(EV_REP, omap_kp_dev->evbit);
 	} else if (machine_is_omap_innovator()) {
 		keymap = innovator_keymap;
 	} else if (machine_is_omap_osk()) {
@@ -299,11 +299,11 @@ static int __init omap_kp_init(void)
 		return -EINVAL;
 
 	/* setup input device */
-	set_bit(EV_KEY, omap_kp_dev.evbit);
+	omap_kp_dev = input_allocate_device();
+	set_bit(EV_KEY, omap_kp_dev->evbit);
 	for (i = 0; keymap[i] != 0; i++)
-		set_bit(keymap[i] & 0x00ffffff, omap_kp_dev.keybit);
-	omap_kp_dev.name = "omap-keypad";
-	input_register_device(&omap_kp_dev);
+		set_bit(keymap[i] & 0x00ffffff, omap_kp_dev->keybit);
+	omap_kp_dev->name = "omap-keypad";
 
 	if (machine_is_omap_h2() || machine_is_omap_h3()) {
 		omap_cfg_reg(F18_1610_KBC0);
@@ -353,7 +353,7 @@ static void __exit omap_kp_exit(void)
 	del_timer_sync(&kp_timer);
 
 	/* unregister everything */
-	input_unregister_device(&omap_kp_dev);
+	input_unregister_device(omap_kp_dev);
 }
 
 module_init(omap_kp_init);



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

_______________________________________________
Linux-omap-open-source mailing list
Linux-omap-open-source@linux.omap.com
http://linux.omap.com/mailman/listinfo/linux-omap-open-source

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Convert input devices to input_allocate_device
  2005-11-22 19:46 Convert input devices to input_allocate_device Dirk Behme
@ 2005-11-22 21:49 ` Dirk Behme
  2005-11-28  9:54 ` [PATCH] " Dirk Behme
  1 sibling, 0 replies; 4+ messages in thread
From: Dirk Behme @ 2005-11-22 21:49 UTC (permalink / raw)
  To: linux-omap-open-source

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

Dirk Behme wrote:
> # ts_calibrate
> ts_open: No such device

Missed an input_register_device(omap_kp_dev) in omap-keypad. TS became 
event0 and so ts_calibrate can't open event1 ;) Corrected patch in the 
attachment.

But with this I get

# ts_calibrate
xres = 240, yres = 320
Took 15 samples...
Top left : X = 2893 Y = 3122
kernel BUG at include/linux/timer.h:83!
Unable to handle kernel NULL pointer dereference at virtual address 00000000
pgd = c0004000
[00000000] *pgd=00000000
Internal error: Oops: 817 [#1]
Modules linked in:...

?

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

--- ./drivers/input/touchscreen/omap/omap_ts.c_orig	2005-11-22 20:14:23.000000000 +0100
+++ ./drivers/input/touchscreen/omap/omap_ts.c	2005-11-22 20:20:24.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;
@@ -168,14 +168,14 @@ static int __init omap_ts_probe(struct d
 		return -EINVAL;
 	}
 
-	init_input_dev(&(ts_omap.inputdevice));
-	ts_omap.inputdevice.name = OMAP_TS_NAME;
-	ts_omap.inputdevice.dev = 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 = 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 +187,7 @@ static int __init omap_ts_probe(struct d
 static int __exit omap_ts_remove(struct device *dev)
 {
 	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-11-22 19:47:37.000000000 +0100
+++ ./drivers/input/touchscreen/omap/omap_ts.h	2005-11-22 20:09:03.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;
--- ./drivers/input/keyboard/omap-keypad.c_orig	2005-11-22 20:17:15.000000000 +0100
+++ ./drivers/input/keyboard/omap-keypad.c	2005-11-22 21:58:06.575502064 +0100
@@ -44,7 +44,7 @@
 static void omap_kp_tasklet(unsigned long);
 static void omap_kp_timer(unsigned long);
 
-static struct input_dev omap_kp_dev;
+static struct input_dev * omap_kp_dev;
 static unsigned char keypad_state[8];
 static unsigned int keypad_irq = INT_KEYBOARD;
 
@@ -246,7 +246,7 @@ static void omap_kp_tasklet(unsigned lon
 				continue;
 			}
 
-			input_report_key(&omap_kp_dev, key,
+			input_report_key(omap_kp_dev, key,
 					 new_state[col] & (1 << row));
 #endif
 		}
@@ -277,7 +277,7 @@ static int __init omap_kp_init(void)
 
 	if (machine_is_omap_h2() || machine_is_omap_h3()) {
 		keymap = h2_keymap;
-		set_bit(EV_REP, omap_kp_dev.evbit);
+		set_bit(EV_REP, omap_kp_dev->evbit);
 	} else if (machine_is_omap_innovator()) {
 		keymap = innovator_keymap;
 	} else if (machine_is_omap_osk()) {
@@ -299,11 +299,12 @@ static int __init omap_kp_init(void)
 		return -EINVAL;
 
 	/* setup input device */
-	set_bit(EV_KEY, omap_kp_dev.evbit);
+	omap_kp_dev = input_allocate_device();
+	set_bit(EV_KEY, omap_kp_dev->evbit);
 	for (i = 0; keymap[i] != 0; i++)
-		set_bit(keymap[i] & 0x00ffffff, omap_kp_dev.keybit);
-	omap_kp_dev.name = "omap-keypad";
-	input_register_device(&omap_kp_dev);
+		set_bit(keymap[i] & 0x00ffffff, omap_kp_dev->keybit);
+	omap_kp_dev->name = "omap-keypad";
+	input_register_device(omap_kp_dev);
 
 	if (machine_is_omap_h2() || machine_is_omap_h3()) {
 		omap_cfg_reg(F18_1610_KBC0);
@@ -353,7 +354,7 @@ static void __exit omap_kp_exit(void)
 	del_timer_sync(&kp_timer);
 
 	/* unregister everything */
-	input_unregister_device(&omap_kp_dev);
+	input_unregister_device(omap_kp_dev);
 }
 
 module_init(omap_kp_init);

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

_______________________________________________
Linux-omap-open-source mailing list
Linux-omap-open-source@linux.omap.com
http://linux.omap.com/mailman/listinfo/linux-omap-open-source

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] Re: Convert input devices to input_allocate_device
  2005-11-22 19:46 Convert input devices to input_allocate_device Dirk Behme
  2005-11-22 21:49 ` Dirk Behme
@ 2005-11-28  9:54 ` Dirk Behme
  2005-11-28 10:03   ` Komal Shah
  1 sibling, 1 reply; 4+ messages in thread
From: Dirk Behme @ 2005-11-28  9:54 UTC (permalink / raw)
  To: linux-omap-open-source

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

Dirk Behme wrote:
> while loading omapts and omap-keypad drivers as modules in
> 2.6.15-rc1-omap1 I get:
> 
> input: device omap-keypad is statically allocated, will not register
> Please convert to input_allocate_device() or contact 
> dtor_core@ameritech.net
> 
> input: device omap_ts is statically allocated, will not register
> Please convert to input_allocate_device() or contact 
> dtor_core@ameritech.net

ARM: OMAP: Convert input devices to input_allocate_device:

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

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 neccessary. 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: input_allocate_device_v3.patch --]
[-- Type: text/plain, Size: 5569 bytes --]

--- ./drivers/input/touchscreen/omap/omap_ts.c_orig	2005-11-22 22:18:23.000000000 +0100
+++ ./drivers/input/touchscreen/omap/omap_ts.c	2005-11-28 09:18:30.871818824 +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,6 +119,9 @@ static irqreturn_t omap_ts_handler(int i
 		ts_omap.irq_enabled = 0;
 		disable_irq(irq);
 	}
+	// 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 d
 		return -EINVAL;
 	}
 
-	init_input_dev(&(ts_omap.inputdevice));
-	ts_omap.inputdevice.name = OMAP_TS_NAME;
-	ts_omap.inputdevice.dev = 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 = 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 d
 static int __exit omap_ts_remove(struct device *dev)
 {
 	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-11-22 22:18:24.000000000 +0100
+++ ./drivers/input/touchscreen/omap/omap_ts.h	2005-11-22 22:22:16.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;
--- ./drivers/input/keyboard/omap-keypad.c_orig	2005-11-22 22:18:22.000000000 +0100
+++ ./drivers/input/keyboard/omap-keypad.c	2005-11-22 22:22:16.000000000 +0100
@@ -44,7 +44,7 @@
 static void omap_kp_tasklet(unsigned long);
 static void omap_kp_timer(unsigned long);
 
-static struct input_dev omap_kp_dev;
+static struct input_dev * omap_kp_dev;
 static unsigned char keypad_state[8];
 static unsigned int keypad_irq = INT_KEYBOARD;
 
@@ -246,7 +246,7 @@ static void omap_kp_tasklet(unsigned lon
 				continue;
 			}
 
-			input_report_key(&omap_kp_dev, key,
+			input_report_key(omap_kp_dev, key,
 					 new_state[col] & (1 << row));
 #endif
 		}
@@ -277,7 +277,7 @@ static int __init omap_kp_init(void)
 
 	if (machine_is_omap_h2() || machine_is_omap_h3()) {
 		keymap = h2_keymap;
-		set_bit(EV_REP, omap_kp_dev.evbit);
+		set_bit(EV_REP, omap_kp_dev->evbit);
 	} else if (machine_is_omap_innovator()) {
 		keymap = innovator_keymap;
 	} else if (machine_is_omap_osk()) {
@@ -299,11 +299,12 @@ static int __init omap_kp_init(void)
 		return -EINVAL;
 
 	/* setup input device */
-	set_bit(EV_KEY, omap_kp_dev.evbit);
+	omap_kp_dev = input_allocate_device();
+	set_bit(EV_KEY, omap_kp_dev->evbit);
 	for (i = 0; keymap[i] != 0; i++)
-		set_bit(keymap[i] & 0x00ffffff, omap_kp_dev.keybit);
-	omap_kp_dev.name = "omap-keypad";
-	input_register_device(&omap_kp_dev);
+		set_bit(keymap[i] & 0x00ffffff, omap_kp_dev->keybit);
+	omap_kp_dev->name = "omap-keypad";
+	input_register_device(omap_kp_dev);
 
 	if (machine_is_omap_h2() || machine_is_omap_h3()) {
 		omap_cfg_reg(F18_1610_KBC0);
@@ -353,7 +354,7 @@ static void __exit omap_kp_exit(void)
 	del_timer_sync(&kp_timer);
 
 	/* unregister everything */
-	input_unregister_device(&omap_kp_dev);
+	input_unregister_device(omap_kp_dev);
 }
 
 module_init(omap_kp_init);


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



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Re: Convert input devices to input_allocate_device
  2005-11-28  9:54 ` [PATCH] " Dirk Behme
@ 2005-11-28 10:03   ` Komal Shah
  0 siblings, 0 replies; 4+ messages in thread
From: Komal Shah @ 2005-11-28 10:03 UTC (permalink / raw)
  To: Dirk Behme, linux-omap-open-source

--- Dirk Behme <dirk.behme@de.bosch.com> wrote:

> ARM: OMAP: Convert input devices to input_allocate_device:
> 
> input: device omap-keypad is statically allocated, will not register
> Please convert to input_allocate_device() or contact
> dtor_core@ameritech.net
> 
> 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 neccessary. Else we will get Oops "kernel BUG at
> include/linux/timer.h:83!"

If Tony, applies my patch of keypad driver model first then your patch
will break.

---Komal Shah
http://komalshah.blogspot.com/


	
		
__________________________________ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2005-11-28 10:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-11-22 19:46 Convert input devices to input_allocate_device Dirk Behme
2005-11-22 21:49 ` Dirk Behme
2005-11-28  9:54 ` [PATCH] " Dirk Behme
2005-11-28 10:03   ` Komal Shah

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox