aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/cs5535audio/cs5535audio.c
diff options
context:
space:
mode:
authorJaya Kumar <jayakumar.alsa@gmail.com>2006-04-28 08:34:49 -0400
committerJaroslav Kysela <perex@suse.cz>2006-06-22 15:32:49 -0400
commit9ac25594e68a4b61516e7c1140d8c0f7ef449e20 (patch)
tree628040fb065b882191a6ff5ed7aba42ef04b99d6 /sound/pci/cs5535audio/cs5535audio.c
parent5e1b1518a53fc62d9f39a13819c849336c6d8dd4 (diff)
[ALSA] PM support for cs5535audio
Appended is my patch adding PM support to the cs5535audio driver. I also added the ac97 quirk but it's not yet confirmed which boards need to be in the quirk list. The patch also includes some Kconfig and misc cleanup. Signed-off-by: Jaya Kumar <jayakumar.alsa@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/cs5535audio/cs5535audio.c')
-rw-r--r--sound/pci/cs5535audio/cs5535audio.c31
1 files changed, 26 insertions, 5 deletions
diff --git a/sound/pci/cs5535audio/cs5535audio.c b/sound/pci/cs5535audio/cs5535audio.c
index 2c1213a35dcc..41f02f05dfdc 100644
--- a/sound/pci/cs5535audio/cs5535audio.c
+++ b/sound/pci/cs5535audio/cs5535audio.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Driver for audio on multifunction CS5535 companion device 2 * Driver for audio on multifunction CS5535/6 companion device
3 * Copyright (C) Jaya Kumar 3 * Copyright (C) Jaya Kumar
4 * 4 *
5 * Based on Jaroslav Kysela and Takashi Iwai's examples. 5 * Based on Jaroslav Kysela and Takashi Iwai's examples.
@@ -40,16 +40,29 @@
40 40
41#define DRIVER_NAME "cs5535audio" 41#define DRIVER_NAME "cs5535audio"
42 42
43static char *ac97_quirk;
44module_param(ac97_quirk, charp, 0444);
45MODULE_PARM_DESC(ac97_quirk, "AC'97 board specific workarounds.");
46
47static struct ac97_quirk ac97_quirks[] __devinitdata = {
48#if 0 /* Not yet confirmed if all 5536 boards are HP only */
49 {
50 .subvendor = PCI_VENDOR_ID_AMD,
51 .subdevice = PCI_DEVICE_ID_AMD_CS5536_AUDIO,
52 .name = "AMD RDK",
53 .type = AC97_TUNE_HP_ONLY
54 },
55#endif
56 {}
57};
43 58
44static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; 59static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;
45static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; 60static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;
46static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; 61static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;
47 62
48static struct pci_device_id snd_cs5535audio_ids[] __devinitdata = { 63static struct pci_device_id snd_cs5535audio_ids[] __devinitdata = {
49 { PCI_VENDOR_ID_NS, PCI_DEVICE_ID_NS_CS5535_AUDIO, 64 { PCI_DEVICE(PCI_VENDOR_ID_NS, PCI_DEVICE_ID_NS_CS5535_AUDIO) },
50 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, 65 { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_CS5536_AUDIO) },
51 { PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_CS5536_AUDIO,
52 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, },
53 {} 66 {}
54}; 67};
55 68
@@ -148,6 +161,8 @@ static int snd_cs5535audio_mixer(struct cs5535audio *cs5535au)
148 return err; 161 return err;
149 } 162 }
150 163
164 snd_ac97_tune_hardware(cs5535au->ac97, ac97_quirks, ac97_quirk);
165
151 return 0; 166 return 0;
152} 167}
153 168
@@ -347,6 +362,8 @@ static int __devinit snd_cs5535audio_probe(struct pci_dev *pci,
347 if ((err = snd_cs5535audio_create(card, pci, &cs5535au)) < 0) 362 if ((err = snd_cs5535audio_create(card, pci, &cs5535au)) < 0)
348 goto probefail_out; 363 goto probefail_out;
349 364
365 card->private_data = cs5535au;
366
350 if ((err = snd_cs5535audio_mixer(cs5535au)) < 0) 367 if ((err = snd_cs5535audio_mixer(cs5535au)) < 0)
351 goto probefail_out; 368 goto probefail_out;
352 369
@@ -383,6 +400,10 @@ static struct pci_driver driver = {
383 .id_table = snd_cs5535audio_ids, 400 .id_table = snd_cs5535audio_ids,
384 .probe = snd_cs5535audio_probe, 401 .probe = snd_cs5535audio_probe,
385 .remove = __devexit_p(snd_cs5535audio_remove), 402 .remove = __devexit_p(snd_cs5535audio_remove),
403#ifdef CONFIG_PM
404 .suspend = snd_cs5535audio_suspend,
405 .resume = snd_cs5535audio_resume,
406#endif
386}; 407};
387 408
388static int __init alsa_card_cs5535audio_init(void) 409static int __init alsa_card_cs5535audio_init(void)