Skip to contentSkip to conversation

Palm interrupt driven touchscreen driver

PATCH In review Marek Vasut 7 participants 18 messages Jun 3, 2009 – Jun 5, 2009 Input drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Palm interrupt driven touchscreen driver

Hi,

this patch adds interrupt driven touchscreen driver. It's an addition to mainstone-wm97xx, but does some reorganization of the code there.

Mark, it's the same patch we discussed on IRC, so it should be OK.

Please consider applying, it's against Eric's tree.

Thanks

From a652b9cb63a8ef4293ef7028017219337553053d Mon Sep 17 00:00:00 2001
From: Marek Vasut <[email protected]>
Date: Wed, 3 Jun 2009 19:50:49 +0200
Subject: [PATCH] Add Palm support to Mainstone accelerated touch

This patch refactors the Mainstone accelerated touch code a little and adds support for interrupt driven touchscreen on Palm LifeDrive, TX and Tungsten T5.

---
 drivers/input/touchscreen/Kconfig            |    4 +-
 drivers/input/touchscreen/mainstone-wm97xx.c |   52 +++++++++++++++++--------
 2 files changed, 37 insertions(+), 19 deletions(-)
drivers/input/touchscreen/Kconfig +2 -2
index b01fd61..4072d22 100644
@@ -342,11 +342,11 @@ config TOUCHSCREEN_WM9713
 	  WM9713 touchscreen controller.
 
 config TOUCHSCREEN_WM97XX_MAINSTONE
-	tristate "WM97xx Mainstone accelerated touch"
+	tristate "WM97xx Mainstone/Palm accelerated touch"
 	depends on TOUCHSCREEN_WM97XX && ARCH_PXA
 	help
 	  Say Y here for support for streaming mode with WM97xx touchscreens
-	  on Mainstone systems.
+	  on Mainstone, Palm Tungsten T5, TX and LifeDrive systems.
 
 	  If unsure, say N.
 
drivers/input/touchscreen/mainstone-wm97xx.c +35 -17

98 lines not on this page · raw message

Signature · 1 line
1.6.2.1

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

#1 lore raw
Quoted 7 lines · Marek Vasut

Hi,

this patch adds interrupt driven touchscreen driver. It's an addition to mainstone-wm97xx, but does some reorganization of the code there.

Mark, it's the same patch we discussed on IRC, so it should be OK.

Mark, the driver looks generic enough to me, is there some specific reason this remains named "mainstone-wm97xx.c"?

I didn't look into the code too much, yet I'm wondering if it's possible to come up with a platform_data to cover the difference of boards and make this driver generic.

#2 lore raw
Quoted 6 lines · Eric Miao

Mark, the driver looks generic enough to me, is there some specific reason this remains named "mainstone-wm97xx.c"?

I didn't look into the code too much, yet I'm wondering if it's possible to come up with a platform_data to cover the difference of boards and make this driver generic.

eseries can use this idea IIRC...

#3 lore raw
In reply to Eric Miao
Quoted 6 lines · Eric Miao
Quoted 1 line · Marek Vasut

Mark, it's the same patch we discussed on IRC, so it should be OK.

Mark, the driver looks generic enough to me, is there some specific reason this remains named "mainstone-wm97xx.c"?

No, and in fact I've asked Marek in some off-list discussions to do something along those lines and/or remove the mainstone code entirely but he doesn't seem keen on it for some reason. Now we have more widely distributed platforms merged I see no reason to keep the Mainstone code in mainline.

Quoted 3 lines

I didn't look into the code too much, yet I'm wondering if it's possible to come up with a platform_data to cover the difference of boards and make this driver generic.

As I've said a number of times before AC97 does not support platform data and the ALSA guys blocked adding it.

#4 lore raw
Quoted 5 lines · Mark Brown
Quoted 2 lines

to come up with a platform_data to cover the difference of boards and make this driver generic.

As I've said a number of times before AC97 does not support platform data and the ALSA guys blocked adding it.

We're not blocking adding more data to AC97 structures. We just blocked adding new variable when it's not used.

In other words - send a driver code using this variable with the variable addition to the ALSA AC97 structure.

Jaroslav

-----
Jaroslav Kysela <[email protected]>
Linux Kernel Sound Maintainer
ALSA Project, Red Hat, Inc.

#14 lore raw
In reply to Mark Brown
Quoted 3 lines · Mark Brown

Now we have more widely
distributed platforms merged I see no reason to keep the Mainstone code in mainline.

Why not? So what do those of us with mainstone platforms but not these "more widely distributed platforms" use instead?

