* [PATCH] Convert touchscreen to input_allocate_device
@ 2005-12-04 15:52 Dirk Behme
0 siblings, 0 replies; 12+ messages in thread
From: Dirk Behme @ 2005-12-04 15:52 UTC (permalink / raw)
To: linux-omap-open-source
[-- 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 --]
^ permalink raw reply [flat|nested] 12+ messages in thread* Pending patches
@ 2005-12-27 9:51 Dirk Behme
2005-12-30 22:28 ` Tony Lindgren
0 siblings, 1 reply; 12+ messages in thread
From: Dirk Behme @ 2005-12-27 9:51 UTC (permalink / raw)
To: linux-omap-open-source
Hello,
find below a list of pending patches from last weeks.
Feel free to update, correct, extend etc.
Hth,
Dirk
List of pending patches for OMAP Linux.
Last modified: 2005/12/27
Pending patches (ready for inclusion):
======================================
1) Fix OMAP audio miscompile
http://linux.omap.com/pipermail/linux-omap-open-source/2005-December/005830.html
2) Fix miscompile if CONFIG_FB_OMAP_LCDC_INTERNAL=n
http://linux.omap.com/pipermail/linux-omap-open-source/2005-December/005831.html
3) Fix omap keypad
http://linux.omap.com/pipermail/linux-omap-open-source/2005-December/005833.html
4) Convert touchscreen to input_allocate_device
http://linux.omap.com/pipermail/linux-omap-open-source/2005-December/005837.html
(input_allocate_device & timer fix)
_or_ (timer fix only!)
OMAP touchscreen timer BUG
http://linux.omap.com/pipermail/linux-omap-open-source/2005-December/005899.html
5) Fix warning in pm.c
http://linux.omap.com/pipermail/linux-omap-open-source/2005-December/005838.html
6) USB clock changes from Juha
http://linux.omap.com/pipermail/linux-omap-open-source/2005-August/004818.html
(http://linux.omap.com/pipermail/linux-omap-open-source/2005-December/005846.html)
(http://linux.omap.com/pipermail/linux-omap-open-source/2005-December/006027.html)
7) OSS Audio L/R Channel Interchanges fix
http://linux.omap.com/pipermail/linux-omap-open-source/2005-December/005890.html
8) omap1510 MPU interupt BUG
http://linux.omap.com/pipermail/linux-omap-open-source/2005-December/005894.html
9) LDM wakeup flags for OMAP keypad
http://linux.omap.com/pipermail/linux-omap-open-source/2005-December/005897.html
10) Add MMC password protection (lock/unlock) support
http://linux.omap.com/pipermail/linux-omap-open-source/2005-December/005911.html
http://linux.omap.com/pipermail/linux-omap-open-source/2005-December/005912.html
http://linux.omap.com/pipermail/linux-omap-open-source/2005-December/005913.html
http://linux.omap.com/pipermail/linux-omap-open-source/2005-December/005914.html
http://linux.omap.com/pipermail/linux-omap-open-source/2005-December/005915.html
http://linux.omap.com/pipermail/linux-omap-open-source/2005-December/005916.html
Note: Still in discussion with RMK?
11) MMC - CONFIG_HOTPLUG support
http://linux.omap.com/pipermail/linux-omap-open-source/2005-December/005963.html
Note: Still in discussion with RMK?
12) ALSA Audio L/R Channel Interchanges fix
http://linux.omap.com/pipermail/linux-omap-open-source/2005-December/005971.html
13) Disable DEBUG_LL in omap_h3_1710_defconfig
http://linux.omap.com/pipermail/linux-omap-open-source/2005-December/005997.html
14) I2C: Use struct platform_driver
http://linux.omap.com/pipermail/linux-omap-open-source/2005-December/006025.html
Experimental & test (do not apply yet):
=======================================
1) omap24xx vout and dispc library
http://linux.omap.com/pipermail/linux-omap-open-source/2005-December/005932.html
2) omap24xx spi + touchscreen
http://linux.omap.com/pipermail/linux-omap-open-source/2005-December/005980.html
3) keypad: platform_data and 24xx support -exp
http://linux.omap.com/pipermail/linux-omap-open-source/2005-December/005889.html
4) omap24xx IrDA update
http://linux.omap.com/pipermail/linux-omap-open-source/2005-December/005992.html
Already applied (by Juha, nothing to do):
=========================================
1) Omapfb: panel enable/disable reordering
http://linux.omap.com/pipermail/linux-omap-open-source/2005-December/005844.html
2) H3 LCD clocking changes suggested by the driver
http://linux.omap.com/pipermail/linux-omap-open-source/2005-December/005898.html
3) fix watchdog
http://linux.omap.com/pipermail/linux-omap-open-source/2005-December/005969.html
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Pending patches
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
0 siblings, 1 reply; 12+ messages in thread
From: Tony Lindgren @ 2005-12-30 22:28 UTC (permalink / raw)
To: Dirk Behme; +Cc: linux-omap-open-source
* Dirk Behme <dirk.behme@de.bosch.com> [051227 01:56]:
> Hello,
>
> find below a list of pending patches from last weeks.
Cool, this is a nice summary :)
> Feel free to update, correct, extend etc.
Anybody else know if pending patches?
> List of pending patches for OMAP Linux.
>
> 6) USB clock changes from Juha
> http://linux.omap.com/pipermail/linux-omap-open-source/2005-August/004818.html
> (http://linux.omap.com/pipermail/linux-omap-open-source/2005-December/005846.html)
> (http://linux.omap.com/pipermail/linux-omap-open-source/2005-December/006027.html)
No comments from Dave, so let's plan on pushing the USB clock patches.
Regards,
Tony
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Pending patches mostly pushed, please check
2005-12-30 22:28 ` Tony Lindgren
@ 2006-01-03 19:13 ` Tony Lindgren
2006-01-06 19:37 ` [PATCH] Convert touchscreen to input_allocate_device Dirk Behme
0 siblings, 1 reply; 12+ messages in thread
From: Tony Lindgren @ 2006-01-03 19:13 UTC (permalink / raw)
To: Dirk Behme; +Cc: linux-omap-open-source
Hi all,
I've pushed bunch of patches listed. Please check the status of
your patches below.
Also reply to this thread if you know if a patch that you think
should be pushed and has not been pushed yet.
* Dirk Behme <dirk.behme@de.bosch.com> [051227 01:56]:
> Hello,
>
> find below a list of pending patches from last weeks.
>
> Feel free to update, correct, extend etc.
>
> Hth,
>
> Dirk
>
>
> List of pending patches for OMAP Linux.
>
> Last modified: 2005/12/27
Last modified: 2006/01/03
> Pending patches (ready for inclusion):
> ======================================
>
> 1) Fix OMAP audio miscompile
> http://linux.omap.com/pipermail/linux-omap-open-source/2005-December/005830.html
Applied.
> 2) Fix miscompile if CONFIG_FB_OMAP_LCDC_INTERNAL=n
> http://linux.omap.com/pipermail/linux-omap-open-source/2005-December/005831.html
Applied.
> 3) Fix omap keypad
> http://linux.omap.com/pipermail/linux-omap-open-source/2005-December/005833.html
Applied.
> 4) Convert touchscreen to input_allocate_device
> http://linux.omap.com/pipermail/linux-omap-open-source/2005-December/005837.html
> (input_allocate_device & timer fix)
>
> _or_ (timer fix only!)
Dirk, I've only pushed Todd's timer fix below like you suggested. Can you please
update your patch?
> OMAP touchscreen timer BUG
> http://linux.omap.com/pipermail/linux-omap-open-source/2005-December/005899.html
Applied.
> 5) Fix warning in pm.c
> http://linux.omap.com/pipermail/linux-omap-open-source/2005-December/005838.html
Applied.
> 6) USB clock changes from Juha
> http://linux.omap.com/pipermail/linux-omap-open-source/2005-August/004818.html
> (http://linux.omap.com/pipermail/linux-omap-open-source/2005-December/005846.html)
> (http://linux.omap.com/pipermail/linux-omap-open-source/2005-December/006027.html)
Applied.
> 7) OSS Audio L/R Channel Interchanges fix
> http://linux.omap.com/pipermail/linux-omap-open-source/2005-December/005890.html
Applied.
> 8) omap1510 MPU interupt BUG
> http://linux.omap.com/pipermail/linux-omap-open-source/2005-December/005894.html
Can't read this patch because of the bad formatting... Can you please repost?
> 9) LDM wakeup flags for OMAP keypad
> http://linux.omap.com/pipermail/linux-omap-open-source/2005-December/005897.html
Let's think about this one a bit more. Maybe we should have u32 device_wakeup in
pm.c, and then various drivers would mask it with OMAP_WAKEUP_KEYPAD etc?
Or maybe device_init_wakeup() should register a callback function in the driver,
and them pm.c just calls all registered wakeup callback functions? That would
move the enable/disable code to drivers.
> 10) Add MMC password protection (lock/unlock) support
> http://linux.omap.com/pipermail/linux-omap-open-source/2005-December/005911.html
> http://linux.omap.com/pipermail/linux-omap-open-source/2005-December/005912.html
> http://linux.omap.com/pipermail/linux-omap-open-source/2005-December/005913.html
> http://linux.omap.com/pipermail/linux-omap-open-source/2005-December/005914.html
> http://linux.omap.com/pipermail/linux-omap-open-source/2005-December/005915.html
> http://linux.omap.com/pipermail/linux-omap-open-source/2005-December/005916.html
>
> Note: Still in discussion with RMK?
Not applied based on comments from Andersons.
> 11) MMC - CONFIG_HOTPLUG support
> http://linux.omap.com/pipermail/linux-omap-open-source/2005-December/005963.html
>
> Note: Still in discussion with RMK?
Not applied based on comments from Andersons.
> 12) ALSA Audio L/R Channel Interchanges fix
> http://linux.omap.com/pipermail/linux-omap-open-source/2005-December/005971.html
Applied.
> 13) Disable DEBUG_LL in omap_h3_1710_defconfig
> http://linux.omap.com/pipermail/linux-omap-open-source/2005-December/005997.html
Applied.
> 14) I2C: Use struct platform_driver
> http://linux.omap.com/pipermail/linux-omap-open-source/2005-December/006025.html
Applied.
15) Problem on mounting a jffs2 rootfs image
http://linux.omap.com/pipermail/linux-omap-open-source/2006-January/006064.html
Applied.
16) [PATCH] gpio expander debug cleanup
http://linux.omap.com/pipermail/linux-omap-open-source/2006-January/006061.html
Applied.
> Experimental & test (do not apply yet):
> =======================================
>
> 1) omap24xx vout and dispc library
> http://linux.omap.com/pipermail/linux-omap-open-source/2005-December/005932.html
>
> 2) omap24xx spi + touchscreen
> http://linux.omap.com/pipermail/linux-omap-open-source/2005-December/005980.html
>
> 3) keypad: platform_data and 24xx support -exp
> http://linux.omap.com/pipermail/linux-omap-open-source/2005-December/005889.html
>
> 4) omap24xx IrDA update
> http://linux.omap.com/pipermail/linux-omap-open-source/2005-December/005992.html
>
>
> Already applied (by Juha, nothing to do):
> =========================================
>
> 1) Omapfb: panel enable/disable reordering
> http://linux.omap.com/pipermail/linux-omap-open-source/2005-December/005844.html
>
> 2) H3 LCD clocking changes suggested by the driver
> http://linux.omap.com/pipermail/linux-omap-open-source/2005-December/005898.html
>
> 3) fix watchdog
> http://linux.omap.com/pipermail/linux-omap-open-source/2005-December/005969.html
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH] Convert touchscreen to input_allocate_device
2006-01-03 19:13 ` Pending patches mostly pushed, please check Tony Lindgren
@ 2006-01-06 19:37 ` Dirk Behme
2006-01-14 0:18 ` Tony Lindgren
0 siblings, 1 reply; 12+ messages in thread
From: Dirk Behme @ 2006-01-06 19:37 UTC (permalink / raw)
To: Tony Lindgren; +Cc: linux-omap-open-source
[-- Attachment #1: Type: text/plain, Size: 397 bytes --]
Tony Lindgren wrote:
> Dirk, I've only pushed Todd's timer fix below like you suggested. Can you please
> update your patch?
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
Signed-off-by: Dirk Behme <dirk.behme_at_de.bosch.com>
[-- Attachment #2: touchscreen_input_allocate_device.patch --]
[-- Type: text/plain, Size: 3403 bytes --]
--- ./drivers/input/touchscreen/omap/omap_ts.c_orig 2006-01-06 16:43:40.000000000 +0100
+++ ./drivers/input/touchscreen/omap/omap_ts.c 2006-01-06 18:48:39.754015208 +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;
@@ -167,14 +167,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();
@@ -186,7 +186,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 2006-01-06 16:43:40.000000000 +0100
+++ ./drivers/input/touchscreen/omap/omap_ts.h 2006-01-06 18:48:39.756014904 +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 --]
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: [PATCH] Convert touchscreen to input_allocate_device
2006-01-06 19:37 ` [PATCH] Convert touchscreen to input_allocate_device Dirk Behme
@ 2006-01-14 0:18 ` Tony Lindgren
0 siblings, 0 replies; 12+ messages in thread
From: Tony Lindgren @ 2006-01-14 0:18 UTC (permalink / raw)
To: Dirk Behme; +Cc: linux-omap-open-source
* Dirk Behme <dirk.behme@de.bosch.com> [060106 11:36]:
> Tony Lindgren wrote:
> >Dirk, I've only pushed Todd's timer fix below like you suggested. Can you
> >please
> >update your patch?
>
> 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
Pushing this one today, thanks.
Tony
^ permalink raw reply [flat|nested] 12+ messages in thread
* RE: [PATCH] Convert touchscreen to input_allocate_device
@ 2006-01-16 11:59 Mikko.Soikkala
2006-01-16 18:15 ` Dirk Behme
0 siblings, 1 reply; 12+ messages in thread
From: Mikko.Soikkala @ 2006-01-16 11:59 UTC (permalink / raw)
To: tony, dirk.behme; +Cc: linux-omap-open-source
Hi
Shouldn't there be a check after input_allocate_device() if the
allocation fails? At least other touchscreen drivers seem to return
-ENOMEM in this case.
Mikko
-----Original Message-----
From: linux-omap-open-source-bounces@linux.omap.com
[mailto:linux-omap-open-source-bounces@linux.omap.com] On Behalf Of Tony
Lindgren
Sent: 14. tammikuuta 2006 02:18
To: Dirk Behme
Cc: linux-omap-open-source@linux.omap.com
Subject: Re: [PATCH] Convert touchscreen to input_allocate_device
* Dirk Behme <dirk.behme@de.bosch.com> [060106 11:36]:
> Tony Lindgren wrote:
> >Dirk, I've only pushed Todd's timer fix below like you suggested. Can
you
> >please
> >update your patch?
>
> 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
Pushing this one today, thanks.
Tony
_______________________________________________
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] 12+ messages in thread
* RE: [PATCH] Convert touchscreen to input_allocate_device
@ 2006-01-17 13:24 Mikko.Soikkala
2006-01-17 15:12 ` Komal Shah
0 siblings, 1 reply; 12+ messages in thread
From: Mikko.Soikkala @ 2006-01-17 13:24 UTC (permalink / raw)
To: dirk.behme; +Cc: linux-omap-open-source
> -----Original Message-----
> From: Dirk Behme [mailto:dirk.behme@de.bosch.com]
>
> Mikko.Soikkala@Tietoenator.com wrote:
> > Hi
> >
> > Shouldn't there be a check after input_allocate_device() if the
> > allocation fails? At least other touchscreen drivers seem to return
> > -ENOMEM in this case.
>
> Sounds good to me. Can you send a patch?
I'm still learning how to create and submit patches, but hopefully this
does the trick.
Mikko
--
diff -Naur linux-2.6.15-omap2/drivers/input/touchscreen/omap/omap_ts.c
linux-2.6.15-omap2-tsfix/drivers/input/touchscreen/omap/omap_ts.c
--- linux-2.6.15-omap2/drivers/input/touchscreen/omap/omap_ts.c
2006-01-17 14:39:49.000000000 +0200
+++ linux-2.6.15-omap2-tsfix/drivers/input/touchscreen/omap/omap_ts.c
2006-01-17 14:47:48.000000000 +0200
@@ -168,6 +168,9 @@
}
ts_omap.inputdevice = input_allocate_device();
+ if (!ts_omap.inputdevice)
+ return -ENOMEM;
+
ts_omap.inputdevice->name = OMAP_TS_NAME;
ts_omap.inputdevice->dev = &pdev->dev;
ts_omap.inputdevice->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS);
^ permalink raw reply [flat|nested] 12+ messages in thread
* RE: [PATCH] Convert touchscreen to input_allocate_device
2006-01-17 13:24 Mikko.Soikkala
@ 2006-01-17 15:12 ` Komal Shah
0 siblings, 0 replies; 12+ messages in thread
From: Komal Shah @ 2006-01-17 15:12 UTC (permalink / raw)
To: Mikko.Soikkala, dirk.behme; +Cc: linux-omap-open-source
--- Mikko.Soikkala@Tietoenator.com wrote:
>
> I'm still learning how to create and submit patches, but hopefully
> this
> does the trick.
>
> Mikko
>
> ts_omap.inputdevice = input_allocate_device();
> + if (!ts_omap.inputdevice)
> + return -ENOMEM;
> +
Not good enough.
1. Need to free the irq, you just got before this code.
2. Need to call ts_omap.dev->remove() to match _probe() for the
corresponding platform before you return -ENOMEM.
---Komal Shah
http://komalshah.blogspot.com/
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
^ permalink raw reply [flat|nested] 12+ messages in thread
* RE: [PATCH] Convert touchscreen to input_allocate_device
@ 2006-01-18 9:34 Mikko.Soikkala
2006-01-18 10:10 ` Komal Shah
0 siblings, 1 reply; 12+ messages in thread
From: Mikko.Soikkala @ 2006-01-18 9:34 UTC (permalink / raw)
To: komal_shah802003, dirk.behme; +Cc: linux-omap-open-source
> -----Original Message-----
> From: Komal Shah [mailto:komal_shah802003@yahoo.com]
>
> Not good enough.
>
> 1. Need to free the irq, you just got before this code.
> 2. Need to call ts_omap.dev->remove() to match _probe() for the
> corresponding platform before you return -ENOMEM.>
How about if we move the allocation and check to the beginning of the
probe function? Then the return shouldn't cause problems?
Mikko
--
diff -Naur linux-2.6.15-omap2/drivers/input/touchscreen/omap/omap_ts.c
linux-2.6.15-omap2-tsfix/drivers/input/touchscreen/omap/omap_ts.c
--- linux-2.6.15-omap2/drivers/input/touchscreen/omap/omap_ts.c
2006-01-17 14:39:49.000000000 +0200
+++ linux-2.6.15-omap2-tsfix/drivers/input/touchscreen/omap/omap_ts.c
2006-01-18 11:08:42.447581656 +0200
@@ -133,6 +133,10 @@
int status = -ENODEV;
memset(&ts_omap, 0, sizeof(ts_omap));
+ ts_omap.inputdevice = input_allocate_device();
+ if (!ts_omap.inputdevice)
+ return -ENOMEM;
+
spin_lock_init(&ts_omap.lock);
for (i = 0; i < ARRAY_SIZE(ts_devs); i++) {
@@ -167,7 +171,6 @@
return -EINVAL;
}
- 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);
^ permalink raw reply [flat|nested] 12+ messages in thread* RE: [PATCH] Convert touchscreen to input_allocate_device
2006-01-18 9:34 Mikko.Soikkala
@ 2006-01-18 10:10 ` Komal Shah
2006-01-18 11:21 ` Juha Yrjölä
0 siblings, 1 reply; 12+ messages in thread
From: Komal Shah @ 2006-01-18 10:10 UTC (permalink / raw)
To: Mikko.Soikkala, dirk.behme; +Cc: linux-omap-open-source
--- Mikko.Soikkala@Tietoenator.com wrote:
>
> How about if we move the allocation and check to the beginning of the
> probe function? Then the return shouldn't cause problems?
Ok. Looks good now.
---Komal Shah
http://komalshah.blogspot.com/
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] Convert touchscreen to input_allocate_device
2006-01-18 10:10 ` Komal Shah
@ 2006-01-18 11:21 ` Juha Yrjölä
2006-01-18 16:39 ` Komal Shah
0 siblings, 1 reply; 12+ messages in thread
From: Juha Yrjölä @ 2006-01-18 11:21 UTC (permalink / raw)
To: ext Komal Shah; +Cc: linux-omap-open-source, Mikko.Soikkala
On Wed, Jan 18, 2006 at 02:10:57AM -0800, ext Komal Shah wrote:
> > How about if we move the allocation and check to the beginning of the
> > probe function? Then the return shouldn't cause problems?
>
> Ok. Looks good now.
Not quite yet. =) If you allocate the input device earlier, you also have to
take care in deallocating it in the error paths after it.
Cheers,
Juha
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] Convert touchscreen to input_allocate_device
2006-01-18 11:21 ` Juha Yrjölä
@ 2006-01-18 16:39 ` Komal Shah
2006-01-20 23:07 ` Tony Lindgren
0 siblings, 1 reply; 12+ messages in thread
From: Komal Shah @ 2006-01-18 16:39 UTC (permalink / raw)
Cc: linux-omap-open-source, Mikko.Soikkala
[-- Attachment #1: Type: text/plain, Size: 521 bytes --]
--- Juha Yrjölä <juha.yrjola@nokia.com> wrote:
>
> Not quite yet. =) If you allocate the input device earlier, you also
> have to
> take care in deallocating it in the error paths after it.
Ok. Please check the attached patch. Build for OSK.
Signed-off-by: Komal Shah <komal_shah802003@yahoo.com>
---Komal Shah
http://komalshah.blogspot.com/
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
[-- Attachment #2: 1479429603-tsfix.patch --]
[-- Type: text/plain, Size: 1531 bytes --]
diff --git a/drivers/input/touchscreen/corgi_ts.c b/drivers/input/touchscreen/corgi_ts.c
diff --git a/drivers/input/touchscreen/omap/omap_ts.c b/drivers/input/touchscreen/omap/omap_ts.c
index 5916245..f55ea05 100644
--- a/drivers/input/touchscreen/omap/omap_ts.c
+++ b/drivers/input/touchscreen/omap/omap_ts.c
@@ -133,6 +133,12 @@ static int __init omap_ts_probe(struct p
int status = -ENODEV;
memset(&ts_omap, 0, sizeof(ts_omap));
+
+ ts_omap.inputdevice = input_allocate_device();
+ if (!ts_omap.inputdevice) {
+ return -ENOMEM;
+ }
+
spin_lock_init(&ts_omap.lock);
for (i = 0; i < ARRAY_SIZE(ts_devs); i++) {
@@ -145,8 +151,10 @@ static int __init omap_ts_probe(struct p
}
}
- if (status != 0)
+ if (status != 0) {
+ input_free_device(ts_omap.inputdevice);
return status;
+ }
// Init acquisition timer function
init_timer(&ts_omap.ts_timer);
@@ -159,15 +167,18 @@ static int __init omap_ts_probe(struct p
printk(KERN_ERR
"omap_ts.c: Could not allocate touchscreen IRQ!\n");
ts_omap.irq = -1;
+ ts_omap.dev->remove();
+ input_free_device(ts_omap.inputdevice);
return -EINVAL;
}
ts_omap.irq_enabled = 1;
} else {
printk(KERN_ERR "omap_ts.c: No touchscreen IRQ assigned!\n");
+ ts_omap.dev->remove();
+ input_free_device(ts_omap.inputdevice);
return -EINVAL;
}
- 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);
[-- Attachment #3: Type: text/plain, Size: 0 bytes --]
^ permalink raw reply related [flat|nested] 12+ messages in thread* Re: [PATCH] Convert touchscreen to input_allocate_device
2006-01-18 16:39 ` Komal Shah
@ 2006-01-20 23:07 ` Tony Lindgren
0 siblings, 0 replies; 12+ messages in thread
From: Tony Lindgren @ 2006-01-20 23:07 UTC (permalink / raw)
To: Komal Shah; +Cc: Mikko.Soikkala, linux-omap-open-source
* Komal Shah <komal_shah802003@yahoo.com> [060118 08:47]:
> --- Juha Yrjölä <juha.yrjola@nokia.com> wrote:
>
> >
> > Not quite yet. =) If you allocate the input device earlier, you also
> > have to
> > take care in deallocating it in the error paths after it.
>
> Ok. Please check the attached patch. Build for OSK.
>
> Signed-off-by: Komal Shah <komal_shah802003@yahoo.com>
>
>
> ---Komal Shah
> http://komalshah.blogspot.com/
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
Content-Description: 1479429603-tsfix.patch
> diff --git a/drivers/input/touchscreen/corgi_ts.c b/drivers/input/touchscreen/corgi_ts.c
> diff --git a/drivers/input/touchscreen/omap/omap_ts.c b/drivers/input/touchscreen/omap/omap_ts.c
> index 5916245..f55ea05 100644
> --- a/drivers/input/touchscreen/omap/omap_ts.c
> +++ b/drivers/input/touchscreen/omap/omap_ts.c
> @@ -133,6 +133,12 @@ static int __init omap_ts_probe(struct p
> int status = -ENODEV;
>
> memset(&ts_omap, 0, sizeof(ts_omap));
> +
> + ts_omap.inputdevice = input_allocate_device();
> + if (!ts_omap.inputdevice) {
> + return -ENOMEM;
> + }
> +
> spin_lock_init(&ts_omap.lock);
>
> for (i = 0; i < ARRAY_SIZE(ts_devs); i++) {
> @@ -145,8 +151,10 @@ static int __init omap_ts_probe(struct p
> }
> }
>
> - if (status != 0)
> + if (status != 0) {
> + input_free_device(ts_omap.inputdevice);
> return status;
> + }
>
> // Init acquisition timer function
> init_timer(&ts_omap.ts_timer);
> @@ -159,15 +167,18 @@ static int __init omap_ts_probe(struct p
> printk(KERN_ERR
> "omap_ts.c: Could not allocate touchscreen IRQ!\n");
> ts_omap.irq = -1;
> + ts_omap.dev->remove();
> + input_free_device(ts_omap.inputdevice);
> return -EINVAL;
> }
> ts_omap.irq_enabled = 1;
> } else {
> printk(KERN_ERR "omap_ts.c: No touchscreen IRQ assigned!\n");
> + ts_omap.dev->remove();
> + input_free_device(ts_omap.inputdevice);
> return -EINVAL;
> }
>
> - 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);
Pushing today.
Tony
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2006-01-20 23:07 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-12-04 15:52 [PATCH] Convert touchscreen to input_allocate_device Dirk Behme
-- 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
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox