Skip to contentSkip to conversation

alsa-kernel: Official ALSA project GIT repository for Linux 2.6 branch, master now at v2.6.27-rc5-122-g1328f04

alsa-cvslog Takashi Iwai 1 participant 1 message Aug 29, 2008 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

At Fri, 29 Aug 2008 11:35:25 +0200 (CEST),

Quoted 18 lines · [email protected] wrote:

commit 1328f04260822e45a2717b65a0e2bc0c9c1255be

Author:     Jaroslav Kysela <[email protected]>
AuthorDate: Fri Aug 29 11:29:39 2008 +0200
Commit:     Jaroslav Kysela <[email protected]>
CommitDate: Fri Aug 29 11:29:39 2008 +0200

ALSA: intel8x0: implement ac97_clock whitelist

The AC97 clock detection is not accurate in some cases. This patch adds an initial whitelist for audio devices gathered from RedHat's bugzilla:

https://bugzilla.redhat.com/show_bug.cgi?id=441087

As a side effect, white-listing might speedup kernel booting (AC97 clock measuring code is not activated).

(snip)

Quoted 20 lines
(quoted diff) +20 -0
+struct intel8x0_clock_list {
+	unsigned short subvendor;
+	unsigned short subdevice;
+	unsigned int rate;
+};
+
+static struct intel8x0_clock_list intel8x0_clock_list[] __devinitdata = {
+	{ 0x1028, 0x00be, 44100 },	/* Analog Devices AD1885 */
+	{ 0x1028, 0x0177, 48000 },	/* Analog Devices AD1980 */
+	{ 0x1043, 0x80f3, 48000 },	/* Analog Devices AD1985 */
+	{ 0x0000, 0x0000, 00000 }	/* terminator */
+};
+
+static int __devinit intel8x0_in_clock_list(struct intel8x0 *chip)
+{
+	struct pci_dev *pci = chip->pci;
+	struct intel8x0_clock_list *wl;
+
+	for (wl = intel8x0_clock_list; wl->subvendor; wl++) {
+		if (wl->subvendor == pci->subsystem_vendor &&

Review

Quoted 10 lines
(quoted diff) +10 -0
+		    wl->subdevice == pci->subsystem_device) {
+		    	printk(KERN_INFO "intel8x0: white list rate for %04x:%04x is %i\n",
+		    		pci->subsystem_vendor,
+		    		pci->subsystem_device, wl->rate);
+			chip->ac97_bus->clock = wl->rate;
+			return 1;
+		}
+	}
+	return 0;
+}

Use snd_pci_quirk_lookup() please.

But, a better fix would be to fix the clock measurement. AFAIK, this seems to happen when the driver is built-in. Thus I guess it's rather a problem of time-keeping core side.

Takashi