diff options
Diffstat (limited to 'sound/pci/cs5535audio/cs5535audio.c')
-rw-r--r-- | sound/pci/cs5535audio/cs5535audio.c | 41 |
1 files changed, 35 insertions, 6 deletions
diff --git a/sound/pci/cs5535audio/cs5535audio.c b/sound/pci/cs5535audio/cs5535audio.c index 2c1213a35dcc..91c18a11fe87 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,36 @@ | |||
40 | 40 | ||
41 | #define DRIVER_NAME "cs5535audio" | 41 | #define DRIVER_NAME "cs5535audio" |
42 | 42 | ||
43 | static char *ac97_quirk; | ||
44 | module_param(ac97_quirk, charp, 0444); | ||
45 | MODULE_PARM_DESC(ac97_quirk, "AC'97 board specific workarounds."); | ||
46 | |||
47 | static 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 | ||
44 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; | 59 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; |
45 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; | 60 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; |
46 | static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; | 61 | static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; |
47 | 62 | ||
63 | module_param_array(index, int, NULL, 0444); | ||
64 | MODULE_PARM_DESC(index, "Index value for " DRIVER_NAME); | ||
65 | module_param_array(id, charp, NULL, 0444); | ||
66 | MODULE_PARM_DESC(id, "ID string for " DRIVER_NAME); | ||
67 | module_param_array(enable, bool, NULL, 0444); | ||
68 | MODULE_PARM_DESC(enable, "Enable " DRIVER_NAME); | ||
69 | |||
48 | static struct pci_device_id snd_cs5535audio_ids[] __devinitdata = { | 70 | static struct pci_device_id snd_cs5535audio_ids[] __devinitdata = { |
49 | { PCI_VENDOR_ID_NS, PCI_DEVICE_ID_NS_CS5535_AUDIO, | 71 | { PCI_DEVICE(PCI_VENDOR_ID_NS, PCI_DEVICE_ID_NS_CS5535_AUDIO) }, |
50 | PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, | 72 | { 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 | {} | 73 | {} |
54 | }; | 74 | }; |
55 | 75 | ||
@@ -90,7 +110,8 @@ static unsigned short snd_cs5535audio_codec_read(struct cs5535audio *cs5535au, | |||
90 | udelay(1); | 110 | udelay(1); |
91 | } while (--timeout); | 111 | } while (--timeout); |
92 | if (!timeout) | 112 | if (!timeout) |
93 | snd_printk(KERN_ERR "Failure reading cs5535 codec\n"); | 113 | snd_printk(KERN_ERR "Failure reading codec reg 0x%x," |
114 | "Last value=0x%x\n", reg, val); | ||
94 | 115 | ||
95 | return (unsigned short) val; | 116 | return (unsigned short) val; |
96 | } | 117 | } |
@@ -148,6 +169,8 @@ static int snd_cs5535audio_mixer(struct cs5535audio *cs5535au) | |||
148 | return err; | 169 | return err; |
149 | } | 170 | } |
150 | 171 | ||
172 | snd_ac97_tune_hardware(cs5535au->ac97, ac97_quirks, ac97_quirk); | ||
173 | |||
151 | return 0; | 174 | return 0; |
152 | } | 175 | } |
153 | 176 | ||
@@ -347,6 +370,8 @@ static int __devinit snd_cs5535audio_probe(struct pci_dev *pci, | |||
347 | if ((err = snd_cs5535audio_create(card, pci, &cs5535au)) < 0) | 370 | if ((err = snd_cs5535audio_create(card, pci, &cs5535au)) < 0) |
348 | goto probefail_out; | 371 | goto probefail_out; |
349 | 372 | ||
373 | card->private_data = cs5535au; | ||
374 | |||
350 | if ((err = snd_cs5535audio_mixer(cs5535au)) < 0) | 375 | if ((err = snd_cs5535audio_mixer(cs5535au)) < 0) |
351 | goto probefail_out; | 376 | goto probefail_out; |
352 | 377 | ||
@@ -383,6 +408,10 @@ static struct pci_driver driver = { | |||
383 | .id_table = snd_cs5535audio_ids, | 408 | .id_table = snd_cs5535audio_ids, |
384 | .probe = snd_cs5535audio_probe, | 409 | .probe = snd_cs5535audio_probe, |
385 | .remove = __devexit_p(snd_cs5535audio_remove), | 410 | .remove = __devexit_p(snd_cs5535audio_remove), |
411 | #ifdef CONFIG_PM | ||
412 | .suspend = snd_cs5535audio_suspend, | ||
413 | .resume = snd_cs5535audio_resume, | ||
414 | #endif | ||
386 | }; | 415 | }; |
387 | 416 | ||
388 | static int __init alsa_card_cs5535audio_init(void) | 417 | static int __init alsa_card_cs5535audio_init(void) |