#15 lore raw
Quoted 8 lines · Russell King - ARM Linux
Quoted 3 lines · Mark Brown

Now we have more widely
distributed platforms merged I see no reason to keep the Mainstone code in mainline.

Why not? So what do those of us with mainstone platforms but not these "more widely distributed platforms" use instead?

This isn't a standard fit module for the Mainstone - it's the Mainstone with the default audio plugin module replaced by a Wolfson plugin module. If you just have a standard Mainstone you'd need a different accelerated touch driver for the relevant AC97 controller.

If there are people out there with these setups then obviously the driver is worth keeping in mainline, but I'm not aware of any active users.

#5 lore raw
In reply to Jaroslav Kysela
Quoted 7 lines · Jaroslav Kysela
Quoted 2 lines · Mark Brown

As I've said a number of times before AC97 does not support platform data and the ALSA guys blocked adding it.

We're not blocking adding more data to AC97 structures. We just blocked adding new variable when it's not used.

There was a very strong pushback against the idea of adding a void * to the structure, which is what I'd be looking for.

Quoted 2 lines

In other words - send a driver code using this variable with the variable addition to the ALSA AC97 structure.

IIRC the original posting had something along with it? As far as examples go things like drivers/power/wm97xx_battery.c are already in tree and pretty much ready to use platform data if it became available.

#6 lore raw

At Thu, 4 Jun 2009 10:37:37 +0100,

Quoted 4 lines · Mark Brown
Quoted 1 line · Jaroslav Kysela

On Thu, 4 Jun 2009, Mark Brown wrote:

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

As I've said a number of times before AC97 does not support platform data and the ALSA guys blocked adding it.

We're not blocking adding more data to AC97 structures. We just blocked adding new variable when it's not used.

There was a very strong pushback against the idea of adding a void * to the structure, which is what I'd be looking for.

Yes, I was against the void pointer because there is no guarantee of the data-type correctness between the data and the user. The normal drvdata is fine because the creator and the user are the same. But, the proposal of private_driver_data (of the last one, at least) is no such a scenario.

Takashi

#7 lore raw
Quoted 10 lines · Takashi Iwai
Quoted 2 lines · Mark Brown

There was a very strong pushback against the idea of adding a void * to the structure, which is what I'd be looking for.

Yes, I was against the void pointer because there is no guarantee of the data-type correctness between the data and the user. The normal drvdata is fine because the creator and the user are the same. But, the proposal of private_driver_data (of the last one, at least) is no such a scenario.

Do you have a pointer to this proposal? I don't remember it and my google-fu is weak today.

#17 lore raw
In reply to Russell King - ARM Linux
Quoted 4 lines · On Thursday 04 of June 2009 10:14:59 Russell King - ARM Linux wrote:
Quoted 1 line · Marek Vasut

+#include <mach/gpio.h>

should be linux/gpio.h

Fixed in the following patch. Thanks

From f86f889e648369a095099e2f8a4423d787f512d6 Mon Sep 17 00:00:00 2001
From: Marek Vasut <[email protected]>
Date: Thu, 4 Jun 2009 22:02:18 +0200
Subject: [PATCH 1/2] Add Palm support to Mainstone accelerated touch

This patch refactors the Mainstone accelerated touch code a little and adds support for interrupt driven touchscreen on Palm LifeDrive, TX and Tungsten T5.

---
 drivers/input/touchscreen/Kconfig            |    4 +-
 drivers/input/touchscreen/mainstone-wm97xx.c |   52 +++++++++++++++++--------
 2 files changed, 37 insertions(+), 19 deletions(-)
drivers/input/touchscreen/Kconfig +2 -2
index b01fd61..4072d22 100644
@@ -342,11 +342,11 @@ config TOUCHSCREEN_WM9713
 	  WM9713 touchscreen controller.
 
 config TOUCHSCREEN_WM97XX_MAINSTONE
-	tristate "WM97xx Mainstone accelerated touch"
+	tristate "WM97xx Mainstone/Palm accelerated touch"
 	depends on TOUCHSCREEN_WM97XX && ARCH_PXA
 	help
 	  Say Y here for support for streaming mode with WM97xx touchscreens
-	  on Mainstone systems.
+	  on Mainstone, Palm Tungsten T5, TX and LifeDrive systems.
 
 	  If unsure, say N.
 
drivers/input/touchscreen/mainstone-wm97xx.c +35 -17

98 lines not on this page · raw message

Signature · 1 line
1.6.2.1

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

#8 lore raw
In reply to Mark Brown

