[alsa-devel] [PATCH] Palm interrupt driven touchscreen driver

Mark Brown broonie at opensource.wolfsonmicro.com
Fri Jun 5 11:30:02 CEST 2009


On Fri, Jun 05, 2009 at 11:16:12AM +0200, Takashi Iwai wrote:

> 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.

> 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.


More information about the Alsa-devel mailing list