Skip to contentSkip to conversation

add a private field for ac97-device drivers and let ucb1400 be its first user

RFC PATCH In review Sebastian Siewior 2 participants 3 messages Apr 24, 2008 – Apr 25, 2008

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 add a private field for ac97-device drivers and let ucb1400 be its first user

From: Sebastian Siewior <[email protected]>

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.

---
 drivers/input/touchscreen/ucb1400_ts.c |   12 ++++++++----
 include/sound/ac97_codec.h             |    4 ++++
 2 files changed, 12 insertions(+), 4 deletions(-)
drivers/input/touchscreen/ucb1400_ts.c +8 -4
index 5ee175e..531fb4b 100644
@@ -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,
include/sound/ac97_codec.h +4 -0
index 0148058..b1af896 100644
@@ -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 */
Signature · 1 line
1.5.4.3
maintainer
#1 lore raw
Quoted 9 lines · Sebastian Siewior

From: Sebastian Siewior <[email protected]>

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.

Thanks. I applied your patch to our tree.

Jaroslav

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

#2 lore raw
Quoted 10 lines · * Jaroslav Kysela | 2008-04-25 08:30:40 [+0200]:
Quoted 8 lines · Sebastian Siewior

From: Sebastian Siewior <[email protected]>

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.

Quoted 3 lines
Quoted 1 line

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.

Quoted 1 line

Jaroslav

Sebastian