At Thu, 4 Jun 2009 11:38:07 +0100,

Quoted 7 lines · Mark Brown
Quoted 4 lines · Takashi Iwai
Quoted 2 lines · Mark Brown

There was a very strong pushback against the idea of adding a void * to the structure, which is what I'd be looking for.

Quoted 8 lines
Quoted 5 lines

Yes, I was against the void pointer because there is no guarantee of the data-type correctness between the data and the user. The normal drvdata is fine because the creator and the user are the same. But, the proposal of private_driver_data (of the last one, at least) is no such a scenario.

Do you have a pointer to this proposal? I don't remember it and my google-fu is weak today.

I couldn't find it. But IIRC, the original patch was to add "int irq" field to struct snd_ac97. I would accept it because it can do any harm.

But, adding a generic "void *driver_data" instead of "int irq" can play a bad game. It can be dangerous when the creator and the user of this pointer are different drivers. That was my argument.

thanks,

Takashi

#9 lore raw
Quoted 3 lines · Takashi Iwai

I couldn't find it. But IIRC, the original patch was to add "int irq" field to struct snd_ac97. I would accept it because it can do any harm.

Ah, yes - I do remember that proposal. The problem with that is that it doesn't scale up to all the platform data you might want to pass in. The WM97xx battery and touchscreen drivers are the main things I'm interested in here - the platform data for the WM97xx touch driver is struct wm97xx_mach_ops in include/linux/wm97xx.h for example.

Quoted 3 lines

But, adding a generic "void *driver_data" instead of "int irq" can play a bad game. It can be dangerous when the creator and the user of this pointer are different drivers. That was my argument.

There is potential risk involved in these interfaces but it's the standard idiom for doing this on embedded systems. The buses definitely don't want to know anything about the random data that drivers may need and since you're not dealing with pluggable or variable hardware in the same way as you do on PCs the risks of mismatched data aren't such a big deal - you'd generally only be able to encounter problems if you're building your own kernel.

#10 lore raw

At Fri, 5 Jun 2009 10:30:02 +0100,

Quoted 17 lines · Mark Brown
Quoted 3 lines · Takashi Iwai

I couldn't find it. But IIRC, the original patch was to add "int irq" field to struct snd_ac97. I would accept it because it can do any harm.

Ah, yes - I do remember that proposal. The problem with that is that it doesn't scale up to all the platform data you might want to pass in. The WM97xx battery and touchscreen drivers are the main things I'm interested in here - the platform data for the WM97xx touch driver is struct wm97xx_mach_ops in include/linux/wm97xx.h for example.

Quoted 3 lines

But, adding a generic "void *driver_data" instead of "int irq" can play a bad game. It can be dangerous when the creator and the user of this pointer are different drivers. That was my argument.

Quoted 7 lines

There is potential risk involved in these interfaces but it's the standard idiom for doing this on embedded systems. The buses definitely don't want to know anything about the random data that drivers may need and since you're not dealing with pluggable or variable hardware in the same way as you do on PCs the risks of mismatched data aren't such a big deal - you'd generally only be able to encounter problems if you're building your own kernel.

Well, but you know that can be broken :)

BTW, can't it be simply driver_data/platform_data of ac97.dev...?

Takashi

#11 lore raw
Quoted 1 line · Takashi Iwai

BTW, can't it be simply driver_data/platform_data of ac97.dev...?

We'd need to add the void * to snd_ac97_template too so that the data is initialised before snd_ac97_mixer() instantiates the device but that's the only issue I can see. If you're happy with that approach I can send some patches for it?

#12 lore raw

At Fri, 5 Jun 2009 11:20:37 +0100,

Quoted 9 lines · Mark Brown
Quoted 1 line · Takashi Iwai

BTW, can't it be simply driver_data/platform_data of ac97.dev...?

We'd need to add the void * to snd_ac97_template too so that the data is initialised before snd_ac97_mixer() instantiates the device but that's the only issue I can see. If you're happy with that approach I can send some patches for it?

Just setting it after calling snd_ac97_mixer() doesn't suffice? It's always NULL as default.

Takashi

#13 lore raw
Quoted 9 lines · Takashi Iwai
Quoted 4 lines · Mark Brown

We'd need to add the void * to snd_ac97_template too so that the data is initialised before snd_ac97_mixer() instantiates the device but that's the only issue I can see. If you're happy with that approach I can send some patches for it?

Just setting it after calling snd_ac97_mixer() doesn't suffice? It's always NULL as default.

Ah, should be - I'd misremembered how much snd_device_new() was doing when looking at the snd_ac97_mixer() code.