[alsa-devel] [RFC / PATCH] [SOUND] add a private field for ac97-device drivers and let ucb1400 be its first user
From: Sebastian Siewior bigeasy@linutronix.de
Currently the UCB1400 driver discovers the interrupt via probing. This works probably only on x86. This patch adds a private field to the ac97 struct where the ac97 driver can deposit informations for the device driver that serves a device which is attached to the ac97 bus. This patch also converts the UCB1400 driver to use this information if available.
Signed-off-by: Sebastian Siewior bigeasy@linutronix.de --- drivers/input/touchscreen/ucb1400_ts.c | 12 ++++++++---- include/sound/ac97_codec.h | 4 ++++ 2 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/drivers/input/touchscreen/ucb1400_ts.c b/drivers/input/touchscreen/ucb1400_ts.c index 5ee175e..531fb4b 100644 --- a/drivers/input/touchscreen/ucb1400_ts.c +++ b/drivers/input/touchscreen/ucb1400_ts.c @@ -494,10 +494,14 @@ static int ucb1400_ts_probe(struct device *dev) goto err_free_devs; }
- error = ucb1400_detect_irq(ucb); - if (error) { - printk(KERN_ERR "UCB1400: IRQ probe failed\n"); - goto err_free_devs; + if (!ucb->ac97->device_private_data) { + error = ucb1400_detect_irq(ucb); + if (error) { + printk(KERN_ERR "UCB1400: IRQ probe failed\n"); + goto err_free_devs; + } + } else { + ucb->irq = (int) ucb->ac97->device_private_data; }
error = request_irq(ucb->irq, ucb1400_hard_irq, IRQF_TRIGGER_RISING, diff --git a/include/sound/ac97_codec.h b/include/sound/ac97_codec.h index 0148058..b1af896 100644 --- a/include/sound/ac97_codec.h +++ b/include/sound/ac97_codec.h @@ -474,6 +474,10 @@ struct snd_ac97 { struct snd_ac97_build_ops * build_ops; void *private_data; void (*private_free) (struct snd_ac97 *ac97); + /* This field is used by device drivers which serve devices which are + * attached to the AC97 bus. + */ + void *device_private_data; /* --- */ struct snd_ac97_bus *bus; struct pci_dev *pci; /* assigned PCI device - used for quirks */
On Thu, 24 Apr 2008, Sebastian Siewior wrote:
From: Sebastian Siewior bigeasy@linutronix.de
Currently the UCB1400 driver discovers the interrupt via probing. This works probably only on x86. This patch adds a private field to the ac97 struct where the ac97 driver can deposit informations for the device driver that serves a device which is attached to the ac97 bus. This patch also converts the UCB1400 driver to use this information if available.
Signed-off-by: Sebastian Siewior bigeasy@linutronix.de
Thanks. I applied your patch to our tree.
Jaroslav
----- Jaroslav Kysela perex@perex.cz Linux Kernel Sound Maintainer ALSA Project, Red Hat, Inc.
* Jaroslav Kysela | 2008-04-25 08:30:40 [+0200]:
On Thu, 24 Apr 2008, Sebastian Siewior wrote:
From: Sebastian Siewior bigeasy@linutronix.de
Currently the UCB1400 driver discovers the interrupt via probing. This works probably only on x86. This patch adds a private field to the ac97 struct where the ac97 driver can deposit informations for the device driver that serves a device which is attached to the ac97 bus. This patch also converts the UCB1400 driver to use this information if available.
Signed-off-by: Sebastian Siewior bigeasy@linutronix.de
Thanks. I applied your patch to our tree.
Cool thanks. I hope the input folks don't mind getting things touched by others but in this case they might be glad.
Jaroslav
Sebastian
participants (2)
-
Jaroslav Kysela
-
Sebastian Siewior