aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci
diff options
context:
space:
mode:
Diffstat (limited to 'sound/pci')
-rw-r--r--sound/pci/Kconfig9
-rw-r--r--sound/pci/ac97/ac97_codec.c61
-rw-r--r--sound/pci/ac97/ac97_patch.c19
-rw-r--r--sound/pci/ac97/ac97_pcm.c10
-rw-r--r--sound/pci/ac97/ac97_proc.c5
-rw-r--r--sound/pci/ac97/ak4531_codec.c2
-rw-r--r--sound/pci/ad1889.c2
-rw-r--r--sound/pci/ali5451/ali5451.c4
-rw-r--r--sound/pci/als4000.c4
-rw-r--r--sound/pci/atiixp.c2
-rw-r--r--sound/pci/atiixp_modem.c2
-rw-r--r--sound/pci/au88x0/au88x0.c12
-rw-r--r--sound/pci/au88x0/au88x0_mpu401.c11
-rw-r--r--sound/pci/au88x0/au88x0_xtalk.c29
-rw-r--r--sound/pci/azt3328.c234
-rw-r--r--sound/pci/azt3328.h36
-rw-r--r--sound/pci/bt87x.c8
-rw-r--r--sound/pci/ca0106/ca0106.h4
-rw-r--r--sound/pci/ca0106/ca0106_main.c57
-rw-r--r--sound/pci/ca0106/ca0106_mixer.c181
-rw-r--r--sound/pci/ca0106/ca0106_proc.c17
-rw-r--r--sound/pci/cmipci.c10
-rw-r--r--sound/pci/cs4281.c16
-rw-r--r--sound/pci/cs46xx/cs46xx.c4
-rw-r--r--sound/pci/cs46xx/cs46xx_lib.c5
-rw-r--r--sound/pci/cs46xx/dsp_spos.c7
-rw-r--r--sound/pci/cs46xx/dsp_spos_scb_lib.c1
-rw-r--r--sound/pci/cs5535audio/Makefile4
-rw-r--r--sound/pci/cs5535audio/cs5535audio.c41
-rw-r--r--sound/pci/cs5535audio/cs5535audio.h8
-rw-r--r--sound/pci/cs5535audio/cs5535audio_pcm.c24
-rw-r--r--sound/pci/cs5535audio/cs5535audio_pm.c123
-rw-r--r--sound/pci/emu10k1/emu10k1.c8
-rw-r--r--sound/pci/emu10k1/emu10k1_main.c69
-rw-r--r--sound/pci/emu10k1/emu10k1x.c3
-rw-r--r--sound/pci/emu10k1/emumixer.c54
-rw-r--r--sound/pci/emu10k1/emuproc.c27
-rw-r--r--sound/pci/emu10k1/io.c4
-rw-r--r--sound/pci/emu10k1/memory.c8
-rw-r--r--sound/pci/emu10k1/p17v.h111
-rw-r--r--sound/pci/emu10k1/tina2.h8
-rw-r--r--sound/pci/emu10k1/voice.c4
-rw-r--r--sound/pci/ens1370.c2
-rw-r--r--sound/pci/es1938.c3
-rw-r--r--sound/pci/es1968.c5
-rw-r--r--sound/pci/fm801.c5
-rw-r--r--sound/pci/hda/Makefile2
-rw-r--r--sound/pci/hda/hda_codec.c41
-rw-r--r--sound/pci/hda/hda_intel.c20
-rw-r--r--sound/pci/hda/hda_patch.h3
-rw-r--r--sound/pci/hda/hda_proc.c6
-rw-r--r--sound/pci/hda/patch_analog.c61
-rw-r--r--sound/pci/hda/patch_atihdmi.c165
-rw-r--r--sound/pci/hda/patch_realtek.c30
-rw-r--r--sound/pci/hda/patch_sigmatel.c82
-rw-r--r--sound/pci/ice1712/aureon.c26
-rw-r--r--sound/pci/ice1712/aureon.h1
-rw-r--r--sound/pci/ice1712/ews.c3
-rw-r--r--sound/pci/ice1712/ice1712.c43
-rw-r--r--sound/pci/ice1712/ice1712.h5
-rw-r--r--sound/pci/ice1712/ice1724.c5
-rw-r--r--sound/pci/ice1712/pontis.c8
-rw-r--r--sound/pci/intel8x0.c10
-rw-r--r--sound/pci/intel8x0m.c4
-rw-r--r--sound/pci/korg1212/korg1212.c2
-rw-r--r--sound/pci/maestro3.c3
-rw-r--r--sound/pci/mixart/mixart.c1
-rw-r--r--sound/pci/pcxhr/pcxhr.c4
-rw-r--r--sound/pci/riptide/riptide.c6
-rw-r--r--sound/pci/rme32.c14
-rw-r--r--sound/pci/rme96.c44
-rw-r--r--sound/pci/rme9652/hdsp.c7
-rw-r--r--sound/pci/rme9652/hdspm.c2
-rw-r--r--sound/pci/rme9652/rme9652.c4
-rw-r--r--sound/pci/sonicvibes.c8
-rw-r--r--sound/pci/trident/trident.c3
-rw-r--r--sound/pci/trident/trident_main.c22
-rw-r--r--sound/pci/trident/trident_memory.c3
-rw-r--r--sound/pci/trident/trident_synth.c4
-rw-r--r--sound/pci/via82xx.c12
-rw-r--r--sound/pci/via82xx_modem.c2
-rw-r--r--sound/pci/ymfpci/ymfpci.c3
-rw-r--r--sound/pci/ymfpci/ymfpci_main.c2
83 files changed, 1506 insertions, 418 deletions
diff --git a/sound/pci/Kconfig b/sound/pci/Kconfig
index a2081803a827..d37346b12dc0 100644
--- a/sound/pci/Kconfig
+++ b/sound/pci/Kconfig
@@ -216,14 +216,19 @@ config SND_CS46XX_NEW_DSP
216 This works better than the old code, so say Y. 216 This works better than the old code, so say Y.
217 217
218config SND_CS5535AUDIO 218config SND_CS5535AUDIO
219 tristate "CS5535 Audio" 219 tristate "CS5535/CS5536 Audio"
220 depends on SND && X86 && !X86_64 220 depends on SND && X86 && !X86_64
221 select SND_PCM 221 select SND_PCM
222 select SND_AC97_CODEC 222 select SND_AC97_CODEC
223 help 223 help
224 Say Y here to include support for audio on CS5535 chips. It is 224 Say Y here to include support for audio on CS5535 chips. It is
225 referred to as NS CS5535 IO or AMD CS5535 IO companion in 225 referred to as NS CS5535 IO or AMD CS5535 IO companion in
226 various literature. 226 various literature. This driver also supports the CS5536 audio
227 device. However, for both chips, on certain boards, you may
228 need to use ac97_quirk=hp_only if your board has physically
229 mapped headphone out to master output. If that works for you,
230 send lspci -vvv output to the mailing list so that your board
231 can be identified in the quirks list.
227 232
228 To compile this driver as a module, choose M here: the module 233 To compile this driver as a module, choose M here: the module
229 will be called snd-cs5535audio. 234 will be called snd-cs5535audio.
diff --git a/sound/pci/ac97/ac97_codec.c b/sound/pci/ac97/ac97_codec.c
index d05200741ac3..0abf2808d59f 100644
--- a/sound/pci/ac97/ac97_codec.c
+++ b/sound/pci/ac97/ac97_codec.c
@@ -253,6 +253,8 @@ void snd_ac97_write(struct snd_ac97 *ac97, unsigned short reg, unsigned short va
253 ac97->bus->ops->write(ac97, reg, value); 253 ac97->bus->ops->write(ac97, reg, value);
254} 254}
255 255
256EXPORT_SYMBOL(snd_ac97_write);
257
256/** 258/**
257 * snd_ac97_read - read a value from the given register 259 * snd_ac97_read - read a value from the given register
258 * 260 *
@@ -281,6 +283,8 @@ static inline unsigned short snd_ac97_read_cache(struct snd_ac97 *ac97, unsigned
281 return ac97->regs[reg]; 283 return ac97->regs[reg];
282} 284}
283 285
286EXPORT_SYMBOL(snd_ac97_read);
287
284/** 288/**
285 * snd_ac97_write_cache - write a value on the given register and update the cache 289 * snd_ac97_write_cache - write a value on the given register and update the cache
286 * @ac97: the ac97 instance 290 * @ac97: the ac97 instance
@@ -302,6 +306,8 @@ void snd_ac97_write_cache(struct snd_ac97 *ac97, unsigned short reg, unsigned sh
302 mutex_unlock(&ac97->reg_mutex); 306 mutex_unlock(&ac97->reg_mutex);
303} 307}
304 308
309EXPORT_SYMBOL(snd_ac97_write_cache);
310
305/** 311/**
306 * snd_ac97_update - update the value on the given register 312 * snd_ac97_update - update the value on the given register
307 * @ac97: the ac97 instance 313 * @ac97: the ac97 instance
@@ -331,6 +337,8 @@ int snd_ac97_update(struct snd_ac97 *ac97, unsigned short reg, unsigned short va
331 return change; 337 return change;
332} 338}
333 339
340EXPORT_SYMBOL(snd_ac97_update);
341
334/** 342/**
335 * snd_ac97_update_bits - update the bits on the given register 343 * snd_ac97_update_bits - update the bits on the given register
336 * @ac97: the ac97 instance 344 * @ac97: the ac97 instance
@@ -356,6 +364,8 @@ int snd_ac97_update_bits(struct snd_ac97 *ac97, unsigned short reg, unsigned sho
356 return change; 364 return change;
357} 365}
358 366
367EXPORT_SYMBOL(snd_ac97_update_bits);
368
359/* no lock version - see snd_ac97_updat_bits() */ 369/* no lock version - see snd_ac97_updat_bits() */
360int snd_ac97_update_bits_nolock(struct snd_ac97 *ac97, unsigned short reg, 370int snd_ac97_update_bits_nolock(struct snd_ac97 *ac97, unsigned short reg,
361 unsigned short mask, unsigned short value) 371 unsigned short mask, unsigned short value)
@@ -563,7 +573,7 @@ AC97_SINGLE("PC Speaker Playback Volume", AC97_PC_BEEP, 1, 15, 1)
563}; 573};
564 574
565static const struct snd_kcontrol_new snd_ac97_controls_mic_boost = 575static const struct snd_kcontrol_new snd_ac97_controls_mic_boost =
566 AC97_SINGLE("Mic Boost (+20dB)", AC97_MIC, 6, 1, 0); 576 AC97_SINGLE("Mic Boost (+20dB) Switch", AC97_MIC, 6, 1, 0);
567 577
568 578
569static const char* std_rec_sel[] = {"Mic", "CD", "Video", "Aux", "Line", "Mix", "Mix Mono", "Phone"}; 579static const char* std_rec_sel[] = {"Mic", "CD", "Video", "Aux", "Line", "Mix", "Mix Mono", "Phone"};
@@ -605,7 +615,7 @@ AC97_SINGLE("Simulated Stereo Enhancement", AC97_GENERAL_PURPOSE, 14, 1, 0),
605AC97_SINGLE("3D Control - Switch", AC97_GENERAL_PURPOSE, 13, 1, 0), 615AC97_SINGLE("3D Control - Switch", AC97_GENERAL_PURPOSE, 13, 1, 0),
606AC97_SINGLE("Loudness (bass boost)", AC97_GENERAL_PURPOSE, 12, 1, 0), 616AC97_SINGLE("Loudness (bass boost)", AC97_GENERAL_PURPOSE, 12, 1, 0),
607AC97_ENUM("Mono Output Select", std_enum[2]), 617AC97_ENUM("Mono Output Select", std_enum[2]),
608AC97_ENUM("Mic Select", std_enum[3]), 618AC97_ENUM("Mic Select Capture Switch", std_enum[3]),
609AC97_SINGLE("ADC/DAC Loopback", AC97_GENERAL_PURPOSE, 7, 1, 0) 619AC97_SINGLE("ADC/DAC Loopback", AC97_GENERAL_PURPOSE, 7, 1, 0)
610}; 620};
611 621
@@ -1226,7 +1236,8 @@ static int snd_ac97_mixer_build(struct snd_ac97 * ac97)
1226 ac97->regs[AC97_CENTER_LFE_MASTER] = 0x8080; 1236 ac97->regs[AC97_CENTER_LFE_MASTER] = 0x8080;
1227 1237
1228 /* build center controls */ 1238 /* build center controls */
1229 if (snd_ac97_try_volume_mix(ac97, AC97_CENTER_LFE_MASTER)) { 1239 if ((snd_ac97_try_volume_mix(ac97, AC97_CENTER_LFE_MASTER))
1240 && !(ac97->flags & AC97_AD_MULTI)) {
1230 if ((err = snd_ctl_add(card, snd_ac97_cnew(&snd_ac97_controls_center[0], ac97))) < 0) 1241 if ((err = snd_ctl_add(card, snd_ac97_cnew(&snd_ac97_controls_center[0], ac97))) < 0)
1231 return err; 1242 return err;
1232 if ((err = snd_ctl_add(card, kctl = snd_ac97_cnew(&snd_ac97_controls_center[1], ac97))) < 0) 1243 if ((err = snd_ctl_add(card, kctl = snd_ac97_cnew(&snd_ac97_controls_center[1], ac97))) < 0)
@@ -1238,7 +1249,8 @@ static int snd_ac97_mixer_build(struct snd_ac97 * ac97)
1238 } 1249 }
1239 1250
1240 /* build LFE controls */ 1251 /* build LFE controls */
1241 if (snd_ac97_try_volume_mix(ac97, AC97_CENTER_LFE_MASTER+1)) { 1252 if ((snd_ac97_try_volume_mix(ac97, AC97_CENTER_LFE_MASTER+1))
1253 && !(ac97->flags & AC97_AD_MULTI)) {
1242 if ((err = snd_ctl_add(card, snd_ac97_cnew(&snd_ac97_controls_lfe[0], ac97))) < 0) 1254 if ((err = snd_ctl_add(card, snd_ac97_cnew(&snd_ac97_controls_lfe[0], ac97))) < 0)
1243 return err; 1255 return err;
1244 if ((err = snd_ctl_add(card, kctl = snd_ac97_cnew(&snd_ac97_controls_lfe[1], ac97))) < 0) 1256 if ((err = snd_ctl_add(card, kctl = snd_ac97_cnew(&snd_ac97_controls_lfe[1], ac97))) < 0)
@@ -1250,7 +1262,8 @@ static int snd_ac97_mixer_build(struct snd_ac97 * ac97)
1250 } 1262 }
1251 1263
1252 /* build surround controls */ 1264 /* build surround controls */
1253 if (snd_ac97_try_volume_mix(ac97, AC97_SURROUND_MASTER)) { 1265 if ((snd_ac97_try_volume_mix(ac97, AC97_SURROUND_MASTER))
1266 && !(ac97->flags & AC97_AD_MULTI)) {
1254 /* Surround Master (0x38) is with stereo mutes */ 1267 /* Surround Master (0x38) is with stereo mutes */
1255 if ((err = snd_ac97_cmix_new_stereo(card, "Surround Playback", AC97_SURROUND_MASTER, 1, ac97)) < 0) 1268 if ((err = snd_ac97_cmix_new_stereo(card, "Surround Playback", AC97_SURROUND_MASTER, 1, ac97)) < 0)
1256 return err; 1269 return err;
@@ -1335,9 +1348,11 @@ static int snd_ac97_mixer_build(struct snd_ac97 * ac97)
1335 } 1348 }
1336 1349
1337 /* build Aux controls */ 1350 /* build Aux controls */
1338 if (snd_ac97_try_volume_mix(ac97, AC97_AUX)) { 1351 if (!(ac97->flags & AC97_HAS_NO_AUX)) {
1339 if ((err = snd_ac97_cmix_new(card, "Aux Playback", AC97_AUX, ac97)) < 0) 1352 if (snd_ac97_try_volume_mix(ac97, AC97_AUX)) {
1340 return err; 1353 if ((err = snd_ac97_cmix_new(card, "Aux Playback", AC97_AUX, ac97)) < 0)
1354 return err;
1355 }
1341 } 1356 }
1342 1357
1343 /* build PCM controls */ 1358 /* build PCM controls */
@@ -1682,6 +1697,7 @@ const char *snd_ac97_get_short_name(struct snd_ac97 *ac97)
1682 return "unknown codec"; 1697 return "unknown codec";
1683} 1698}
1684 1699
1700EXPORT_SYMBOL(snd_ac97_get_short_name);
1685 1701
1686/* wait for a while until registers are accessible after RESET 1702/* wait for a while until registers are accessible after RESET
1687 * return 0 if ok, negative not ready 1703 * return 0 if ok, negative not ready
@@ -1774,6 +1790,8 @@ int snd_ac97_bus(struct snd_card *card, int num, struct snd_ac97_bus_ops *ops,
1774 return 0; 1790 return 0;
1775} 1791}
1776 1792
1793EXPORT_SYMBOL(snd_ac97_bus);
1794
1777/* stop no dev release warning */ 1795/* stop no dev release warning */
1778static void ac97_device_release(struct device * dev) 1796static void ac97_device_release(struct device * dev)
1779{ 1797{
@@ -2117,6 +2135,7 @@ int snd_ac97_mixer(struct snd_ac97_bus *bus, struct snd_ac97_template *template,
2117 return 0; 2135 return 0;
2118} 2136}
2119 2137
2138EXPORT_SYMBOL(snd_ac97_mixer);
2120 2139
2121/* 2140/*
2122 * Power down the chip. 2141 * Power down the chip.
@@ -2166,6 +2185,8 @@ void snd_ac97_suspend(struct snd_ac97 *ac97)
2166 snd_ac97_powerdown(ac97); 2185 snd_ac97_powerdown(ac97);
2167} 2186}
2168 2187
2188EXPORT_SYMBOL(snd_ac97_suspend);
2189
2169/* 2190/*
2170 * restore ac97 status 2191 * restore ac97 status
2171 */ 2192 */
@@ -2267,6 +2288,8 @@ __reset_ready:
2267 snd_ac97_restore_iec958(ac97); 2288 snd_ac97_restore_iec958(ac97);
2268 } 2289 }
2269} 2290}
2291
2292EXPORT_SYMBOL(snd_ac97_resume);
2270#endif 2293#endif
2271 2294
2272 2295
@@ -2590,29 +2613,7 @@ int snd_ac97_tune_hardware(struct snd_ac97 *ac97, struct ac97_quirk *quirk, cons
2590 return 0; 2613 return 0;
2591} 2614}
2592 2615
2593
2594/*
2595 * Exported symbols
2596 */
2597
2598EXPORT_SYMBOL(snd_ac97_write);
2599EXPORT_SYMBOL(snd_ac97_read);
2600EXPORT_SYMBOL(snd_ac97_write_cache);
2601EXPORT_SYMBOL(snd_ac97_update);
2602EXPORT_SYMBOL(snd_ac97_update_bits);
2603EXPORT_SYMBOL(snd_ac97_get_short_name);
2604EXPORT_SYMBOL(snd_ac97_bus);
2605EXPORT_SYMBOL(snd_ac97_mixer);
2606EXPORT_SYMBOL(snd_ac97_pcm_assign);
2607EXPORT_SYMBOL(snd_ac97_pcm_open);
2608EXPORT_SYMBOL(snd_ac97_pcm_close);
2609EXPORT_SYMBOL(snd_ac97_pcm_double_rate_rules);
2610EXPORT_SYMBOL(snd_ac97_tune_hardware); 2616EXPORT_SYMBOL(snd_ac97_tune_hardware);
2611EXPORT_SYMBOL(snd_ac97_set_rate);
2612#ifdef CONFIG_PM
2613EXPORT_SYMBOL(snd_ac97_resume);
2614EXPORT_SYMBOL(snd_ac97_suspend);
2615#endif
2616 2617
2617/* 2618/*
2618 * INIT part 2619 * INIT part
diff --git a/sound/pci/ac97/ac97_patch.c b/sound/pci/ac97/ac97_patch.c
index 4d9cf37300f7..7f197c780816 100644
--- a/sound/pci/ac97/ac97_patch.c
+++ b/sound/pci/ac97/ac97_patch.c
@@ -464,6 +464,10 @@ int patch_wolfson05(struct snd_ac97 * ac97)
464{ 464{
465 /* WM9705, WM9710 */ 465 /* WM9705, WM9710 */
466 ac97->build_ops = &patch_wolfson_wm9705_ops; 466 ac97->build_ops = &patch_wolfson_wm9705_ops;
467#ifdef CONFIG_TOUCHSCREEN_WM9705
468 /* WM9705 touchscreen uses AUX and VIDEO for touch */
469 ac97->flags |=3D AC97_HAS_NO_VIDEO | AC97_HAS_NO_AUX;
470#endif
467 return 0; 471 return 0;
468} 472}
469 473
@@ -1367,6 +1371,13 @@ static void ad18xx_resume(struct snd_ac97 *ac97)
1367 1371
1368 snd_ac97_restore_iec958(ac97); 1372 snd_ac97_restore_iec958(ac97);
1369} 1373}
1374
1375static void ad1888_resume(struct snd_ac97 *ac97)
1376{
1377 ad18xx_resume(ac97);
1378 snd_ac97_write_cache(ac97, AC97_CODEC_CLASS_REV, 0x8080);
1379}
1380
1370#endif 1381#endif
1371 1382
1372int patch_ad1819(struct snd_ac97 * ac97) 1383int patch_ad1819(struct snd_ac97 * ac97)
@@ -1627,6 +1638,7 @@ static const struct snd_kcontrol_new snd_ac97_ad1981x_jack_sense[] = {
1627 * (SS vendor << 16 | device) 1638 * (SS vendor << 16 | device)
1628 */ 1639 */
1629static unsigned int ad1981_jacks_blacklist[] = { 1640static unsigned int ad1981_jacks_blacklist[] = {
1641 0x10140537, /* Thinkpad T41p */
1630 0x10140554, /* Thinkpad T42p/R50p */ 1642 0x10140554, /* Thinkpad T42p/R50p */
1631 0 /* end */ 1643 0 /* end */
1632}; 1644};
@@ -1839,7 +1851,7 @@ static struct snd_ac97_build_ops patch_ad1888_build_ops = {
1839 .build_post_spdif = patch_ad198x_post_spdif, 1851 .build_post_spdif = patch_ad198x_post_spdif,
1840 .build_specific = patch_ad1888_specific, 1852 .build_specific = patch_ad1888_specific,
1841#ifdef CONFIG_PM 1853#ifdef CONFIG_PM
1842 .resume = ad18xx_resume, 1854 .resume = ad1888_resume,
1843#endif 1855#endif
1844 .update_jacks = ad1888_update_jacks, 1856 .update_jacks = ad1888_update_jacks,
1845}; 1857};
@@ -2048,7 +2060,10 @@ int patch_alc650(struct snd_ac97 * ac97)
2048 /* Enable SPDIF-IN only on Rev.E and above */ 2060 /* Enable SPDIF-IN only on Rev.E and above */
2049 val = snd_ac97_read(ac97, AC97_ALC650_CLOCK); 2061 val = snd_ac97_read(ac97, AC97_ALC650_CLOCK);
2050 /* SPDIF IN with pin 47 */ 2062 /* SPDIF IN with pin 47 */
2051 if (ac97->spec.dev_flags) 2063 if (ac97->spec.dev_flags &&
2064 /* ASUS A6KM requires EAPD */
2065 ! (ac97->subsystem_vendor == 0x1043 &&
2066 ac97->subsystem_device == 0x1103))
2052 val |= 0x03; /* enable */ 2067 val |= 0x03; /* enable */
2053 else 2068 else
2054 val &= ~0x03; /* disable */ 2069 val &= ~0x03; /* disable */
diff --git a/sound/pci/ac97/ac97_pcm.c b/sound/pci/ac97/ac97_pcm.c
index 512a3583b0ce..f684aa2c0067 100644
--- a/sound/pci/ac97/ac97_pcm.c
+++ b/sound/pci/ac97/ac97_pcm.c
@@ -317,6 +317,8 @@ int snd_ac97_set_rate(struct snd_ac97 *ac97, int reg, unsigned int rate)
317 return 0; 317 return 0;
318} 318}
319 319
320EXPORT_SYMBOL(snd_ac97_set_rate);
321
320static unsigned short get_pslots(struct snd_ac97 *ac97, unsigned char *rate_table, unsigned short *spdif_slots) 322static unsigned short get_pslots(struct snd_ac97 *ac97, unsigned char *rate_table, unsigned short *spdif_slots)
321{ 323{
322 if (!ac97_is_audio(ac97)) 324 if (!ac97_is_audio(ac97))
@@ -550,6 +552,8 @@ int snd_ac97_pcm_assign(struct snd_ac97_bus *bus,
550 return 0; 552 return 0;
551} 553}
552 554
555EXPORT_SYMBOL(snd_ac97_pcm_assign);
556
553/** 557/**
554 * snd_ac97_pcm_open - opens the given AC97 pcm 558 * snd_ac97_pcm_open - opens the given AC97 pcm
555 * @pcm: the ac97 pcm instance 559 * @pcm: the ac97 pcm instance
@@ -633,6 +637,8 @@ int snd_ac97_pcm_open(struct ac97_pcm *pcm, unsigned int rate,
633 return err; 637 return err;
634} 638}
635 639
640EXPORT_SYMBOL(snd_ac97_pcm_open);
641
636/** 642/**
637 * snd_ac97_pcm_close - closes the given AC97 pcm 643 * snd_ac97_pcm_close - closes the given AC97 pcm
638 * @pcm: the ac97 pcm instance 644 * @pcm: the ac97 pcm instance
@@ -658,6 +664,8 @@ int snd_ac97_pcm_close(struct ac97_pcm *pcm)
658 return 0; 664 return 0;
659} 665}
660 666
667EXPORT_SYMBOL(snd_ac97_pcm_close);
668
661static int double_rate_hw_constraint_rate(struct snd_pcm_hw_params *params, 669static int double_rate_hw_constraint_rate(struct snd_pcm_hw_params *params,
662 struct snd_pcm_hw_rule *rule) 670 struct snd_pcm_hw_rule *rule)
663{ 671{
@@ -709,3 +717,5 @@ int snd_ac97_pcm_double_rate_rules(struct snd_pcm_runtime *runtime)
709 SNDRV_PCM_HW_PARAM_RATE, -1); 717 SNDRV_PCM_HW_PARAM_RATE, -1);
710 return err; 718 return err;
711} 719}
720
721EXPORT_SYMBOL(snd_ac97_pcm_double_rate_rules);
diff --git a/sound/pci/ac97/ac97_proc.c b/sound/pci/ac97/ac97_proc.c
index 4d523df79cc7..2118df50b9d6 100644
--- a/sound/pci/ac97/ac97_proc.c
+++ b/sound/pci/ac97/ac97_proc.c
@@ -433,7 +433,7 @@ void snd_ac97_proc_init(struct snd_ac97 * ac97)
433 prefix = ac97_is_audio(ac97) ? "ac97" : "mc97"; 433 prefix = ac97_is_audio(ac97) ? "ac97" : "mc97";
434 sprintf(name, "%s#%d-%d", prefix, ac97->addr, ac97->num); 434 sprintf(name, "%s#%d-%d", prefix, ac97->addr, ac97->num);
435 if ((entry = snd_info_create_card_entry(ac97->bus->card, name, ac97->bus->proc)) != NULL) { 435 if ((entry = snd_info_create_card_entry(ac97->bus->card, name, ac97->bus->proc)) != NULL) {
436 snd_info_set_text_ops(entry, ac97, 1024, snd_ac97_proc_read); 436 snd_info_set_text_ops(entry, ac97, snd_ac97_proc_read);
437 if (snd_info_register(entry) < 0) { 437 if (snd_info_register(entry) < 0) {
438 snd_info_free_entry(entry); 438 snd_info_free_entry(entry);
439 entry = NULL; 439 entry = NULL;
@@ -442,10 +442,9 @@ void snd_ac97_proc_init(struct snd_ac97 * ac97)
442 ac97->proc = entry; 442 ac97->proc = entry;
443 sprintf(name, "%s#%d-%d+regs", prefix, ac97->addr, ac97->num); 443 sprintf(name, "%s#%d-%d+regs", prefix, ac97->addr, ac97->num);
444 if ((entry = snd_info_create_card_entry(ac97->bus->card, name, ac97->bus->proc)) != NULL) { 444 if ((entry = snd_info_create_card_entry(ac97->bus->card, name, ac97->bus->proc)) != NULL) {
445 snd_info_set_text_ops(entry, ac97, 1024, snd_ac97_proc_regs_read); 445 snd_info_set_text_ops(entry, ac97, snd_ac97_proc_regs_read);
446#ifdef CONFIG_SND_DEBUG 446#ifdef CONFIG_SND_DEBUG
447 entry->mode |= S_IWUSR; 447 entry->mode |= S_IWUSR;
448 entry->c.text.write_size = 1024;
449 entry->c.text.write = snd_ac97_proc_regs_write; 448 entry->c.text.write = snd_ac97_proc_regs_write;
450#endif 449#endif
451 if (snd_info_register(entry) < 0) { 450 if (snd_info_register(entry) < 0) {
diff --git a/sound/pci/ac97/ak4531_codec.c b/sound/pci/ac97/ak4531_codec.c
index 0fb7b3407312..94c26ec05882 100644
--- a/sound/pci/ac97/ak4531_codec.c
+++ b/sound/pci/ac97/ak4531_codec.c
@@ -453,7 +453,7 @@ static void snd_ak4531_proc_init(struct snd_card *card, struct snd_ak4531 *ak453
453 struct snd_info_entry *entry; 453 struct snd_info_entry *entry;
454 454
455 if (! snd_card_proc_new(card, "ak4531", &entry)) 455 if (! snd_card_proc_new(card, "ak4531", &entry))
456 snd_info_set_text_ops(entry, ak4531, 1024, snd_ak4531_proc_read); 456 snd_info_set_text_ops(entry, ak4531, snd_ak4531_proc_read);
457} 457}
458#endif 458#endif
459 459
diff --git a/sound/pci/ad1889.c b/sound/pci/ad1889.c
index eece1c7e55a0..d42bf4570367 100644
--- a/sound/pci/ad1889.c
+++ b/sound/pci/ad1889.c
@@ -753,7 +753,7 @@ snd_ad1889_proc_init(struct snd_ad1889 *chip)
753 struct snd_info_entry *entry; 753 struct snd_info_entry *entry;
754 754
755 if (!snd_card_proc_new(chip->card, chip->card->driver, &entry)) 755 if (!snd_card_proc_new(chip->card, chip->card->driver, &entry))
756 snd_info_set_text_ops(entry, chip, 1024, snd_ad1889_proc_read); 756 snd_info_set_text_ops(entry, chip, snd_ad1889_proc_read);
757} 757}
758 758
759static struct ac97_quirk ac97_quirks[] = { 759static struct ac97_quirk ac97_quirks[] = {
diff --git a/sound/pci/ali5451/ali5451.c b/sound/pci/ali5451/ali5451.c
index e2dbc2118902..5dfdbf6657f2 100644
--- a/sound/pci/ali5451/ali5451.c
+++ b/sound/pci/ali5451/ali5451.c
@@ -49,7 +49,7 @@ MODULE_SUPPORTED_DEVICE("{{ALI,M5451,pci},{ALI,M5451}}");
49static int index = SNDRV_DEFAULT_IDX1; /* Index */ 49static int index = SNDRV_DEFAULT_IDX1; /* Index */
50static char *id = SNDRV_DEFAULT_STR1; /* ID for this card */ 50static char *id = SNDRV_DEFAULT_STR1; /* ID for this card */
51static int pcm_channels = 32; 51static int pcm_channels = 32;
52static int spdif = 0; 52static int spdif;
53 53
54module_param(index, int, 0444); 54module_param(index, int, 0444);
55MODULE_PARM_DESC(index, "Index value for ALI M5451 PCI Audio."); 55MODULE_PARM_DESC(index, "Index value for ALI M5451 PCI Audio.");
@@ -2173,7 +2173,7 @@ static void __devinit snd_ali_proc_init(struct snd_ali *codec)
2173{ 2173{
2174 struct snd_info_entry *entry; 2174 struct snd_info_entry *entry;
2175 if(!snd_card_proc_new(codec->card, "ali5451", &entry)) 2175 if(!snd_card_proc_new(codec->card, "ali5451", &entry))
2176 snd_info_set_text_ops(entry, codec, 1024, snd_ali_proc_read); 2176 snd_info_set_text_ops(entry, codec, snd_ali_proc_read);
2177} 2177}
2178 2178
2179static int __devinit snd_ali_resources(struct snd_ali *codec) 2179static int __devinit snd_ali_resources(struct snd_ali *codec)
diff --git a/sound/pci/als4000.c b/sound/pci/als4000.c
index 60423b1c678b..a9f08066459a 100644
--- a/sound/pci/als4000.c
+++ b/sound/pci/als4000.c
@@ -746,8 +746,8 @@ static int __devinit snd_card_als4000_probe(struct pci_dev *pci,
746 card->shortname, chip->alt_port, chip->irq); 746 card->shortname, chip->alt_port, chip->irq);
747 747
748 if ((err = snd_mpu401_uart_new( card, 0, MPU401_HW_ALS4000, 748 if ((err = snd_mpu401_uart_new( card, 0, MPU401_HW_ALS4000,
749 gcr+0x30, 1, pci->irq, 0, 749 gcr+0x30, MPU401_INFO_INTEGRATED,
750 &chip->rmidi)) < 0) { 750 pci->irq, 0, &chip->rmidi)) < 0) {
751 printk(KERN_ERR "als4000: no MPU-401 device at 0x%lx?\n", gcr+0x30); 751 printk(KERN_ERR "als4000: no MPU-401 device at 0x%lx?\n", gcr+0x30);
752 goto out_err; 752 goto out_err;
753 } 753 }
diff --git a/sound/pci/atiixp.c b/sound/pci/atiixp.c
index d0f759d86d3d..f18a8c0e4688 100644
--- a/sound/pci/atiixp.c
+++ b/sound/pci/atiixp.c
@@ -1504,7 +1504,7 @@ static void __devinit snd_atiixp_proc_init(struct atiixp *chip)
1504 struct snd_info_entry *entry; 1504 struct snd_info_entry *entry;
1505 1505
1506 if (! snd_card_proc_new(chip->card, "atiixp", &entry)) 1506 if (! snd_card_proc_new(chip->card, "atiixp", &entry))
1507 snd_info_set_text_ops(entry, chip, 1024, snd_atiixp_proc_read); 1507 snd_info_set_text_ops(entry, chip, snd_atiixp_proc_read);
1508} 1508}
1509#else /* !CONFIG_PROC_FS */ 1509#else /* !CONFIG_PROC_FS */
1510#define snd_atiixp_proc_init(chip) 1510#define snd_atiixp_proc_init(chip)
diff --git a/sound/pci/atiixp_modem.c b/sound/pci/atiixp_modem.c
index 12a34c39caa7..40739057076b 100644
--- a/sound/pci/atiixp_modem.c
+++ b/sound/pci/atiixp_modem.c
@@ -1177,7 +1177,7 @@ static void __devinit snd_atiixp_proc_init(struct atiixp_modem *chip)
1177 struct snd_info_entry *entry; 1177 struct snd_info_entry *entry;
1178 1178
1179 if (! snd_card_proc_new(chip->card, "atiixp-modem", &entry)) 1179 if (! snd_card_proc_new(chip->card, "atiixp-modem", &entry))
1180 snd_info_set_text_ops(entry, chip, 1024, snd_atiixp_proc_read); 1180 snd_info_set_text_ops(entry, chip, snd_atiixp_proc_read);
1181} 1181}
1182#else 1182#else
1183#define snd_atiixp_proc_init(chip) 1183#define snd_atiixp_proc_init(chip)
diff --git a/sound/pci/au88x0/au88x0.c b/sound/pci/au88x0/au88x0.c
index 126870ec063a..8a3b118989bf 100644
--- a/sound/pci/au88x0/au88x0.c
+++ b/sound/pci/au88x0/au88x0.c
@@ -261,6 +261,13 @@ snd_vortex_probe(struct pci_dev *pci, const struct pci_device_id *pci_id)
261 return err; 261 return err;
262 } 262 }
263 snd_vortex_workaround(pci, pcifix[dev]); 263 snd_vortex_workaround(pci, pcifix[dev]);
264
265 // Card details needed in snd_vortex_midi
266 strcpy(card->driver, CARD_NAME_SHORT);
267 sprintf(card->shortname, "Aureal Vortex %s", CARD_NAME_SHORT);
268 sprintf(card->longname, "%s at 0x%lx irq %i",
269 card->shortname, chip->io, chip->irq);
270
264 // (4) Alloc components. 271 // (4) Alloc components.
265 // ADB pcm. 272 // ADB pcm.
266 if ((err = snd_vortex_new_pcm(chip, VORTEX_PCM_ADB, NR_ADB)) < 0) { 273 if ((err = snd_vortex_new_pcm(chip, VORTEX_PCM_ADB, NR_ADB)) < 0) {
@@ -323,11 +330,6 @@ snd_vortex_probe(struct pci_dev *pci, const struct pci_device_id *pci_id)
323#endif 330#endif
324 331
325 // (5) 332 // (5)
326 strcpy(card->driver, CARD_NAME_SHORT);
327 strcpy(card->shortname, CARD_NAME_SHORT);
328 sprintf(card->longname, "%s at 0x%lx irq %i",
329 card->shortname, chip->io, chip->irq);
330
331 if ((err = pci_read_config_word(pci, PCI_DEVICE_ID, 333 if ((err = pci_read_config_word(pci, PCI_DEVICE_ID,
332 &(chip->device))) < 0) { 334 &(chip->device))) < 0) {
333 snd_card_free(card); 335 snd_card_free(card);
diff --git a/sound/pci/au88x0/au88x0_mpu401.c b/sound/pci/au88x0/au88x0_mpu401.c
index 873f486b07b8..c75d368ea087 100644
--- a/sound/pci/au88x0/au88x0_mpu401.c
+++ b/sound/pci/au88x0/au88x0_mpu401.c
@@ -47,7 +47,7 @@ static int __devinit snd_vortex_midi(vortex_t * vortex)
47 struct snd_rawmidi *rmidi; 47 struct snd_rawmidi *rmidi;
48 int temp, mode; 48 int temp, mode;
49 struct snd_mpu401 *mpu; 49 struct snd_mpu401 *mpu;
50 int port; 50 unsigned long port;
51 51
52#ifdef VORTEX_MPU401_LEGACY 52#ifdef VORTEX_MPU401_LEGACY
53 /* EnableHardCodedMPU401Port() */ 53 /* EnableHardCodedMPU401Port() */
@@ -70,9 +70,6 @@ static int __devinit snd_vortex_midi(vortex_t * vortex)
70 temp |= (MIDI_CLOCK_DIV << 8) | ((mode >> 24) & 0xff) << 4; 70 temp |= (MIDI_CLOCK_DIV << 8) | ((mode >> 24) & 0xff) << 4;
71 hwwrite(vortex->mmio, VORTEX_CTRL2, temp); 71 hwwrite(vortex->mmio, VORTEX_CTRL2, temp);
72 hwwrite(vortex->mmio, VORTEX_MIDI_CMD, MPU401_RESET); 72 hwwrite(vortex->mmio, VORTEX_MIDI_CMD, MPU401_RESET);
73 /* Set some kind of mode */
74 if (mode)
75 hwwrite(vortex->mmio, VORTEX_MIDI_CMD, MPU401_ENTER_UART);
76 73
77 /* Check if anything is OK. */ 74 /* Check if anything is OK. */
78 temp = hwread(vortex->mmio, VORTEX_MIDI_DATA); 75 temp = hwread(vortex->mmio, VORTEX_MIDI_DATA);
@@ -98,7 +95,8 @@ static int __devinit snd_vortex_midi(vortex_t * vortex)
98 port = (unsigned long)(vortex->mmio + VORTEX_MIDI_DATA); 95 port = (unsigned long)(vortex->mmio + VORTEX_MIDI_DATA);
99 if ((temp = 96 if ((temp =
100 snd_mpu401_uart_new(vortex->card, 0, MPU401_HW_AUREAL, port, 97 snd_mpu401_uart_new(vortex->card, 0, MPU401_HW_AUREAL, port,
101 1, 0, 0, &rmidi)) != 0) { 98 MPU401_INFO_INTEGRATED | MPU401_INFO_MMIO,
99 0, 0, &rmidi)) != 0) {
102 hwwrite(vortex->mmio, VORTEX_CTRL, 100 hwwrite(vortex->mmio, VORTEX_CTRL,
103 (hwread(vortex->mmio, VORTEX_CTRL) & 101 (hwread(vortex->mmio, VORTEX_CTRL) &
104 ~CTRL_MIDI_PORT) & ~CTRL_MIDI_EN); 102 ~CTRL_MIDI_PORT) & ~CTRL_MIDI_EN);
@@ -107,6 +105,9 @@ static int __devinit snd_vortex_midi(vortex_t * vortex)
107 mpu = rmidi->private_data; 105 mpu = rmidi->private_data;
108 mpu->cport = (unsigned long)(vortex->mmio + VORTEX_MIDI_CMD); 106 mpu->cport = (unsigned long)(vortex->mmio + VORTEX_MIDI_CMD);
109#endif 107#endif
108 /* Overwrite MIDI name */
109 snprintf(rmidi->name, sizeof(rmidi->name), "%s MIDI %d", CARD_NAME_SHORT , vortex->card->number);
110
110 vortex->rmidi = rmidi; 111 vortex->rmidi = rmidi;
111 return 0; 112 return 0;
112} 113}
diff --git a/sound/pci/au88x0/au88x0_xtalk.c b/sound/pci/au88x0/au88x0_xtalk.c
index 4534e1882ada..b4151e208b71 100644
--- a/sound/pci/au88x0/au88x0_xtalk.c
+++ b/sound/pci/au88x0/au88x0_xtalk.c
@@ -66,31 +66,20 @@ static xtalk_gains_t const asXtalkGainsAllChan = {
66 0 66 0
67 //0x7FFF,0x7FFF,0x7FFF,0x7FFF,0x7fff,0x7FFF,0x7FFF,0x7FFF,0x7FFF,0x7fff 67 //0x7FFF,0x7FFF,0x7FFF,0x7FFF,0x7fff,0x7FFF,0x7FFF,0x7FFF,0x7FFF,0x7fff
68}; 68};
69static xtalk_gains_t const asXtalkGainsZeros = { 69static xtalk_gains_t const asXtalkGainsZeros;
70 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
71};
72 70
73static xtalk_dline_t const alXtalkDlineZeros = { 71static xtalk_dline_t const alXtalkDlineZeros;
74 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
75 0, 0, 0,
76 0, 0, 0, 0, 0, 0, 0
77};
78static xtalk_dline_t const alXtalkDlineTest = { 72static xtalk_dline_t const alXtalkDlineTest = {
79 0xFC18, 0x03E8FFFF, 0x186A0, 0x7960FFFE, 1, 0xFFFFFFFF, 73 0xFC18, 0x03E8FFFF, 0x186A0, 0x7960FFFE, 1, 0xFFFFFFFF,
80 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 74 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
81 0, 0, 0, 0 75 0, 0, 0, 0
82}; 76};
83 77
84static xtalk_instate_t const asXtalkInStateZeros = { 0, 0, 0, 0 }; 78static xtalk_instate_t const asXtalkInStateZeros;
85static xtalk_instate_t const asXtalkInStateTest = 79static xtalk_instate_t const asXtalkInStateTest =
86 { 0xFF80, 0x0080, 0xFFFF, 0x0001 }; 80 { 0xFF80, 0x0080, 0xFFFF, 0x0001 };
87static xtalk_state_t const asXtalkOutStateZeros = { 81static xtalk_state_t const asXtalkOutStateZeros;
88 {0, 0, 0, 0}, 82
89 {0, 0, 0, 0},
90 {0, 0, 0, 0},
91 {0, 0, 0, 0},
92 {0, 0, 0, 0}
93};
94static short const sDiamondKLeftEq = 0x401d; 83static short const sDiamondKLeftEq = 0x401d;
95static short const sDiamondKRightEq = 0x401d; 84static short const sDiamondKRightEq = 0x401d;
96static short const sDiamondKLeftXt = 0xF90E; 85static short const sDiamondKLeftXt = 0xF90E;
@@ -162,13 +151,7 @@ static xtalk_coefs_t const asXtalkNarrowCoefsRightXt = {
162 {0, 0, 0, 0, 0} 151 {0, 0, 0, 0, 0}
163}; 152};
164 153
165static xtalk_coefs_t const asXtalkCoefsZeros = { 154static xtalk_coefs_t const asXtalkCoefsZeros;
166 {0, 0, 0, 0, 0},
167 {0, 0, 0, 0, 0},
168 {0, 0, 0, 0, 0},
169 {0, 0, 0, 0, 0},
170 {0, 0, 0, 0, 0}
171};
172static xtalk_coefs_t const asXtalkCoefsPipe = { 155static xtalk_coefs_t const asXtalkCoefsPipe = {
173 {0, 0, 0x0FA0, 0, 0}, 156 {0, 0, 0x0FA0, 0, 0},
174 {0, 0, 0x0FA0, 0, 0}, 157 {0, 0, 0x0FA0, 0, 0},
diff --git a/sound/pci/azt3328.c b/sound/pci/azt3328.c
index 52a364524262..6e62dafb66cd 100644
--- a/sound/pci/azt3328.c
+++ b/sound/pci/azt3328.c
@@ -33,14 +33,21 @@
33 * in the first place >:-P}), 33 * in the first place >:-P}),
34 * I was forced to base this driver on reverse engineering 34 * I was forced to base this driver on reverse engineering
35 * (3 weeks' worth of evenings filled with driver work). 35 * (3 weeks' worth of evenings filled with driver work).
36 * (and no, I did NOT go the easy way: to pick up a PCI128 for 9 Euros) 36 * (and no, I did NOT go the easy way: to pick up a SB PCI128 for 9 Euros)
37 * 37 *
38 * The AZF3328 chip (note: AZF3328, *not* AZT3328, that's just the driver name 38 * The AZF3328 chip (note: AZF3328, *not* AZT3328, that's just the driver name
39 * for compatibility reasons) has the following features: 39 * for compatibility reasons) has the following features:
40 * 40 *
41 * - builtin AC97 conformant codec (SNR over 80dB) 41 * - builtin AC97 conformant codec (SNR over 80dB)
42 * (really AC97 compliant?? I really doubt it when looking 42 * Note that "conformant" != "compliant"!! this chip's mixer register layout
43 * at the mixer register layout) 43 * *differs* from the standard AC97 layout:
44 * they chose to not implement the headphone register (which is not a
45 * problem since it's merely optional), yet when doing this, they committed
46 * the grave sin of letting other registers follow immediately instead of
47 * keeping a headphone dummy register, thereby shifting the mixer register
48 * addresses illegally. So far unfortunately it looks like the very flexible
49 * ALSA AC97 support is still not enough to easily compensate for such a
50 * grave layout violation despite all tweaks and quirks mechanisms it offers.
44 * - builtin genuine OPL3 51 * - builtin genuine OPL3
45 * - full duplex 16bit playback/record at independent sampling rate 52 * - full duplex 16bit playback/record at independent sampling rate
46 * - MPU401 (+ legacy address support) FIXME: how to enable legacy addr?? 53 * - MPU401 (+ legacy address support) FIXME: how to enable legacy addr??
@@ -90,10 +97,15 @@
90 * 97 *
91 * TODO 98 * TODO
92 * - test MPU401 MIDI playback etc. 99 * - test MPU401 MIDI playback etc.
93 * - power management. See e.g. intel8x0 or cs4281. 100 * - add some power micro-management (disable various units of the card
94 * This would be nice since the chip runs a bit hot, and it's *required* 101 * as long as they're unused). However this requires I/O ports which I
95 * anyway for proper ACPI power management. 102 * haven't figured out yet and which thus might not even exist...
103 * The standard suspend/resume functionality could probably make use of
104 * some improvement, too...
96 * - figure out what all unknown port bits are responsible for 105 * - figure out what all unknown port bits are responsible for
106 * - figure out some cleverly evil scheme to possibly make ALSA AC97 code
107 * fully accept our quite incompatible ""AC97"" mixer and thus save some
108 * code (but I'm not too optimistic that doing this is possible at all)
97 */ 109 */
98 110
99#include <sound/driver.h> 111#include <sound/driver.h>
@@ -214,6 +226,16 @@ struct snd_azf3328 {
214 226
215 struct pci_dev *pci; 227 struct pci_dev *pci;
216 int irq; 228 int irq;
229
230#ifdef CONFIG_PM
231 /* register value containers for power management
232 * Note: not always full I/O range preserved (just like Win driver!) */
233 u16 saved_regs_codec [AZF_IO_SIZE_CODEC_PM / 2];
234 u16 saved_regs_io2 [AZF_IO_SIZE_IO2_PM / 2];
235 u16 saved_regs_mpu [AZF_IO_SIZE_MPU_PM / 2];
236 u16 saved_regs_synth[AZF_IO_SIZE_SYNTH_PM / 2];
237 u16 saved_regs_mixer[AZF_IO_SIZE_MIXER_PM / 2];
238#endif
217}; 239};
218 240
219static const struct pci_device_id snd_azf3328_ids[] __devinitdata = { 241static const struct pci_device_id snd_azf3328_ids[] __devinitdata = {
@@ -317,10 +339,8 @@ snd_azf3328_mixer_write_volume_gradually(const struct snd_azf3328 *chip, int reg
317 else 339 else
318 dst_vol_left &= ~0x80; 340 dst_vol_left &= ~0x80;
319 341
320 do 342 do {
321 { 343 if (!left_done) {
322 if (!left_done)
323 {
324 if (curr_vol_left > dst_vol_left) 344 if (curr_vol_left > dst_vol_left)
325 curr_vol_left--; 345 curr_vol_left--;
326 else 346 else
@@ -330,8 +350,7 @@ snd_azf3328_mixer_write_volume_gradually(const struct snd_azf3328 *chip, int reg
330 left_done = 1; 350 left_done = 1;
331 outb(curr_vol_left, portbase + 1); 351 outb(curr_vol_left, portbase + 1);
332 } 352 }
333 if (!right_done) 353 if (!right_done) {
334 {
335 if (curr_vol_right > dst_vol_right) 354 if (curr_vol_right > dst_vol_right)
336 curr_vol_right--; 355 curr_vol_right--;
337 else 356 else
@@ -346,8 +365,7 @@ snd_azf3328_mixer_write_volume_gradually(const struct snd_azf3328 *chip, int reg
346 } 365 }
347 if (delay) 366 if (delay)
348 mdelay(delay); 367 mdelay(delay);
349 } 368 } while ((!left_done) || (!right_done));
350 while ((!left_done) || (!right_done));
351 snd_azf3328_dbgcallleave(); 369 snd_azf3328_dbgcallleave();
352} 370}
353 371
@@ -514,15 +532,18 @@ snd_azf3328_info_mixer_enum(struct snd_kcontrol *kcontrol,
514 struct snd_ctl_elem_info *uinfo) 532 struct snd_ctl_elem_info *uinfo)
515{ 533{
516 static const char * const texts1[] = { 534 static const char * const texts1[] = {
517 "ModemOut1", "ModemOut2" 535 "Mic1", "Mic2"
518 }; 536 };
519 static const char * const texts2[] = { 537 static const char * const texts2[] = {
520 "MonoSelectSource1", "MonoSelectSource2" 538 "Mix", "Mic"
521 }; 539 };
522 static const char * const texts3[] = { 540 static const char * const texts3[] = {
523 "Mic", "CD", "Video", "Aux", 541 "Mic", "CD", "Video", "Aux",
524 "Line", "Mix", "Mix Mono", "Phone" 542 "Line", "Mix", "Mix Mono", "Phone"
525 }; 543 };
544 static const char * const texts4[] = {
545 "pre 3D", "post 3D"
546 };
526 struct azf3328_mixer_reg reg; 547 struct azf3328_mixer_reg reg;
527 548
528 snd_azf3328_mixer_reg_decode(&reg, kcontrol->private_value); 549 snd_azf3328_mixer_reg_decode(&reg, kcontrol->private_value);
@@ -531,14 +552,19 @@ snd_azf3328_info_mixer_enum(struct snd_kcontrol *kcontrol,
531 uinfo->value.enumerated.items = reg.enum_c; 552 uinfo->value.enumerated.items = reg.enum_c;
532 if (uinfo->value.enumerated.item > reg.enum_c - 1U) 553 if (uinfo->value.enumerated.item > reg.enum_c - 1U)
533 uinfo->value.enumerated.item = reg.enum_c - 1U; 554 uinfo->value.enumerated.item = reg.enum_c - 1U;
534 if (reg.reg == IDX_MIXER_ADVCTL2) 555 if (reg.reg == IDX_MIXER_ADVCTL2) {
535 { 556 switch(reg.lchan_shift) {
536 if (reg.lchan_shift == 8) /* modem out sel */ 557 case 8: /* modem out sel */
537 strcpy(uinfo->value.enumerated.name, texts1[uinfo->value.enumerated.item]); 558 strcpy(uinfo->value.enumerated.name, texts1[uinfo->value.enumerated.item]);
538 else /* mono sel source */ 559 break;
560 case 9: /* mono sel source */
539 strcpy(uinfo->value.enumerated.name, texts2[uinfo->value.enumerated.item]); 561 strcpy(uinfo->value.enumerated.name, texts2[uinfo->value.enumerated.item]);
540 } 562 break;
541 else 563 case 15: /* PCM Out Path */
564 strcpy(uinfo->value.enumerated.name, texts4[uinfo->value.enumerated.item]);
565 break;
566 }
567 } else
542 strcpy(uinfo->value.enumerated.name, texts3[uinfo->value.enumerated.item] 568 strcpy(uinfo->value.enumerated.name, texts3[uinfo->value.enumerated.item]
543); 569);
544 return 0; 570 return 0;
@@ -554,12 +580,10 @@ snd_azf3328_get_mixer_enum(struct snd_kcontrol *kcontrol,
554 580
555 snd_azf3328_mixer_reg_decode(&reg, kcontrol->private_value); 581 snd_azf3328_mixer_reg_decode(&reg, kcontrol->private_value);
556 val = snd_azf3328_mixer_inw(chip, reg.reg); 582 val = snd_azf3328_mixer_inw(chip, reg.reg);
557 if (reg.reg == IDX_MIXER_REC_SELECT) 583 if (reg.reg == IDX_MIXER_REC_SELECT) {
558 {
559 ucontrol->value.enumerated.item[0] = (val >> 8) & (reg.enum_c - 1); 584 ucontrol->value.enumerated.item[0] = (val >> 8) & (reg.enum_c - 1);
560 ucontrol->value.enumerated.item[1] = (val >> 0) & (reg.enum_c - 1); 585 ucontrol->value.enumerated.item[1] = (val >> 0) & (reg.enum_c - 1);
561 } 586 } else
562 else
563 ucontrol->value.enumerated.item[0] = (val >> reg.lchan_shift) & (reg.enum_c - 1); 587 ucontrol->value.enumerated.item[0] = (val >> reg.lchan_shift) & (reg.enum_c - 1);
564 588
565 snd_azf3328_dbgmixer("get_enum: %02x is %04x -> %d|%d (shift %02d, enum_c %d)\n", 589 snd_azf3328_dbgmixer("get_enum: %02x is %04x -> %d|%d (shift %02d, enum_c %d)\n",
@@ -579,16 +603,13 @@ snd_azf3328_put_mixer_enum(struct snd_kcontrol *kcontrol,
579 snd_azf3328_mixer_reg_decode(&reg, kcontrol->private_value); 603 snd_azf3328_mixer_reg_decode(&reg, kcontrol->private_value);
580 oreg = snd_azf3328_mixer_inw(chip, reg.reg); 604 oreg = snd_azf3328_mixer_inw(chip, reg.reg);
581 val = oreg; 605 val = oreg;
582 if (reg.reg == IDX_MIXER_REC_SELECT) 606 if (reg.reg == IDX_MIXER_REC_SELECT) {
583 {
584 if (ucontrol->value.enumerated.item[0] > reg.enum_c - 1U || 607 if (ucontrol->value.enumerated.item[0] > reg.enum_c - 1U ||
585 ucontrol->value.enumerated.item[1] > reg.enum_c - 1U) 608 ucontrol->value.enumerated.item[1] > reg.enum_c - 1U)
586 return -EINVAL; 609 return -EINVAL;
587 val = (ucontrol->value.enumerated.item[0] << 8) | 610 val = (ucontrol->value.enumerated.item[0] << 8) |
588 (ucontrol->value.enumerated.item[1] << 0); 611 (ucontrol->value.enumerated.item[1] << 0);
589 } 612 } else {
590 else
591 {
592 if (ucontrol->value.enumerated.item[0] > reg.enum_c - 1U) 613 if (ucontrol->value.enumerated.item[0] > reg.enum_c - 1U)
593 return -EINVAL; 614 return -EINVAL;
594 val &= ~((reg.enum_c - 1) << reg.lchan_shift); 615 val &= ~((reg.enum_c - 1) << reg.lchan_shift);
@@ -629,13 +650,14 @@ static const struct snd_kcontrol_new snd_azf3328_mixer_controls[] __devinitdata
629 AZF3328_MIXER_VOL_MONO("Modem Playback Volume", IDX_MIXER_MODEMOUT, 0x1f, 1), 650 AZF3328_MIXER_VOL_MONO("Modem Playback Volume", IDX_MIXER_MODEMOUT, 0x1f, 1),
630 AZF3328_MIXER_SWITCH("Modem Capture Switch", IDX_MIXER_MODEMIN, 15, 1), 651 AZF3328_MIXER_SWITCH("Modem Capture Switch", IDX_MIXER_MODEMIN, 15, 1),
631 AZF3328_MIXER_VOL_MONO("Modem Capture Volume", IDX_MIXER_MODEMIN, 0x1f, 1), 652 AZF3328_MIXER_VOL_MONO("Modem Capture Volume", IDX_MIXER_MODEMIN, 0x1f, 1),
632 AZF3328_MIXER_ENUM("Modem Out Select", IDX_MIXER_ADVCTL2, 2, 8), 653 AZF3328_MIXER_ENUM("Mic Select", IDX_MIXER_ADVCTL2, 2, 8),
633 AZF3328_MIXER_ENUM("Mono Select Source", IDX_MIXER_ADVCTL2, 2, 9), 654 AZF3328_MIXER_ENUM("Mono Output Select", IDX_MIXER_ADVCTL2, 2, 9),
655 AZF3328_MIXER_ENUM("PCM", IDX_MIXER_ADVCTL2, 2, 15), /* PCM Out Path, place in front since it controls *both* 3D and Bass/Treble! */
634 AZF3328_MIXER_VOL_SPECIAL("Tone Control - Treble", IDX_MIXER_BASSTREBLE, 0x07, 1, 0), 656 AZF3328_MIXER_VOL_SPECIAL("Tone Control - Treble", IDX_MIXER_BASSTREBLE, 0x07, 1, 0),
635 AZF3328_MIXER_VOL_SPECIAL("Tone Control - Bass", IDX_MIXER_BASSTREBLE, 0x07, 9, 0), 657 AZF3328_MIXER_VOL_SPECIAL("Tone Control - Bass", IDX_MIXER_BASSTREBLE, 0x07, 9, 0),
636 AZF3328_MIXER_SWITCH("3D Control - Switch", IDX_MIXER_ADVCTL2, 13, 0), 658 AZF3328_MIXER_SWITCH("3D Control - Switch", IDX_MIXER_ADVCTL2, 13, 0),
637 AZF3328_MIXER_VOL_SPECIAL("3D Control - Wide", IDX_MIXER_ADVCTL1, 0x07, 1, 0), /* "3D Width" */ 659 AZF3328_MIXER_VOL_SPECIAL("3D Control - Width", IDX_MIXER_ADVCTL1, 0x07, 1, 0), /* "3D Width" */
638 AZF3328_MIXER_VOL_SPECIAL("3D Control - Space", IDX_MIXER_ADVCTL1, 0x03, 8, 0), /* "Hifi 3D" */ 660 AZF3328_MIXER_VOL_SPECIAL("3D Control - Depth", IDX_MIXER_ADVCTL1, 0x03, 8, 0), /* "Hifi 3D" */
639#if MIXER_TESTING 661#if MIXER_TESTING
640 AZF3328_MIXER_SWITCH("0", IDX_MIXER_ADVCTL2, 0, 0), 662 AZF3328_MIXER_SWITCH("0", IDX_MIXER_ADVCTL2, 0, 0),
641 AZF3328_MIXER_SWITCH("1", IDX_MIXER_ADVCTL2, 1, 0), 663 AZF3328_MIXER_SWITCH("1", IDX_MIXER_ADVCTL2, 1, 0),
@@ -813,22 +835,18 @@ snd_azf3328_setdmaa(struct snd_azf3328 *chip,
813 unsigned int is_running; 835 unsigned int is_running;
814 836
815 snd_azf3328_dbgcallenter(); 837 snd_azf3328_dbgcallenter();
816 if (do_recording) 838 if (do_recording) {
817 {
818 /* access capture registers, i.e. skip playback reg section */ 839 /* access capture registers, i.e. skip playback reg section */
819 portbase = chip->codec_port + 0x20; 840 portbase = chip->codec_port + 0x20;
820 is_running = chip->is_recording; 841 is_running = chip->is_recording;
821 } 842 } else {
822 else
823 {
824 /* access the playback register section */ 843 /* access the playback register section */
825 portbase = chip->codec_port + 0x00; 844 portbase = chip->codec_port + 0x00;
826 is_running = chip->is_playing; 845 is_running = chip->is_playing;
827 } 846 }
828 847
829 /* AZF3328 uses a two buffer pointer DMA playback approach */ 848 /* AZF3328 uses a two buffer pointer DMA playback approach */
830 if (!is_running) 849 if (!is_running) {
831 {
832 unsigned long addr_area2; 850 unsigned long addr_area2;
833 unsigned long count_areas, count_tmp; /* width 32bit -- overflow!! */ 851 unsigned long count_areas, count_tmp; /* width 32bit -- overflow!! */
834 count_areas = size/2; 852 count_areas = size/2;
@@ -961,6 +979,13 @@ snd_azf3328_playback_trigger(struct snd_pcm_substream *substream, int cmd)
961 chip->is_playing = 1; 979 chip->is_playing = 1;
962 snd_azf3328_dbgplay("STARTED PLAYBACK\n"); 980 snd_azf3328_dbgplay("STARTED PLAYBACK\n");
963 break; 981 break;
982 case SNDRV_PCM_TRIGGER_RESUME:
983 snd_azf3328_dbgplay("RESUME PLAYBACK\n");
984 /* resume playback if we were active */
985 if (chip->is_playing)
986 snd_azf3328_codec_outw(chip, IDX_IO_PLAY_FLAGS,
987 snd_azf3328_codec_inw(chip, IDX_IO_PLAY_FLAGS) | DMA_RESUME);
988 break;
964 case SNDRV_PCM_TRIGGER_STOP: 989 case SNDRV_PCM_TRIGGER_STOP:
965 snd_azf3328_dbgplay("STOP PLAYBACK\n"); 990 snd_azf3328_dbgplay("STOP PLAYBACK\n");
966 991
@@ -988,6 +1013,12 @@ snd_azf3328_playback_trigger(struct snd_pcm_substream *substream, int cmd)
988 chip->is_playing = 0; 1013 chip->is_playing = 0;
989 snd_azf3328_dbgplay("STOPPED PLAYBACK\n"); 1014 snd_azf3328_dbgplay("STOPPED PLAYBACK\n");
990 break; 1015 break;
1016 case SNDRV_PCM_TRIGGER_SUSPEND:
1017 snd_azf3328_dbgplay("SUSPEND PLAYBACK\n");
1018 /* make sure playback is stopped */
1019 snd_azf3328_codec_outw(chip, IDX_IO_PLAY_FLAGS,
1020 snd_azf3328_codec_inw(chip, IDX_IO_PLAY_FLAGS) & ~DMA_RESUME);
1021 break;
991 case SNDRV_PCM_TRIGGER_PAUSE_PUSH: 1022 case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
992 snd_printk(KERN_ERR "FIXME: SNDRV_PCM_TRIGGER_PAUSE_PUSH NIY!\n"); 1023 snd_printk(KERN_ERR "FIXME: SNDRV_PCM_TRIGGER_PAUSE_PUSH NIY!\n");
993 break; 1024 break;
@@ -995,6 +1026,7 @@ snd_azf3328_playback_trigger(struct snd_pcm_substream *substream, int cmd)
995 snd_printk(KERN_ERR "FIXME: SNDRV_PCM_TRIGGER_PAUSE_RELEASE NIY!\n"); 1026 snd_printk(KERN_ERR "FIXME: SNDRV_PCM_TRIGGER_PAUSE_RELEASE NIY!\n");
996 break; 1027 break;
997 default: 1028 default:
1029 printk(KERN_ERR "FIXME: unknown trigger mode!\n");
998 return -EINVAL; 1030 return -EINVAL;
999 } 1031 }
1000 1032
@@ -1068,6 +1100,13 @@ snd_azf3328_capture_trigger(struct snd_pcm_substream *substream, int cmd)
1068 chip->is_recording = 1; 1100 chip->is_recording = 1;
1069 snd_azf3328_dbgplay("STARTED CAPTURE\n"); 1101 snd_azf3328_dbgplay("STARTED CAPTURE\n");
1070 break; 1102 break;
1103 case SNDRV_PCM_TRIGGER_RESUME:
1104 snd_azf3328_dbgplay("RESUME CAPTURE\n");
1105 /* resume recording if we were active */
1106 if (chip->is_recording)
1107 snd_azf3328_codec_outw(chip, IDX_IO_REC_FLAGS,
1108 snd_azf3328_codec_inw(chip, IDX_IO_REC_FLAGS) | DMA_RESUME);
1109 break;
1071 case SNDRV_PCM_TRIGGER_STOP: 1110 case SNDRV_PCM_TRIGGER_STOP:
1072 snd_azf3328_dbgplay("STOP CAPTURE\n"); 1111 snd_azf3328_dbgplay("STOP CAPTURE\n");
1073 1112
@@ -1088,6 +1127,12 @@ snd_azf3328_capture_trigger(struct snd_pcm_substream *substream, int cmd)
1088 chip->is_recording = 0; 1127 chip->is_recording = 0;
1089 snd_azf3328_dbgplay("STOPPED CAPTURE\n"); 1128 snd_azf3328_dbgplay("STOPPED CAPTURE\n");
1090 break; 1129 break;
1130 case SNDRV_PCM_TRIGGER_SUSPEND:
1131 snd_azf3328_dbgplay("SUSPEND CAPTURE\n");
1132 /* make sure recording is stopped */
1133 snd_azf3328_codec_outw(chip, IDX_IO_REC_FLAGS,
1134 snd_azf3328_codec_inw(chip, IDX_IO_REC_FLAGS) & ~DMA_RESUME);
1135 break;
1091 case SNDRV_PCM_TRIGGER_PAUSE_PUSH: 1136 case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
1092 snd_printk(KERN_ERR "FIXME: SNDRV_PCM_TRIGGER_PAUSE_PUSH NIY!\n"); 1137 snd_printk(KERN_ERR "FIXME: SNDRV_PCM_TRIGGER_PAUSE_PUSH NIY!\n");
1093 break; 1138 break;
@@ -1095,6 +1140,7 @@ snd_azf3328_capture_trigger(struct snd_pcm_substream *substream, int cmd)
1095 snd_printk(KERN_ERR "FIXME: SNDRV_PCM_TRIGGER_PAUSE_RELEASE NIY!\n"); 1140 snd_printk(KERN_ERR "FIXME: SNDRV_PCM_TRIGGER_PAUSE_RELEASE NIY!\n");
1096 break; 1141 break;
1097 default: 1142 default:
1143 printk(KERN_ERR "FIXME: unknown trigger mode!\n");
1098 return -EINVAL; 1144 return -EINVAL;
1099 } 1145 }
1100 1146
@@ -1163,8 +1209,7 @@ snd_azf3328_interrupt(int irq, void *dev_id, struct pt_regs *regs)
1163 snd_azf3328_codec_inw(chip, IDX_IO_PLAY_IRQTYPE), 1209 snd_azf3328_codec_inw(chip, IDX_IO_PLAY_IRQTYPE),
1164 status); 1210 status);
1165 1211
1166 if (status & IRQ_TIMER) 1212 if (status & IRQ_TIMER) {
1167 {
1168 /* snd_azf3328_dbgplay("timer %ld\n", inl(chip->codec_port+IDX_IO_TIMER_VALUE) & TIMER_VALUE_MASK); */ 1213 /* snd_azf3328_dbgplay("timer %ld\n", inl(chip->codec_port+IDX_IO_TIMER_VALUE) & TIMER_VALUE_MASK); */
1169 if (chip->timer) 1214 if (chip->timer)
1170 snd_timer_interrupt(chip->timer, chip->timer->sticks); 1215 snd_timer_interrupt(chip->timer, chip->timer->sticks);
@@ -1174,50 +1219,43 @@ snd_azf3328_interrupt(int irq, void *dev_id, struct pt_regs *regs)
1174 spin_unlock(&chip->reg_lock); 1219 spin_unlock(&chip->reg_lock);
1175 snd_azf3328_dbgplay("azt3328: timer IRQ\n"); 1220 snd_azf3328_dbgplay("azt3328: timer IRQ\n");
1176 } 1221 }
1177 if (status & IRQ_PLAYBACK) 1222 if (status & IRQ_PLAYBACK) {
1178 {
1179 spin_lock(&chip->reg_lock); 1223 spin_lock(&chip->reg_lock);
1180 which = snd_azf3328_codec_inb(chip, IDX_IO_PLAY_IRQTYPE); 1224 which = snd_azf3328_codec_inb(chip, IDX_IO_PLAY_IRQTYPE);
1181 /* ack all IRQ types immediately */ 1225 /* ack all IRQ types immediately */
1182 snd_azf3328_codec_outb(chip, IDX_IO_PLAY_IRQTYPE, which); 1226 snd_azf3328_codec_outb(chip, IDX_IO_PLAY_IRQTYPE, which);
1183 spin_unlock(&chip->reg_lock); 1227 spin_unlock(&chip->reg_lock);
1184 1228
1185 if (chip->pcm && chip->playback_substream) 1229 if (chip->pcm && chip->playback_substream) {
1186 {
1187 snd_pcm_period_elapsed(chip->playback_substream); 1230 snd_pcm_period_elapsed(chip->playback_substream);
1188 snd_azf3328_dbgplay("PLAY period done (#%x), @ %x\n", 1231 snd_azf3328_dbgplay("PLAY period done (#%x), @ %x\n",
1189 which, 1232 which,
1190 inl(chip->codec_port+IDX_IO_PLAY_DMA_CURRPOS)); 1233 inl(chip->codec_port+IDX_IO_PLAY_DMA_CURRPOS));
1191 } 1234 } else
1192 else
1193 snd_azf3328_dbgplay("azt3328: ouch, irq handler problem!\n"); 1235 snd_azf3328_dbgplay("azt3328: ouch, irq handler problem!\n");
1194 if (which & IRQ_PLAY_SOMETHING) 1236 if (which & IRQ_PLAY_SOMETHING)
1195 snd_azf3328_dbgplay("azt3328: unknown play IRQ type occurred, please report!\n"); 1237 snd_azf3328_dbgplay("azt3328: unknown play IRQ type occurred, please report!\n");
1196 } 1238 }
1197 if (status & IRQ_RECORDING) 1239 if (status & IRQ_RECORDING) {
1198 {
1199 spin_lock(&chip->reg_lock); 1240 spin_lock(&chip->reg_lock);
1200 which = snd_azf3328_codec_inb(chip, IDX_IO_REC_IRQTYPE); 1241 which = snd_azf3328_codec_inb(chip, IDX_IO_REC_IRQTYPE);
1201 /* ack all IRQ types immediately */ 1242 /* ack all IRQ types immediately */
1202 snd_azf3328_codec_outb(chip, IDX_IO_REC_IRQTYPE, which); 1243 snd_azf3328_codec_outb(chip, IDX_IO_REC_IRQTYPE, which);
1203 spin_unlock(&chip->reg_lock); 1244 spin_unlock(&chip->reg_lock);
1204 1245
1205 if (chip->pcm && chip->capture_substream) 1246 if (chip->pcm && chip->capture_substream) {
1206 {
1207 snd_pcm_period_elapsed(chip->capture_substream); 1247 snd_pcm_period_elapsed(chip->capture_substream);
1208 snd_azf3328_dbgplay("REC period done (#%x), @ %x\n", 1248 snd_azf3328_dbgplay("REC period done (#%x), @ %x\n",
1209 which, 1249 which,
1210 inl(chip->codec_port+IDX_IO_REC_DMA_CURRPOS)); 1250 inl(chip->codec_port+IDX_IO_REC_DMA_CURRPOS));
1211 } 1251 } else
1212 else
1213 snd_azf3328_dbgplay("azt3328: ouch, irq handler problem!\n"); 1252 snd_azf3328_dbgplay("azt3328: ouch, irq handler problem!\n");
1214 if (which & IRQ_REC_SOMETHING) 1253 if (which & IRQ_REC_SOMETHING)
1215 snd_azf3328_dbgplay("azt3328: unknown rec IRQ type occurred, please report!\n"); 1254 snd_azf3328_dbgplay("azt3328: unknown rec IRQ type occurred, please report!\n");
1216 } 1255 }
1217 /* MPU401 has less critical IRQ requirements 1256 /* MPU401 has less critical IRQ requirements
1218 * than timer and playback/recording, right? */ 1257 * than timer and playback/recording, right? */
1219 if (status & IRQ_MPU401) 1258 if (status & IRQ_MPU401) {
1220 {
1221 snd_mpu401_uart_interrupt(irq, chip->rmidi->private_data, regs); 1259 snd_mpu401_uart_interrupt(irq, chip->rmidi->private_data, regs);
1222 1260
1223 /* hmm, do we have to ack the IRQ here somehow? 1261 /* hmm, do we have to ack the IRQ here somehow?
@@ -1511,8 +1549,7 @@ snd_azf3328_timer_start(struct snd_timer *timer)
1511 snd_azf3328_dbgcallenter(); 1549 snd_azf3328_dbgcallenter();
1512 chip = snd_timer_chip(timer); 1550 chip = snd_timer_chip(timer);
1513 delay = ((timer->sticks * seqtimer_scaling) - 1) & TIMER_VALUE_MASK; 1551 delay = ((timer->sticks * seqtimer_scaling) - 1) & TIMER_VALUE_MASK;
1514 if (delay < 49) 1552 if (delay < 49) {
1515 {
1516 /* uhoh, that's not good, since user-space won't know about 1553 /* uhoh, that's not good, since user-space won't know about
1517 * this timing tweak 1554 * this timing tweak
1518 * (we need to do it to avoid a lockup, though) */ 1555 * (we need to do it to avoid a lockup, though) */
@@ -1766,9 +1803,11 @@ snd_azf3328_probe(struct pci_dev *pci, const struct pci_device_id *pci_id)
1766 goto out_err; 1803 goto out_err;
1767 } 1804 }
1768 1805
1806 card->private_data = chip;
1807
1769 if ((err = snd_mpu401_uart_new( card, 0, MPU401_HW_MPU401, 1808 if ((err = snd_mpu401_uart_new( card, 0, MPU401_HW_MPU401,
1770 chip->mpu_port, 1, pci->irq, 0, 1809 chip->mpu_port, MPU401_INFO_INTEGRATED,
1771 &chip->rmidi)) < 0) { 1810 pci->irq, 0, &chip->rmidi)) < 0) {
1772 snd_printk(KERN_ERR "azf3328: no MPU-401 device at 0x%lx?\n", chip->mpu_port); 1811 snd_printk(KERN_ERR "azf3328: no MPU-401 device at 0x%lx?\n", chip->mpu_port);
1773 goto out_err; 1812 goto out_err;
1774 } 1813 }
@@ -1791,6 +1830,8 @@ snd_azf3328_probe(struct pci_dev *pci, const struct pci_device_id *pci_id)
1791 } 1830 }
1792 } 1831 }
1793 1832
1833 opl3->private_data = chip;
1834
1794 sprintf(card->longname, "%s at 0x%lx, irq %i", 1835 sprintf(card->longname, "%s at 0x%lx, irq %i",
1795 card->shortname, chip->codec_port, chip->irq); 1836 card->shortname, chip->codec_port, chip->irq);
1796 1837
@@ -1834,11 +1875,80 @@ snd_azf3328_remove(struct pci_dev *pci)
1834 snd_azf3328_dbgcallleave(); 1875 snd_azf3328_dbgcallleave();
1835} 1876}
1836 1877
1878#ifdef CONFIG_PM
1879static int
1880snd_azf3328_suspend(struct pci_dev *pci, pm_message_t state)
1881{
1882 struct snd_card *card = pci_get_drvdata(pci);
1883 struct snd_azf3328 *chip = card->private_data;
1884 int reg;
1885
1886 snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
1887
1888 snd_pcm_suspend_all(chip->pcm);
1889
1890 for (reg = 0; reg < AZF_IO_SIZE_MIXER_PM / 2; reg++)
1891 chip->saved_regs_mixer[reg] = inw(chip->mixer_port + reg * 2);
1892
1893 /* make sure to disable master volume etc. to prevent looping sound */
1894 snd_azf3328_mixer_set_mute(chip, IDX_MIXER_PLAY_MASTER, 1);
1895 snd_azf3328_mixer_set_mute(chip, IDX_MIXER_WAVEOUT, 1);
1896
1897 for (reg = 0; reg < AZF_IO_SIZE_CODEC_PM / 2; reg++)
1898 chip->saved_regs_codec[reg] = inw(chip->codec_port + reg * 2);
1899 for (reg = 0; reg < AZF_IO_SIZE_IO2_PM / 2; reg++)
1900 chip->saved_regs_io2[reg] = inw(chip->io2_port + reg * 2);
1901 for (reg = 0; reg < AZF_IO_SIZE_MPU_PM / 2; reg++)
1902 chip->saved_regs_mpu[reg] = inw(chip->mpu_port + reg * 2);
1903 for (reg = 0; reg < AZF_IO_SIZE_SYNTH_PM / 2; reg++)
1904 chip->saved_regs_synth[reg] = inw(chip->synth_port + reg * 2);
1905
1906 pci_set_power_state(pci, PCI_D3hot);
1907 pci_disable_device(pci);
1908 pci_save_state(pci);
1909 return 0;
1910}
1911
1912static int
1913snd_azf3328_resume(struct pci_dev *pci)
1914{
1915 struct snd_card *card = pci_get_drvdata(pci);
1916 struct snd_azf3328 *chip = card->private_data;
1917 int reg;
1918
1919 pci_restore_state(pci);
1920 pci_enable_device(pci);
1921 pci_set_power_state(pci, PCI_D0);
1922 pci_set_master(pci);
1923
1924 for (reg = 0; reg < AZF_IO_SIZE_IO2_PM / 2; reg++)
1925 outw(chip->saved_regs_io2[reg], chip->io2_port + reg * 2);
1926 for (reg = 0; reg < AZF_IO_SIZE_MPU_PM / 2; reg++)
1927 outw(chip->saved_regs_mpu[reg], chip->mpu_port + reg * 2);
1928 for (reg = 0; reg < AZF_IO_SIZE_SYNTH_PM / 2; reg++)
1929 outw(chip->saved_regs_synth[reg], chip->synth_port + reg * 2);
1930 for (reg = 0; reg < AZF_IO_SIZE_MIXER_PM / 2; reg++)
1931 outw(chip->saved_regs_mixer[reg], chip->mixer_port + reg * 2);
1932 for (reg = 0; reg < AZF_IO_SIZE_CODEC_PM / 2; reg++)
1933 outw(chip->saved_regs_codec[reg], chip->codec_port + reg * 2);
1934
1935 snd_power_change_state(card, SNDRV_CTL_POWER_D0);
1936 return 0;
1937}
1938#endif
1939
1940
1941
1942
1837static struct pci_driver driver = { 1943static struct pci_driver driver = {
1838 .name = "AZF3328", 1944 .name = "AZF3328",
1839 .id_table = snd_azf3328_ids, 1945 .id_table = snd_azf3328_ids,
1840 .probe = snd_azf3328_probe, 1946 .probe = snd_azf3328_probe,
1841 .remove = __devexit_p(snd_azf3328_remove), 1947 .remove = __devexit_p(snd_azf3328_remove),
1948#ifdef CONFIG_PM
1949 .suspend = snd_azf3328_suspend,
1950 .resume = snd_azf3328_resume,
1951#endif
1842}; 1952};
1843 1953
1844static int __init 1954static int __init
diff --git a/sound/pci/azt3328.h b/sound/pci/azt3328.h
index f489bdaf6d40..b4f3e3cd006b 100644
--- a/sound/pci/azt3328.h
+++ b/sound/pci/azt3328.h
@@ -5,6 +5,9 @@
5 5
6/*** main I/O area port indices ***/ 6/*** main I/O area port indices ***/
7/* (only 0x70 of 0x80 bytes saved/restored by Windows driver) */ 7/* (only 0x70 of 0x80 bytes saved/restored by Windows driver) */
8#define AZF_IO_SIZE_CODEC 0x80
9#define AZF_IO_SIZE_CODEC_PM 0x70
10
8/* the driver initialisation suggests a layout of 4 main areas: 11/* the driver initialisation suggests a layout of 4 main areas:
9 * from 0x00 (playback), from 0x20 (recording) and from 0x40 (maybe MPU401??). 12 * from 0x00 (playback), from 0x20 (recording) and from 0x40 (maybe MPU401??).
10 * And another area from 0x60 to 0x6f (DirectX timer, IRQ management, 13 * And another area from 0x60 to 0x6f (DirectX timer, IRQ management,
@@ -87,7 +90,7 @@
87#define IDX_IO_REC_DMA_CURROFS 0x34 /* PU:0x00000000 */ 90#define IDX_IO_REC_DMA_CURROFS 0x34 /* PU:0x00000000 */
88#define IDX_IO_REC_SOUNDFORMAT 0x36 /* PU:0x0000 */ 91#define IDX_IO_REC_SOUNDFORMAT 0x36 /* PU:0x0000 */
89 92
90/** hmm, what is this I/O area for? MPU401?? (after playback, recording, ???, timer) **/ 93/** hmm, what is this I/O area for? MPU401?? or external DAC via I2S?? (after playback, recording, ???, timer) **/
91#define IDX_IO_SOMETHING_FLAGS 0x40 /* gets set to 0x34 just like port 0x0 and 0x20 on card init, PU:0x0000 */ 94#define IDX_IO_SOMETHING_FLAGS 0x40 /* gets set to 0x34 just like port 0x0 and 0x20 on card init, PU:0x0000 */
92/* general */ 95/* general */
93#define IDX_IO_42H 0x42 /* PU:0x0001 */ 96#define IDX_IO_42H 0x42 /* PU:0x0001 */
@@ -107,7 +110,8 @@
107 #define IRQ_UNKNOWN2 0x0080 /* probably unused */ 110 #define IRQ_UNKNOWN2 0x0080 /* probably unused */
108#define IDX_IO_66H 0x66 /* writing 0xffff returns 0x0000 */ 111#define IDX_IO_66H 0x66 /* writing 0xffff returns 0x0000 */
109#define IDX_IO_SOME_VALUE 0x68 /* this is set to e.g. 0x3ff or 0x300, and writable; maybe some buffer limit, but I couldn't find out more, PU:0x00ff */ 112#define IDX_IO_SOME_VALUE 0x68 /* this is set to e.g. 0x3ff or 0x300, and writable; maybe some buffer limit, but I couldn't find out more, PU:0x00ff */
110#define IDX_IO_6AH 0x6A /* this WORD can be set to have bits 0x0028 activated; actually inhibits PCM playback!!! maybe power management?? */ 113#define IDX_IO_6AH 0x6A /* this WORD can be set to have bits 0x0028 activated (FIXME: correct??); actually inhibits PCM playback!!! maybe power management?? */
114 #define IO_6A_PAUSE_PLAYBACK 0x0200 /* bit 9; sure, this pauses playback, but what the heck is this really about?? */
111#define IDX_IO_6CH 0x6C 115#define IDX_IO_6CH 0x6C
112#define IDX_IO_6EH 0x6E /* writing 0xffff returns 0x83fe */ 116#define IDX_IO_6EH 0x6E /* writing 0xffff returns 0x83fe */
113/* further I/O indices not saved/restored, so probably not used */ 117/* further I/O indices not saved/restored, so probably not used */
@@ -115,15 +119,25 @@
115 119
116/*** I/O 2 area port indices ***/ 120/*** I/O 2 area port indices ***/
117/* (only 0x06 of 0x08 bytes saved/restored by Windows driver) */ 121/* (only 0x06 of 0x08 bytes saved/restored by Windows driver) */
122#define AZF_IO_SIZE_IO2 0x08
123#define AZF_IO_SIZE_IO2_PM 0x06
124
118#define IDX_IO2_LEGACY_ADDR 0x04 125#define IDX_IO2_LEGACY_ADDR 0x04
119 #define LEGACY_SOMETHING 0x01 /* OPL3?? */ 126 #define LEGACY_SOMETHING 0x01 /* OPL3?? */
120 #define LEGACY_JOY 0x08 127 #define LEGACY_JOY 0x08
121 128
129#define AZF_IO_SIZE_MPU 0x04
130#define AZF_IO_SIZE_MPU_PM 0x04
131
132#define AZF_IO_SIZE_SYNTH 0x08
133#define AZF_IO_SIZE_SYNTH_PM 0x06
122 134
123/*** mixer I/O area port indices ***/ 135/*** mixer I/O area port indices ***/
124/* (only 0x22 of 0x40 bytes saved/restored by Windows driver) 136/* (only 0x22 of 0x40 bytes saved/restored by Windows driver)
125 * generally spoken: AC97 register index = AZF3328 mixer reg index + 2 137 * UNFORTUNATELY azf3328 is NOT truly AC97 compliant: see main file intro */
126 * (in other words: AZF3328 NOT fully AC97 compliant) */ 138#define AZF_IO_SIZE_MIXER 0x40
139#define AZF_IO_SIZE_MIXER_PM 0x22
140
127 #define MIXER_VOLUME_RIGHT_MASK 0x001f 141 #define MIXER_VOLUME_RIGHT_MASK 0x001f
128 #define MIXER_VOLUME_LEFT_MASK 0x1f00 142 #define MIXER_VOLUME_LEFT_MASK 0x1f00
129 #define MIXER_MUTE_MASK 0x8000 143 #define MIXER_MUTE_MASK 0x8000
@@ -156,14 +170,14 @@
156#define IDX_MIXER_ADVCTL1 0x1e 170#define IDX_MIXER_ADVCTL1 0x1e
157 /* unlisted bits are unmodifiable */ 171 /* unlisted bits are unmodifiable */
158 #define MIXER_ADVCTL1_3DWIDTH_MASK 0x000e 172 #define MIXER_ADVCTL1_3DWIDTH_MASK 0x000e
159 #define MIXER_ADVCTL1_HIFI3D_MASK 0x0300 173 #define MIXER_ADVCTL1_HIFI3D_MASK 0x0300 /* yup, this is missing the high bit that official AC97 contains, plus it doesn't have linear bit value range behaviour but instead acts weirdly (possibly we're dealing with two *different* 3D settings here??) */
160#define IDX_MIXER_ADVCTL2 0x20 /* resembles AC97_GENERAL_PURPOSE reg! */ 174#define IDX_MIXER_ADVCTL2 0x20 /* subset of AC97_GENERAL_PURPOSE reg! */
161 /* unlisted bits are unmodifiable */ 175 /* unlisted bits are unmodifiable */
162 #define MIXER_ADVCTL2_BIT7 0x0080 /* WaveOut 3D Bypass? mutes WaveOut at LineOut */ 176 #define MIXER_ADVCTL2_LPBK 0x0080 /* Loopback mode -- Win driver: "WaveOut3DBypass"? mutes WaveOut at LineOut */
163 #define MIXER_ADVCTL2_BIT8 0x0100 /* is this Modem Out Select? */ 177 #define MIXER_ADVCTL2_MS 0x0100 /* Mic Select 0=Mic1, 1=Mic2 -- Win driver: "ModemOutSelect"?? */
164 #define MIXER_ADVCTL2_BIT9 0x0200 /* Mono Select Source? */ 178 #define MIXER_ADVCTL2_MIX 0x0200 /* Mono output select 0=Mix, 1=Mic; Win driver: "MonoSelectSource"?? */
165 #define MIXER_ADVCTL2_BIT13 0x2000 /* 3D enable? */ 179 #define MIXER_ADVCTL2_3D 0x2000 /* 3D Enhancement 1=on */
166 #define MIXER_ADVCTL2_BIT15 0x8000 /* unknown */ 180 #define MIXER_ADVCTL2_POP 0x8000 /* Pcm Out Path, 0=pre 3D, 1=post 3D */
167 181
168#define IDX_MIXER_SOMETHING30H 0x30 /* used, but unknown??? */ 182#define IDX_MIXER_SOMETHING30H 0x30 /* used, but unknown??? */
169 183
diff --git a/sound/pci/bt87x.c b/sound/pci/bt87x.c
index 9ee07d4aac1e..c33642d8d9a1 100644
--- a/sound/pci/bt87x.c
+++ b/sound/pci/bt87x.c
@@ -44,7 +44,7 @@ MODULE_SUPPORTED_DEVICE("{{Brooktree,Bt878},"
44static int index[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = -2}; /* Exclude the first card */ 44static int index[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = -2}; /* Exclude the first card */
45static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ 45static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
46static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */ 46static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */
47static int digital_rate[SNDRV_CARDS] = { [0 ... (SNDRV_CARDS-1)] = 0 }; /* digital input rate */ 47static int digital_rate[SNDRV_CARDS]; /* digital input rate */
48static int load_all; /* allow to load the non-whitelisted cards */ 48static int load_all; /* allow to load the non-whitelisted cards */
49 49
50module_param_array(index, int, NULL, 0444); 50module_param_array(index, int, NULL, 0444);
@@ -781,10 +781,12 @@ static struct pci_device_id snd_bt87x_ids[] __devinitdata = {
781 BT_DEVICE(PCI_DEVICE_ID_BROOKTREE_879, 0x0070, 0x13eb, 32000), 781 BT_DEVICE(PCI_DEVICE_ID_BROOKTREE_879, 0x0070, 0x13eb, 32000),
782 /* Viewcast Osprey 200 */ 782 /* Viewcast Osprey 200 */
783 BT_DEVICE(PCI_DEVICE_ID_BROOKTREE_878, 0x0070, 0xff01, 44100), 783 BT_DEVICE(PCI_DEVICE_ID_BROOKTREE_878, 0x0070, 0xff01, 44100),
784 /* AVerMedia Studio No. 103, 203, ...? */
785 BT_DEVICE(PCI_DEVICE_ID_BROOKTREE_878, 0x1461, 0x0003, 48000),
786 /* Leadtek Winfast tv 2000xp delux */ 784 /* Leadtek Winfast tv 2000xp delux */
787 BT_DEVICE(PCI_DEVICE_ID_BROOKTREE_878, 0x107d, 0x6606, 32000), 785 BT_DEVICE(PCI_DEVICE_ID_BROOKTREE_878, 0x107d, 0x6606, 32000),
786 /* Voodoo TV 200 */
787 BT_DEVICE(PCI_DEVICE_ID_BROOKTREE_878, 0x121a, 0x3000, 32000),
788 /* AVerMedia Studio No. 103, 203, ...? */
789 BT_DEVICE(PCI_DEVICE_ID_BROOKTREE_878, 0x1461, 0x0003, 48000),
788 { } 790 { }
789}; 791};
790MODULE_DEVICE_TABLE(pci, snd_bt87x_ids); 792MODULE_DEVICE_TABLE(pci, snd_bt87x_ids);
diff --git a/sound/pci/ca0106/ca0106.h b/sound/pci/ca0106/ca0106.h
index c8131ea92ed6..9cb66c59f523 100644
--- a/sound/pci/ca0106/ca0106.h
+++ b/sound/pci/ca0106/ca0106.h
@@ -537,9 +537,9 @@
537#endif 537#endif
538 538
539#define ADC_MUX_MASK 0x0000000f //Mask for ADC Mux 539#define ADC_MUX_MASK 0x0000000f //Mask for ADC Mux
540#define ADC_MUX_PHONE 0x00000001 //Value to select TAD at ADC Mux (Not used)
540#define ADC_MUX_MIC 0x00000002 //Value to select Mic at ADC Mux 541#define ADC_MUX_MIC 0x00000002 //Value to select Mic at ADC Mux
541#define ADC_MUX_LINEIN 0x00000004 //Value to select LineIn at ADC Mux 542#define ADC_MUX_LINEIN 0x00000004 //Value to select LineIn at ADC Mux
542#define ADC_MUX_PHONE 0x00000001 //Value to select TAD at ADC Mux (Not used)
543#define ADC_MUX_AUX 0x00000008 //Value to select Aux at ADC Mux 543#define ADC_MUX_AUX 0x00000008 //Value to select Aux at ADC Mux
544 544
545#define SET_CHANNEL 0 /* Testing channel outputs 0=Front, 1=Center/LFE, 2=Unknown, 3=Rear */ 545#define SET_CHANNEL 0 /* Testing channel outputs 0=Front, 1=Center/LFE, 2=Unknown, 3=Rear */
@@ -604,6 +604,8 @@ struct snd_ca0106 {
604 u32 spdif_bits[4]; /* s/pdif out setup */ 604 u32 spdif_bits[4]; /* s/pdif out setup */
605 int spdif_enable; 605 int spdif_enable;
606 int capture_source; 606 int capture_source;
607 int i2c_capture_source;
608 u8 i2c_capture_volume[4][2];
607 int capture_mic_line_in; 609 int capture_mic_line_in;
608 610
609 struct snd_dma_buffer buffer; 611 struct snd_dma_buffer buffer;
diff --git a/sound/pci/ca0106/ca0106_main.c b/sound/pci/ca0106/ca0106_main.c
index fd8bfebfbd54..59bf9bd02534 100644
--- a/sound/pci/ca0106/ca0106_main.c
+++ b/sound/pci/ca0106/ca0106_main.c
@@ -186,8 +186,8 @@ static struct snd_ca0106_details ca0106_chip_details[] = {
186 /* New Audigy SE. Has a different DAC. */ 186 /* New Audigy SE. Has a different DAC. */
187 /* SB0570: 187 /* SB0570:
188 * CTRL:CA0106-DAT 188 * CTRL:CA0106-DAT
189 * ADC: WM8768GEDS 189 * ADC: WM8775EDS
190 * DAC: WM8775EDS 190 * DAC: WM8768GEDS
191 */ 191 */
192 { .serial = 0x100a1102, 192 { .serial = 0x100a1102,
193 .name = "Audigy SE [SB0570]", 193 .name = "Audigy SE [SB0570]",
@@ -195,9 +195,14 @@ static struct snd_ca0106_details ca0106_chip_details[] = {
195 .i2c_adc = 1, 195 .i2c_adc = 1,
196 .spi_dac = 1 } , 196 .spi_dac = 1 } ,
197 /* MSI K8N Diamond Motherboard with onboard SB Live 24bit without AC97 */ 197 /* MSI K8N Diamond Motherboard with onboard SB Live 24bit without AC97 */
198 /* SB0438
199 * CTRL:CA0106-DAT
200 * ADC: WM8775SEDS
201 * DAC: CS4382-KQZ
202 */
198 { .serial = 0x10091462, 203 { .serial = 0x10091462,
199 .name = "MSI K8N Diamond MB [SB0438]", 204 .name = "MSI K8N Diamond MB [SB0438]",
200 .gpio_type = 1, 205 .gpio_type = 2,
201 .i2c_adc = 1 } , 206 .i2c_adc = 1 } ,
202 /* Shuttle XPC SD31P which has an onboard Creative Labs 207 /* Shuttle XPC SD31P which has an onboard Creative Labs
203 * Sound Blaster Live! 24-bit EAX 208 * Sound Blaster Live! 24-bit EAX
@@ -326,6 +331,7 @@ int snd_ca0106_spi_write(struct snd_ca0106 * emu,
326 return 0; 331 return 0;
327} 332}
328 333
334/* The ADC does not support i2c read, so only write is implemented */
329int snd_ca0106_i2c_write(struct snd_ca0106 *emu, 335int snd_ca0106_i2c_write(struct snd_ca0106 *emu,
330 u32 reg, 336 u32 reg,
331 u32 value) 337 u32 value)
@@ -340,6 +346,7 @@ int snd_ca0106_i2c_write(struct snd_ca0106 *emu,
340 } 346 }
341 347
342 tmp = reg << 25 | value << 16; 348 tmp = reg << 25 | value << 16;
349 // snd_printk("I2C-write:reg=0x%x, value=0x%x\n", reg, value);
343 /* Not sure what this I2C channel controls. */ 350 /* Not sure what this I2C channel controls. */
344 /* snd_ca0106_ptr_write(emu, I2C_D0, 0, tmp); */ 351 /* snd_ca0106_ptr_write(emu, I2C_D0, 0, tmp); */
345 352
@@ -348,8 +355,9 @@ int snd_ca0106_i2c_write(struct snd_ca0106 *emu,
348 355
349 for (retry = 0; retry < 10; retry++) { 356 for (retry = 0; retry < 10; retry++) {
350 /* Send the data to i2c */ 357 /* Send the data to i2c */
351 tmp = snd_ca0106_ptr_read(emu, I2C_A, 0); 358 //tmp = snd_ca0106_ptr_read(emu, I2C_A, 0);
352 tmp = tmp & ~(I2C_A_ADC_READ|I2C_A_ADC_LAST|I2C_A_ADC_START|I2C_A_ADC_ADD_MASK); 359 //tmp = tmp & ~(I2C_A_ADC_READ|I2C_A_ADC_LAST|I2C_A_ADC_START|I2C_A_ADC_ADD_MASK);
360 tmp = 0;
353 tmp = tmp | (I2C_A_ADC_LAST|I2C_A_ADC_START|I2C_A_ADC_ADD); 361 tmp = tmp | (I2C_A_ADC_LAST|I2C_A_ADC_START|I2C_A_ADC_ADD);
354 snd_ca0106_ptr_write(emu, I2C_A, 0, tmp); 362 snd_ca0106_ptr_write(emu, I2C_A, 0, tmp);
355 363
@@ -1181,7 +1189,7 @@ static unsigned int spi_dac_init[] = {
1181 0x02ff, 1189 0x02ff,
1182 0x0400, 1190 0x0400,
1183 0x0520, 1191 0x0520,
1184 0x0600, 1192 0x0620, /* Set 24 bit. Was 0x0600 */
1185 0x08ff, 1193 0x08ff,
1186 0x0aff, 1194 0x0aff,
1187 0x0cff, 1195 0x0cff,
@@ -1200,6 +1208,22 @@ static unsigned int spi_dac_init[] = {
1200 0x1400, 1208 0x1400,
1201}; 1209};
1202 1210
1211static unsigned int i2c_adc_init[][2] = {
1212 { 0x17, 0x00 }, /* Reset */
1213 { 0x07, 0x00 }, /* Timeout */
1214 { 0x0b, 0x22 }, /* Interface control */
1215 { 0x0c, 0x22 }, /* Master mode control */
1216 { 0x0d, 0x08 }, /* Powerdown control */
1217 { 0x0e, 0xcf }, /* Attenuation Left 0x01 = -103dB, 0xff = 24dB */
1218 { 0x0f, 0xcf }, /* Attenuation Right 0.5dB steps */
1219 { 0x10, 0x7b }, /* ALC Control 1 */
1220 { 0x11, 0x00 }, /* ALC Control 2 */
1221 { 0x12, 0x32 }, /* ALC Control 3 */
1222 { 0x13, 0x00 }, /* Noise gate control */
1223 { 0x14, 0xa6 }, /* Limiter control */
1224 { 0x15, ADC_MUX_LINEIN }, /* ADC Mixer control */
1225};
1226
1203static int __devinit snd_ca0106_create(struct snd_card *card, 1227static int __devinit snd_ca0106_create(struct snd_card *card,
1204 struct pci_dev *pci, 1228 struct pci_dev *pci,
1205 struct snd_ca0106 **rchip) 1229 struct snd_ca0106 **rchip)
@@ -1361,7 +1385,12 @@ static int __devinit snd_ca0106_create(struct snd_card *card,
1361 snd_ca0106_ptr_write(chip, CAPTURE_SOURCE, 0x0, 0x333300e4); /* Select MIC, Line in, TAD in, AUX in */ 1385 snd_ca0106_ptr_write(chip, CAPTURE_SOURCE, 0x0, 0x333300e4); /* Select MIC, Line in, TAD in, AUX in */
1362 chip->capture_source = 3; /* Set CAPTURE_SOURCE */ 1386 chip->capture_source = 3; /* Set CAPTURE_SOURCE */
1363 1387
1364 if (chip->details->gpio_type == 1) { /* The SB0410 and SB0413 use GPIO differently. */ 1388 if (chip->details->gpio_type == 2) { /* The SB0438 use GPIO differently. */
1389 /* FIXME: Still need to find out what the other GPIO bits do. E.g. For digital spdif out. */
1390 outl(0x0, chip->port+GPIO);
1391 //outl(0x00f0e000, chip->port+GPIO); /* Analog */
1392 outl(0x005f5301, chip->port+GPIO); /* Analog */
1393 } else if (chip->details->gpio_type == 1) { /* The SB0410 and SB0413 use GPIO differently. */
1365 /* FIXME: Still need to find out what the other GPIO bits do. E.g. For digital spdif out. */ 1394 /* FIXME: Still need to find out what the other GPIO bits do. E.g. For digital spdif out. */
1366 outl(0x0, chip->port+GPIO); 1395 outl(0x0, chip->port+GPIO);
1367 //outl(0x00f0e000, chip->port+GPIO); /* Analog */ 1396 //outl(0x00f0e000, chip->port+GPIO); /* Analog */
@@ -1379,7 +1408,19 @@ static int __devinit snd_ca0106_create(struct snd_card *card,
1379 outl(HCFG_AC97 | HCFG_AUDIOENABLE, chip->port+HCFG); /* AC97 2.0, Enable outputs. */ 1408 outl(HCFG_AC97 | HCFG_AUDIOENABLE, chip->port+HCFG); /* AC97 2.0, Enable outputs. */
1380 1409
1381 if (chip->details->i2c_adc == 1) { /* The SB0410 and SB0413 use I2C to control ADC. */ 1410 if (chip->details->i2c_adc == 1) { /* The SB0410 and SB0413 use I2C to control ADC. */
1382 snd_ca0106_i2c_write(chip, ADC_MUX, ADC_MUX_LINEIN); /* Enable Line-in capture. MIC in currently untested. */ 1411 int size, n;
1412
1413 size = ARRAY_SIZE(i2c_adc_init);
1414 //snd_printk("I2C:array size=0x%x\n", size);
1415 for (n=0; n < size; n++) {
1416 snd_ca0106_i2c_write(chip, i2c_adc_init[n][0], i2c_adc_init[n][1]);
1417 }
1418 for (n=0; n < 4; n++) {
1419 chip->i2c_capture_volume[n][0]= 0xcf;
1420 chip->i2c_capture_volume[n][1]= 0xcf;
1421 }
1422 chip->i2c_capture_source=2; /* Line in */
1423 //snd_ca0106_i2c_write(chip, ADC_MUX, ADC_MUX_LINEIN); /* Enable Line-in capture. MIC in currently untested. */
1383 } 1424 }
1384 if (chip->details->spi_dac == 1) { /* The SB0570 use SPI to control DAC. */ 1425 if (chip->details->spi_dac == 1) { /* The SB0570 use SPI to control DAC. */
1385 int size, n; 1426 int size, n;
diff --git a/sound/pci/ca0106/ca0106_mixer.c b/sound/pci/ca0106/ca0106_mixer.c
index 06fe055674fb..146eed70dce6 100644
--- a/sound/pci/ca0106/ca0106_mixer.c
+++ b/sound/pci/ca0106/ca0106_mixer.c
@@ -171,6 +171,76 @@ static int snd_ca0106_capture_source_put(struct snd_kcontrol *kcontrol,
171 return change; 171 return change;
172} 172}
173 173
174static int snd_ca0106_i2c_capture_source_info(struct snd_kcontrol *kcontrol,
175 struct snd_ctl_elem_info *uinfo)
176{
177 static char *texts[6] = {
178 "Phone", "Mic", "Line in", "Aux"
179 };
180
181 uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
182 uinfo->count = 1;
183 uinfo->value.enumerated.items = 4;
184 if (uinfo->value.enumerated.item > 3)
185 uinfo->value.enumerated.item = 3;
186 strcpy(uinfo->value.enumerated.name, texts[uinfo->value.enumerated.item]);
187 return 0;
188}
189
190static int snd_ca0106_i2c_capture_source_get(struct snd_kcontrol *kcontrol,
191 struct snd_ctl_elem_value *ucontrol)
192{
193 struct snd_ca0106 *emu = snd_kcontrol_chip(kcontrol);
194
195 ucontrol->value.enumerated.item[0] = emu->i2c_capture_source;
196 return 0;
197}
198
199static int snd_ca0106_i2c_capture_source_put(struct snd_kcontrol *kcontrol,
200 struct snd_ctl_elem_value *ucontrol)
201{
202 struct snd_ca0106 *emu = snd_kcontrol_chip(kcontrol);
203 unsigned int source_id;
204 unsigned int ngain, ogain;
205 int change = 0;
206 u32 source;
207 /* If the capture source has changed,
208 * update the capture volume from the cached value
209 * for the particular source.
210 */
211 source_id = ucontrol->value.enumerated.item[0] ;
212 change = (emu->i2c_capture_source != source_id);
213 if (change) {
214 snd_ca0106_i2c_write(emu, ADC_MUX, 0); /* Mute input */
215 ngain = emu->i2c_capture_volume[source_id][0]; /* Left */
216 ogain = emu->i2c_capture_volume[emu->i2c_capture_source][0]; /* Left */
217 if (ngain != ogain)
218 snd_ca0106_i2c_write(emu, ADC_ATTEN_ADCL, ((ngain) & 0xff));
219 ngain = emu->i2c_capture_volume[source_id][1]; /* Left */
220 ogain = emu->i2c_capture_volume[emu->i2c_capture_source][1]; /* Left */
221 if (ngain != ogain)
222 snd_ca0106_i2c_write(emu, ADC_ATTEN_ADCR, ((ngain) & 0xff));
223 source = 1 << source_id;
224 snd_ca0106_i2c_write(emu, ADC_MUX, source); /* Set source */
225 emu->i2c_capture_source = source_id;
226 }
227 return change;
228}
229
230static int snd_ca0106_capture_line_in_side_out_info(struct snd_kcontrol *kcontrol,
231 struct snd_ctl_elem_info *uinfo)
232{
233 static char *texts[2] = { "Side out", "Line in" };
234
235 uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
236 uinfo->count = 1;
237 uinfo->value.enumerated.items = 2;
238 if (uinfo->value.enumerated.item > 1)
239 uinfo->value.enumerated.item = 1;
240 strcpy(uinfo->value.enumerated.name, texts[uinfo->value.enumerated.item]);
241 return 0;
242}
243
174static int snd_ca0106_capture_mic_line_in_info(struct snd_kcontrol *kcontrol, 244static int snd_ca0106_capture_mic_line_in_info(struct snd_kcontrol *kcontrol,
175 struct snd_ctl_elem_info *uinfo) 245 struct snd_ctl_elem_info *uinfo)
176{ 246{
@@ -207,16 +277,16 @@ static int snd_ca0106_capture_mic_line_in_put(struct snd_kcontrol *kcontrol,
207 if (change) { 277 if (change) {
208 emu->capture_mic_line_in = val; 278 emu->capture_mic_line_in = val;
209 if (val) { 279 if (val) {
210 snd_ca0106_i2c_write(emu, ADC_MUX, ADC_MUX_PHONE); /* Mute input */ 280 //snd_ca0106_i2c_write(emu, ADC_MUX, 0); /* Mute input */
211 tmp = inl(emu->port+GPIO) & ~0x400; 281 tmp = inl(emu->port+GPIO) & ~0x400;
212 tmp = tmp | 0x400; 282 tmp = tmp | 0x400;
213 outl(tmp, emu->port+GPIO); 283 outl(tmp, emu->port+GPIO);
214 snd_ca0106_i2c_write(emu, ADC_MUX, ADC_MUX_MIC); 284 //snd_ca0106_i2c_write(emu, ADC_MUX, ADC_MUX_MIC);
215 } else { 285 } else {
216 snd_ca0106_i2c_write(emu, ADC_MUX, ADC_MUX_PHONE); /* Mute input */ 286 //snd_ca0106_i2c_write(emu, ADC_MUX, 0); /* Mute input */
217 tmp = inl(emu->port+GPIO) & ~0x400; 287 tmp = inl(emu->port+GPIO) & ~0x400;
218 outl(tmp, emu->port+GPIO); 288 outl(tmp, emu->port+GPIO);
219 snd_ca0106_i2c_write(emu, ADC_MUX, ADC_MUX_LINEIN); 289 //snd_ca0106_i2c_write(emu, ADC_MUX, ADC_MUX_LINEIN);
220 } 290 }
221 } 291 }
222 return change; 292 return change;
@@ -225,12 +295,22 @@ static int snd_ca0106_capture_mic_line_in_put(struct snd_kcontrol *kcontrol,
225static struct snd_kcontrol_new snd_ca0106_capture_mic_line_in __devinitdata = 295static struct snd_kcontrol_new snd_ca0106_capture_mic_line_in __devinitdata =
226{ 296{
227 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 297 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
228 .name = "Mic/Line in Capture", 298 .name = "Shared Mic/Line in Capture Switch",
229 .info = snd_ca0106_capture_mic_line_in_info, 299 .info = snd_ca0106_capture_mic_line_in_info,
230 .get = snd_ca0106_capture_mic_line_in_get, 300 .get = snd_ca0106_capture_mic_line_in_get,
231 .put = snd_ca0106_capture_mic_line_in_put 301 .put = snd_ca0106_capture_mic_line_in_put
232}; 302};
233 303
304static struct snd_kcontrol_new snd_ca0106_capture_line_in_side_out __devinitdata =
305{
306 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
307 .name = "Shared Line in/Side out Capture Switch",
308 .info = snd_ca0106_capture_line_in_side_out_info,
309 .get = snd_ca0106_capture_mic_line_in_get,
310 .put = snd_ca0106_capture_mic_line_in_put
311};
312
313
234static int snd_ca0106_spdif_info(struct snd_kcontrol *kcontrol, 314static int snd_ca0106_spdif_info(struct snd_kcontrol *kcontrol,
235 struct snd_ctl_elem_info *uinfo) 315 struct snd_ctl_elem_info *uinfo)
236{ 316{
@@ -329,15 +409,81 @@ static int snd_ca0106_volume_put(struct snd_kcontrol *kcontrol,
329 return 1; 409 return 1;
330} 410}
331 411
412static int snd_ca0106_i2c_volume_info(struct snd_kcontrol *kcontrol,
413 struct snd_ctl_elem_info *uinfo)
414{
415 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
416 uinfo->count = 2;
417 uinfo->value.integer.min = 0;
418 uinfo->value.integer.max = 255;
419 return 0;
420}
421
422static int snd_ca0106_i2c_volume_get(struct snd_kcontrol *kcontrol,
423 struct snd_ctl_elem_value *ucontrol)
424{
425 struct snd_ca0106 *emu = snd_kcontrol_chip(kcontrol);
426 int source_id;
427
428 source_id = kcontrol->private_value;
429
430 ucontrol->value.integer.value[0] = emu->i2c_capture_volume[source_id][0];
431 ucontrol->value.integer.value[1] = emu->i2c_capture_volume[source_id][1];
432 return 0;
433}
434
435static int snd_ca0106_i2c_volume_put(struct snd_kcontrol *kcontrol,
436 struct snd_ctl_elem_value *ucontrol)
437{
438 struct snd_ca0106 *emu = snd_kcontrol_chip(kcontrol);
439 unsigned int ogain;
440 unsigned int ngain;
441 int source_id;
442 int change = 0;
443
444 source_id = kcontrol->private_value;
445 ogain = emu->i2c_capture_volume[source_id][0]; /* Left */
446 ngain = ucontrol->value.integer.value[0];
447 if (ngain > 0xff)
448 return 0;
449 if (ogain != ngain) {
450 if (emu->i2c_capture_source == source_id)
451 snd_ca0106_i2c_write(emu, ADC_ATTEN_ADCL, ((ngain) & 0xff) );
452 emu->i2c_capture_volume[source_id][0] = ucontrol->value.integer.value[0];
453 change = 1;
454 }
455 ogain = emu->i2c_capture_volume[source_id][1]; /* Right */
456 ngain = ucontrol->value.integer.value[1];
457 if (ngain > 0xff)
458 return 0;
459 if (ogain != ngain) {
460 if (emu->i2c_capture_source == source_id)
461 snd_ca0106_i2c_write(emu, ADC_ATTEN_ADCR, ((ngain) & 0xff));
462 emu->i2c_capture_volume[source_id][1] = ucontrol->value.integer.value[1];
463 change = 1;
464 }
465
466 return change;
467}
468
332#define CA_VOLUME(xname,chid,reg) \ 469#define CA_VOLUME(xname,chid,reg) \
333{ \ 470{ \
334 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ 471 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
335 .info = snd_ca0106_volume_info, \ 472 .info = snd_ca0106_volume_info, \
336 .get = snd_ca0106_volume_get, \ 473 .get = snd_ca0106_volume_get, \
337 .put = snd_ca0106_volume_put, \ 474 .put = snd_ca0106_volume_put, \
338 .private_value = ((chid) << 8) | (reg) \ 475 .private_value = ((chid) << 8) | (reg) \
339} 476}
340 477
478#define I2C_VOLUME(xname,chid) \
479{ \
480 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
481 .info = snd_ca0106_i2c_volume_info, \
482 .get = snd_ca0106_i2c_volume_get, \
483 .put = snd_ca0106_i2c_volume_put, \
484 .private_value = chid \
485}
486
341 487
342static struct snd_kcontrol_new snd_ca0106_volume_ctls[] __devinitdata = { 488static struct snd_kcontrol_new snd_ca0106_volume_ctls[] __devinitdata = {
343 CA_VOLUME("Analog Front Playback Volume", 489 CA_VOLUME("Analog Front Playback Volume",
@@ -361,6 +507,11 @@ static struct snd_kcontrol_new snd_ca0106_volume_ctls[] __devinitdata = {
361 CA_VOLUME("CAPTURE feedback Playback Volume", 507 CA_VOLUME("CAPTURE feedback Playback Volume",
362 1, CAPTURE_CONTROL), 508 1, CAPTURE_CONTROL),
363 509
510 I2C_VOLUME("Phone Capture Volume", 0),
511 I2C_VOLUME("Mic Capture Volume", 1),
512 I2C_VOLUME("Line in Capture Volume", 2),
513 I2C_VOLUME("Aux Capture Volume", 3),
514
364 { 515 {
365 .access = SNDRV_CTL_ELEM_ACCESS_READ, 516 .access = SNDRV_CTL_ELEM_ACCESS_READ,
366 .iface = SNDRV_CTL_ELEM_IFACE_PCM, 517 .iface = SNDRV_CTL_ELEM_IFACE_PCM,
@@ -378,12 +529,19 @@ static struct snd_kcontrol_new snd_ca0106_volume_ctls[] __devinitdata = {
378 }, 529 },
379 { 530 {
380 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 531 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
381 .name = "Capture Source", 532 .name = "Digital Capture Source",
382 .info = snd_ca0106_capture_source_info, 533 .info = snd_ca0106_capture_source_info,
383 .get = snd_ca0106_capture_source_get, 534 .get = snd_ca0106_capture_source_get,
384 .put = snd_ca0106_capture_source_put 535 .put = snd_ca0106_capture_source_put
385 }, 536 },
386 { 537 {
538 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
539 .name = "Capture Source",
540 .info = snd_ca0106_i2c_capture_source_info,
541 .get = snd_ca0106_i2c_capture_source_get,
542 .put = snd_ca0106_i2c_capture_source_put
543 },
544 {
387 .iface = SNDRV_CTL_ELEM_IFACE_PCM, 545 .iface = SNDRV_CTL_ELEM_IFACE_PCM,
388 .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,DEFAULT), 546 .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,DEFAULT),
389 .count = 4, 547 .count = 4,
@@ -477,7 +635,10 @@ int __devinit snd_ca0106_mixer(struct snd_ca0106 *emu)
477 return err; 635 return err;
478 } 636 }
479 if (emu->details->i2c_adc == 1) { 637 if (emu->details->i2c_adc == 1) {
480 err = snd_ctl_add(card, snd_ctl_new1(&snd_ca0106_capture_mic_line_in, emu)); 638 if (emu->details->gpio_type == 1)
639 err = snd_ctl_add(card, snd_ctl_new1(&snd_ca0106_capture_mic_line_in, emu));
640 else /* gpio_type == 2 */
641 err = snd_ctl_add(card, snd_ctl_new1(&snd_ca0106_capture_line_in_side_out, emu));
481 if (err < 0) 642 if (err < 0)
482 return err; 643 return err;
483 } 644 }
diff --git a/sound/pci/ca0106/ca0106_proc.c b/sound/pci/ca0106/ca0106_proc.c
index 63757273bfb7..75ca421eb3a1 100644
--- a/sound/pci/ca0106/ca0106_proc.c
+++ b/sound/pci/ca0106/ca0106_proc.c
@@ -431,33 +431,30 @@ int __devinit snd_ca0106_proc_init(struct snd_ca0106 * emu)
431 struct snd_info_entry *entry; 431 struct snd_info_entry *entry;
432 432
433 if(! snd_card_proc_new(emu->card, "iec958", &entry)) 433 if(! snd_card_proc_new(emu->card, "iec958", &entry))
434 snd_info_set_text_ops(entry, emu, 1024, snd_ca0106_proc_iec958); 434 snd_info_set_text_ops(entry, emu, snd_ca0106_proc_iec958);
435 if(! snd_card_proc_new(emu->card, "ca0106_reg32", &entry)) { 435 if(! snd_card_proc_new(emu->card, "ca0106_reg32", &entry)) {
436 snd_info_set_text_ops(entry, emu, 1024, snd_ca0106_proc_reg_read32); 436 snd_info_set_text_ops(entry, emu, snd_ca0106_proc_reg_read32);
437 entry->c.text.write_size = 64;
438 entry->c.text.write = snd_ca0106_proc_reg_write32; 437 entry->c.text.write = snd_ca0106_proc_reg_write32;
439 entry->mode |= S_IWUSR; 438 entry->mode |= S_IWUSR;
440 } 439 }
441 if(! snd_card_proc_new(emu->card, "ca0106_reg16", &entry)) 440 if(! snd_card_proc_new(emu->card, "ca0106_reg16", &entry))
442 snd_info_set_text_ops(entry, emu, 1024, snd_ca0106_proc_reg_read16); 441 snd_info_set_text_ops(entry, emu, snd_ca0106_proc_reg_read16);
443 if(! snd_card_proc_new(emu->card, "ca0106_reg8", &entry)) 442 if(! snd_card_proc_new(emu->card, "ca0106_reg8", &entry))
444 snd_info_set_text_ops(entry, emu, 1024, snd_ca0106_proc_reg_read8); 443 snd_info_set_text_ops(entry, emu, snd_ca0106_proc_reg_read8);
445 if(! snd_card_proc_new(emu->card, "ca0106_regs1", &entry)) { 444 if(! snd_card_proc_new(emu->card, "ca0106_regs1", &entry)) {
446 snd_info_set_text_ops(entry, emu, 1024, snd_ca0106_proc_reg_read1); 445 snd_info_set_text_ops(entry, emu, snd_ca0106_proc_reg_read1);
447 entry->c.text.write_size = 64;
448 entry->c.text.write = snd_ca0106_proc_reg_write; 446 entry->c.text.write = snd_ca0106_proc_reg_write;
449 entry->mode |= S_IWUSR; 447 entry->mode |= S_IWUSR;
450// entry->private_data = emu; 448// entry->private_data = emu;
451 } 449 }
452 if(! snd_card_proc_new(emu->card, "ca0106_i2c", &entry)) { 450 if(! snd_card_proc_new(emu->card, "ca0106_i2c", &entry)) {
453 snd_info_set_text_ops(entry, emu, 1024, snd_ca0106_proc_i2c_write); 451 snd_info_set_text_ops(entry, emu, snd_ca0106_proc_i2c_write);
454 entry->c.text.write_size = 64;
455 entry->c.text.write = snd_ca0106_proc_i2c_write; 452 entry->c.text.write = snd_ca0106_proc_i2c_write;
456 entry->mode |= S_IWUSR; 453 entry->mode |= S_IWUSR;
457// entry->private_data = emu; 454// entry->private_data = emu;
458 } 455 }
459 if(! snd_card_proc_new(emu->card, "ca0106_regs2", &entry)) 456 if(! snd_card_proc_new(emu->card, "ca0106_regs2", &entry))
460 snd_info_set_text_ops(entry, emu, 1024, snd_ca0106_proc_reg_read2); 457 snd_info_set_text_ops(entry, emu, snd_ca0106_proc_reg_read2);
461 return 0; 458 return 0;
462} 459}
463 460
diff --git a/sound/pci/cmipci.c b/sound/pci/cmipci.c
index e5ce2dabd081..0938c158b5c9 100644
--- a/sound/pci/cmipci.c
+++ b/sound/pci/cmipci.c
@@ -2121,7 +2121,7 @@ static struct snd_kcontrol_new snd_cmipci_mixers[] __devinitdata = {
2121 CMIPCI_MIXER_VOL_MONO("Mic Capture Volume", CM_REG_MIXER2, CM_VADMIC_SHIFT, 7), 2121 CMIPCI_MIXER_VOL_MONO("Mic Capture Volume", CM_REG_MIXER2, CM_VADMIC_SHIFT, 7),
2122 CMIPCI_SB_VOL_MONO("Phone Playback Volume", CM_REG_EXTENT_IND, 5, 7), 2122 CMIPCI_SB_VOL_MONO("Phone Playback Volume", CM_REG_EXTENT_IND, 5, 7),
2123 CMIPCI_DOUBLE("Phone Playback Switch", CM_REG_EXTENT_IND, CM_REG_EXTENT_IND, 4, 4, 1, 0, 0), 2123 CMIPCI_DOUBLE("Phone Playback Switch", CM_REG_EXTENT_IND, CM_REG_EXTENT_IND, 4, 4, 1, 0, 0),
2124 CMIPCI_DOUBLE("PC Speaker Playnack Switch", CM_REG_EXTENT_IND, CM_REG_EXTENT_IND, 3, 3, 1, 0, 0), 2124 CMIPCI_DOUBLE("PC Speaker Playback Switch", CM_REG_EXTENT_IND, CM_REG_EXTENT_IND, 3, 3, 1, 0, 0),
2125 CMIPCI_DOUBLE("Mic Boost Capture Switch", CM_REG_EXTENT_IND, CM_REG_EXTENT_IND, 0, 0, 1, 0, 0), 2125 CMIPCI_DOUBLE("Mic Boost Capture Switch", CM_REG_EXTENT_IND, CM_REG_EXTENT_IND, 0, 0, 1, 0, 0),
2126}; 2126};
2127 2127
@@ -2602,7 +2602,7 @@ static void __devinit snd_cmipci_proc_init(struct cmipci *cm)
2602 struct snd_info_entry *entry; 2602 struct snd_info_entry *entry;
2603 2603
2604 if (! snd_card_proc_new(cm->card, "cmipci", &entry)) 2604 if (! snd_card_proc_new(cm->card, "cmipci", &entry))
2605 snd_info_set_text_ops(entry, cm, 1024, snd_cmipci_proc_read); 2605 snd_info_set_text_ops(entry, cm, snd_cmipci_proc_read);
2606} 2606}
2607#else /* !CONFIG_PROC_FS */ 2607#else /* !CONFIG_PROC_FS */
2608static inline void snd_cmipci_proc_init(struct cmipci *cm) {} 2608static inline void snd_cmipci_proc_init(struct cmipci *cm) {}
@@ -2932,7 +2932,7 @@ static int __devinit snd_cmipci_create(struct snd_card *card, struct pci_dev *pc
2932 } 2932 }
2933 2933
2934 integrated_midi = snd_cmipci_read_b(cm, CM_REG_MPU_PCI) != 0xff; 2934 integrated_midi = snd_cmipci_read_b(cm, CM_REG_MPU_PCI) != 0xff;
2935 if (integrated_midi) 2935 if (integrated_midi && mpu_port[dev] == 1)
2936 iomidi = cm->iobase + CM_REG_MPU_PCI; 2936 iomidi = cm->iobase + CM_REG_MPU_PCI;
2937 else { 2937 else {
2938 iomidi = mpu_port[dev]; 2938 iomidi = mpu_port[dev];
@@ -2981,7 +2981,9 @@ static int __devinit snd_cmipci_create(struct snd_card *card, struct pci_dev *pc
2981 2981
2982 if (iomidi > 0) { 2982 if (iomidi > 0) {
2983 if ((err = snd_mpu401_uart_new(card, 0, MPU401_HW_CMIPCI, 2983 if ((err = snd_mpu401_uart_new(card, 0, MPU401_HW_CMIPCI,
2984 iomidi, integrated_midi, 2984 iomidi,
2985 (integrated_midi ?
2986 MPU401_INFO_INTEGRATED : 0),
2985 cm->irq, 0, &cm->rmidi)) < 0) { 2987 cm->irq, 0, &cm->rmidi)) < 0) {
2986 printk(KERN_ERR "cmipci: no UART401 device at 0x%lx\n", iomidi); 2988 printk(KERN_ERR "cmipci: no UART401 device at 0x%lx\n", iomidi);
2987 } 2989 }
diff --git a/sound/pci/cs4281.c b/sound/pci/cs4281.c
index b3c94d83450a..e77a4ce314b7 100644
--- a/sound/pci/cs4281.c
+++ b/sound/pci/cs4281.c
@@ -1184,7 +1184,7 @@ static void __devinit snd_cs4281_proc_init(struct cs4281 * chip)
1184 struct snd_info_entry *entry; 1184 struct snd_info_entry *entry;
1185 1185
1186 if (! snd_card_proc_new(chip->card, "cs4281", &entry)) 1186 if (! snd_card_proc_new(chip->card, "cs4281", &entry))
1187 snd_info_set_text_ops(entry, chip, 1024, snd_cs4281_proc_read); 1187 snd_info_set_text_ops(entry, chip, snd_cs4281_proc_read);
1188 if (! snd_card_proc_new(chip->card, "cs4281_BA0", &entry)) { 1188 if (! snd_card_proc_new(chip->card, "cs4281_BA0", &entry)) {
1189 entry->content = SNDRV_INFO_CONTENT_DATA; 1189 entry->content = SNDRV_INFO_CONTENT_DATA;
1190 entry->private_data = chip; 1190 entry->private_data = chip;
@@ -1379,6 +1379,13 @@ static int __devinit snd_cs4281_create(struct snd_card *card,
1379 chip->ba0_addr = pci_resource_start(pci, 0); 1379 chip->ba0_addr = pci_resource_start(pci, 0);
1380 chip->ba1_addr = pci_resource_start(pci, 1); 1380 chip->ba1_addr = pci_resource_start(pci, 1);
1381 1381
1382 chip->ba0 = ioremap_nocache(chip->ba0_addr, pci_resource_len(pci, 0));
1383 chip->ba1 = ioremap_nocache(chip->ba1_addr, pci_resource_len(pci, 1));
1384 if (!chip->ba0 || !chip->ba1) {
1385 snd_cs4281_free(chip);
1386 return -ENOMEM;
1387 }
1388
1382 if (request_irq(pci->irq, snd_cs4281_interrupt, SA_INTERRUPT|SA_SHIRQ, 1389 if (request_irq(pci->irq, snd_cs4281_interrupt, SA_INTERRUPT|SA_SHIRQ,
1383 "CS4281", chip)) { 1390 "CS4281", chip)) {
1384 snd_printk(KERN_ERR "unable to grab IRQ %d\n", pci->irq); 1391 snd_printk(KERN_ERR "unable to grab IRQ %d\n", pci->irq);
@@ -1387,13 +1394,6 @@ static int __devinit snd_cs4281_create(struct snd_card *card,
1387 } 1394 }
1388 chip->irq = pci->irq; 1395 chip->irq = pci->irq;
1389 1396
1390 chip->ba0 = ioremap_nocache(chip->ba0_addr, pci_resource_len(pci, 0));
1391 chip->ba1 = ioremap_nocache(chip->ba1_addr, pci_resource_len(pci, 1));
1392 if (!chip->ba0 || !chip->ba1) {
1393 snd_cs4281_free(chip);
1394 return -ENOMEM;
1395 }
1396
1397 tmp = snd_cs4281_chip_init(chip); 1397 tmp = snd_cs4281_chip_init(chip);
1398 if (tmp) { 1398 if (tmp) {
1399 snd_cs4281_free(chip); 1399 snd_cs4281_free(chip);
diff --git a/sound/pci/cs46xx/cs46xx.c b/sound/pci/cs46xx/cs46xx.c
index 848d772ae3c6..772dc52bfeb2 100644
--- a/sound/pci/cs46xx/cs46xx.c
+++ b/sound/pci/cs46xx/cs46xx.c
@@ -48,8 +48,8 @@ MODULE_SUPPORTED_DEVICE("{{Cirrus Logic,Sound Fusion (CS4280)},"
48static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ 48static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
49static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ 49static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
50static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */ 50static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */
51static int external_amp[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 0}; 51static int external_amp[SNDRV_CARDS];
52static int thinkpad[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 0}; 52static int thinkpad[SNDRV_CARDS];
53static int mmap_valid[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1}; 53static int mmap_valid[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1};
54 54
55module_param_array(index, int, NULL, 0444); 55module_param_array(index, int, NULL, 0444);
diff --git a/sound/pci/cs46xx/cs46xx_lib.c b/sound/pci/cs46xx/cs46xx_lib.c
index 69dbf542a6de..5c2114439204 100644
--- a/sound/pci/cs46xx/cs46xx_lib.c
+++ b/sound/pci/cs46xx/cs46xx_lib.c
@@ -2877,14 +2877,15 @@ static int snd_cs46xx_free(struct snd_cs46xx *chip)
2877 if (chip->region.idx[0].resource) 2877 if (chip->region.idx[0].resource)
2878 snd_cs46xx_hw_stop(chip); 2878 snd_cs46xx_hw_stop(chip);
2879 2879
2880 if (chip->irq >= 0)
2881 free_irq(chip->irq, chip);
2882
2880 for (idx = 0; idx < 5; idx++) { 2883 for (idx = 0; idx < 5; idx++) {
2881 struct snd_cs46xx_region *region = &chip->region.idx[idx]; 2884 struct snd_cs46xx_region *region = &chip->region.idx[idx];
2882 if (region->remap_addr) 2885 if (region->remap_addr)
2883 iounmap(region->remap_addr); 2886 iounmap(region->remap_addr);
2884 release_and_free_resource(region->resource); 2887 release_and_free_resource(region->resource);
2885 } 2888 }
2886 if (chip->irq >= 0)
2887 free_irq(chip->irq, chip);
2888 2889
2889 if (chip->active_ctrl) 2890 if (chip->active_ctrl)
2890 chip->active_ctrl(chip, -chip->amplifier); 2891 chip->active_ctrl(chip, -chip->amplifier);
diff --git a/sound/pci/cs46xx/dsp_spos.c b/sound/pci/cs46xx/dsp_spos.c
index f407d2a5ce3b..5c9711c0265c 100644
--- a/sound/pci/cs46xx/dsp_spos.c
+++ b/sound/pci/cs46xx/dsp_spos.c
@@ -767,7 +767,6 @@ int cs46xx_dsp_proc_init (struct snd_card *card, struct snd_cs46xx *chip)
767 if ((entry = snd_info_create_card_entry(card, "dsp", card->proc_root)) != NULL) { 767 if ((entry = snd_info_create_card_entry(card, "dsp", card->proc_root)) != NULL) {
768 entry->content = SNDRV_INFO_CONTENT_TEXT; 768 entry->content = SNDRV_INFO_CONTENT_TEXT;
769 entry->mode = S_IFDIR | S_IRUGO | S_IXUGO; 769 entry->mode = S_IFDIR | S_IRUGO | S_IXUGO;
770 entry->c.text.read_size = 512;
771 770
772 if (snd_info_register(entry) < 0) { 771 if (snd_info_register(entry) < 0) {
773 snd_info_free_entry(entry); 772 snd_info_free_entry(entry);
@@ -784,7 +783,6 @@ int cs46xx_dsp_proc_init (struct snd_card *card, struct snd_cs46xx *chip)
784 entry->content = SNDRV_INFO_CONTENT_TEXT; 783 entry->content = SNDRV_INFO_CONTENT_TEXT;
785 entry->private_data = chip; 784 entry->private_data = chip;
786 entry->mode = S_IFREG | S_IRUGO | S_IWUSR; 785 entry->mode = S_IFREG | S_IRUGO | S_IWUSR;
787 entry->c.text.read_size = 512;
788 entry->c.text.read = cs46xx_dsp_proc_symbol_table_read; 786 entry->c.text.read = cs46xx_dsp_proc_symbol_table_read;
789 if (snd_info_register(entry) < 0) { 787 if (snd_info_register(entry) < 0) {
790 snd_info_free_entry(entry); 788 snd_info_free_entry(entry);
@@ -797,7 +795,6 @@ int cs46xx_dsp_proc_init (struct snd_card *card, struct snd_cs46xx *chip)
797 entry->content = SNDRV_INFO_CONTENT_TEXT; 795 entry->content = SNDRV_INFO_CONTENT_TEXT;
798 entry->private_data = chip; 796 entry->private_data = chip;
799 entry->mode = S_IFREG | S_IRUGO | S_IWUSR; 797 entry->mode = S_IFREG | S_IRUGO | S_IWUSR;
800 entry->c.text.read_size = 512;
801 entry->c.text.read = cs46xx_dsp_proc_modules_read; 798 entry->c.text.read = cs46xx_dsp_proc_modules_read;
802 if (snd_info_register(entry) < 0) { 799 if (snd_info_register(entry) < 0) {
803 snd_info_free_entry(entry); 800 snd_info_free_entry(entry);
@@ -810,7 +807,6 @@ int cs46xx_dsp_proc_init (struct snd_card *card, struct snd_cs46xx *chip)
810 entry->content = SNDRV_INFO_CONTENT_TEXT; 807 entry->content = SNDRV_INFO_CONTENT_TEXT;
811 entry->private_data = chip; 808 entry->private_data = chip;
812 entry->mode = S_IFREG | S_IRUGO | S_IWUSR; 809 entry->mode = S_IFREG | S_IRUGO | S_IWUSR;
813 entry->c.text.read_size = 512;
814 entry->c.text.read = cs46xx_dsp_proc_parameter_dump_read; 810 entry->c.text.read = cs46xx_dsp_proc_parameter_dump_read;
815 if (snd_info_register(entry) < 0) { 811 if (snd_info_register(entry) < 0) {
816 snd_info_free_entry(entry); 812 snd_info_free_entry(entry);
@@ -823,7 +819,6 @@ int cs46xx_dsp_proc_init (struct snd_card *card, struct snd_cs46xx *chip)
823 entry->content = SNDRV_INFO_CONTENT_TEXT; 819 entry->content = SNDRV_INFO_CONTENT_TEXT;
824 entry->private_data = chip; 820 entry->private_data = chip;
825 entry->mode = S_IFREG | S_IRUGO | S_IWUSR; 821 entry->mode = S_IFREG | S_IRUGO | S_IWUSR;
826 entry->c.text.read_size = 512;
827 entry->c.text.read = cs46xx_dsp_proc_sample_dump_read; 822 entry->c.text.read = cs46xx_dsp_proc_sample_dump_read;
828 if (snd_info_register(entry) < 0) { 823 if (snd_info_register(entry) < 0) {
829 snd_info_free_entry(entry); 824 snd_info_free_entry(entry);
@@ -836,7 +831,6 @@ int cs46xx_dsp_proc_init (struct snd_card *card, struct snd_cs46xx *chip)
836 entry->content = SNDRV_INFO_CONTENT_TEXT; 831 entry->content = SNDRV_INFO_CONTENT_TEXT;
837 entry->private_data = chip; 832 entry->private_data = chip;
838 entry->mode = S_IFREG | S_IRUGO | S_IWUSR; 833 entry->mode = S_IFREG | S_IRUGO | S_IWUSR;
839 entry->c.text.read_size = 512;
840 entry->c.text.read = cs46xx_dsp_proc_task_tree_read; 834 entry->c.text.read = cs46xx_dsp_proc_task_tree_read;
841 if (snd_info_register(entry) < 0) { 835 if (snd_info_register(entry) < 0) {
842 snd_info_free_entry(entry); 836 snd_info_free_entry(entry);
@@ -849,7 +843,6 @@ int cs46xx_dsp_proc_init (struct snd_card *card, struct snd_cs46xx *chip)
849 entry->content = SNDRV_INFO_CONTENT_TEXT; 843 entry->content = SNDRV_INFO_CONTENT_TEXT;
850 entry->private_data = chip; 844 entry->private_data = chip;
851 entry->mode = S_IFREG | S_IRUGO | S_IWUSR; 845 entry->mode = S_IFREG | S_IRUGO | S_IWUSR;
852 entry->c.text.read_size = 1024;
853 entry->c.text.read = cs46xx_dsp_proc_scb_read; 846 entry->c.text.read = cs46xx_dsp_proc_scb_read;
854 if (snd_info_register(entry) < 0) { 847 if (snd_info_register(entry) < 0) {
855 snd_info_free_entry(entry); 848 snd_info_free_entry(entry);
diff --git a/sound/pci/cs46xx/dsp_spos_scb_lib.c b/sound/pci/cs46xx/dsp_spos_scb_lib.c
index 2c4ee45fe10c..3844d18af19c 100644
--- a/sound/pci/cs46xx/dsp_spos_scb_lib.c
+++ b/sound/pci/cs46xx/dsp_spos_scb_lib.c
@@ -267,7 +267,6 @@ void cs46xx_dsp_proc_register_scb_desc (struct snd_cs46xx *chip,
267 entry->private_data = scb_info; 267 entry->private_data = scb_info;
268 entry->mode = S_IFREG | S_IRUGO | S_IWUSR; 268 entry->mode = S_IFREG | S_IRUGO | S_IWUSR;
269 269
270 entry->c.text.read_size = 512;
271 entry->c.text.read = cs46xx_dsp_proc_scb_info_read; 270 entry->c.text.read = cs46xx_dsp_proc_scb_info_read;
272 271
273 if (snd_info_register(entry) < 0) { 272 if (snd_info_register(entry) < 0) {
diff --git a/sound/pci/cs5535audio/Makefile b/sound/pci/cs5535audio/Makefile
index 08d8ee6547d3..2911a8adc1f2 100644
--- a/sound/pci/cs5535audio/Makefile
+++ b/sound/pci/cs5535audio/Makefile
@@ -4,5 +4,9 @@
4 4
5snd-cs5535audio-objs := cs5535audio.o cs5535audio_pcm.o 5snd-cs5535audio-objs := cs5535audio.o cs5535audio_pcm.o
6 6
7ifdef CONFIG_PM
8snd-cs5535audio-objs += cs5535audio_pm.o
9endif
10
7# Toplevel Module Dependency 11# Toplevel Module Dependency
8obj-$(CONFIG_SND_CS5535AUDIO) += snd-cs5535audio.o 12obj-$(CONFIG_SND_CS5535AUDIO) += snd-cs5535audio.o
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
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
63module_param_array(index, int, NULL, 0444);
64MODULE_PARM_DESC(index, "Index value for " DRIVER_NAME);
65module_param_array(id, charp, NULL, 0444);
66MODULE_PARM_DESC(id, "ID string for " DRIVER_NAME);
67module_param_array(enable, bool, NULL, 0444);
68MODULE_PARM_DESC(enable, "Enable " DRIVER_NAME);
69
48static struct pci_device_id snd_cs5535audio_ids[] __devinitdata = { 70static 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
388static int __init alsa_card_cs5535audio_init(void) 417static int __init alsa_card_cs5535audio_init(void)
diff --git a/sound/pci/cs5535audio/cs5535audio.h b/sound/pci/cs5535audio/cs5535audio.h
index 5e55a1a1ed65..4fd1f31a6cf9 100644
--- a/sound/pci/cs5535audio/cs5535audio.h
+++ b/sound/pci/cs5535audio/cs5535audio.h
@@ -74,6 +74,8 @@
74#define PRM_RDY_STS 0x00800000 74#define PRM_RDY_STS 0x00800000
75#define ACC_CODEC_CNTL_WR_CMD (~0x80000000) 75#define ACC_CODEC_CNTL_WR_CMD (~0x80000000)
76#define ACC_CODEC_CNTL_RD_CMD 0x80000000 76#define ACC_CODEC_CNTL_RD_CMD 0x80000000
77#define ACC_CODEC_CNTL_LNK_SHUTDOWN 0x00040000
78#define ACC_CODEC_CNTL_LNK_WRM_RST 0x00020000
77#define PRD_JMP 0x2000 79#define PRD_JMP 0x2000
78#define PRD_EOP 0x4000 80#define PRD_EOP 0x4000
79#define PRD_EOT 0x8000 81#define PRD_EOT 0x8000
@@ -88,6 +90,7 @@ struct cs5535audio_dma_ops {
88 void (*disable_dma)(struct cs5535audio *cs5535au); 90 void (*disable_dma)(struct cs5535audio *cs5535au);
89 void (*pause_dma)(struct cs5535audio *cs5535au); 91 void (*pause_dma)(struct cs5535audio *cs5535au);
90 void (*setup_prd)(struct cs5535audio *cs5535au, u32 prd_addr); 92 void (*setup_prd)(struct cs5535audio *cs5535au, u32 prd_addr);
93 u32 (*read_prd)(struct cs5535audio *cs5535au);
91 u32 (*read_dma_pntr)(struct cs5535audio *cs5535au); 94 u32 (*read_dma_pntr)(struct cs5535audio *cs5535au);
92}; 95};
93 96
@@ -103,11 +106,14 @@ struct cs5535audio_dma {
103 struct snd_pcm_substream *substream; 106 struct snd_pcm_substream *substream;
104 unsigned int buf_addr, buf_bytes; 107 unsigned int buf_addr, buf_bytes;
105 unsigned int period_bytes, periods; 108 unsigned int period_bytes, periods;
109 int suspended;
110 u32 saved_prd;
106}; 111};
107 112
108struct cs5535audio { 113struct cs5535audio {
109 struct snd_card *card; 114 struct snd_card *card;
110 struct snd_ac97 *ac97; 115 struct snd_ac97 *ac97;
116 struct snd_pcm *pcm;
111 int irq; 117 int irq;
112 struct pci_dev *pci; 118 struct pci_dev *pci;
113 unsigned long port; 119 unsigned long port;
@@ -117,6 +123,8 @@ struct cs5535audio {
117 struct cs5535audio_dma dmas[NUM_CS5535AUDIO_DMAS]; 123 struct cs5535audio_dma dmas[NUM_CS5535AUDIO_DMAS];
118}; 124};
119 125
126int snd_cs5535audio_suspend(struct pci_dev *pci, pm_message_t state);
127int snd_cs5535audio_resume(struct pci_dev *pci);
120int __devinit snd_cs5535audio_pcm(struct cs5535audio *cs5535audio); 128int __devinit snd_cs5535audio_pcm(struct cs5535audio *cs5535audio);
121 129
122#endif /* __SOUND_CS5535AUDIO_H */ 130#endif /* __SOUND_CS5535AUDIO_H */
diff --git a/sound/pci/cs5535audio/cs5535audio_pcm.c b/sound/pci/cs5535audio/cs5535audio_pcm.c
index 60bb82b2ff47..f0a48693d687 100644
--- a/sound/pci/cs5535audio/cs5535audio_pcm.c
+++ b/sound/pci/cs5535audio/cs5535audio_pcm.c
@@ -43,7 +43,8 @@ static struct snd_pcm_hardware snd_cs5535audio_playback =
43 SNDRV_PCM_INFO_BLOCK_TRANSFER | 43 SNDRV_PCM_INFO_BLOCK_TRANSFER |
44 SNDRV_PCM_INFO_MMAP_VALID | 44 SNDRV_PCM_INFO_MMAP_VALID |
45 SNDRV_PCM_INFO_PAUSE | 45 SNDRV_PCM_INFO_PAUSE |
46 SNDRV_PCM_INFO_SYNC_START 46 SNDRV_PCM_INFO_SYNC_START |
47 SNDRV_PCM_INFO_RESUME
47 ), 48 ),
48 .formats = ( 49 .formats = (
49 SNDRV_PCM_FMTBIT_S16_LE 50 SNDRV_PCM_FMTBIT_S16_LE
@@ -193,6 +194,11 @@ static void cs5535audio_playback_setup_prd(struct cs5535audio *cs5535au,
193 cs_writel(cs5535au, ACC_BM0_PRD, prd_addr); 194 cs_writel(cs5535au, ACC_BM0_PRD, prd_addr);
194} 195}
195 196
197static u32 cs5535audio_playback_read_prd(struct cs5535audio *cs5535au)
198{
199 return cs_readl(cs5535au, ACC_BM0_PRD);
200}
201
196static u32 cs5535audio_playback_read_dma_pntr(struct cs5535audio *cs5535au) 202static u32 cs5535audio_playback_read_dma_pntr(struct cs5535audio *cs5535au)
197{ 203{
198 return cs_readl(cs5535au, ACC_BM0_PNTR); 204 return cs_readl(cs5535au, ACC_BM0_PNTR);
@@ -219,6 +225,11 @@ static void cs5535audio_capture_setup_prd(struct cs5535audio *cs5535au,
219 cs_writel(cs5535au, ACC_BM1_PRD, prd_addr); 225 cs_writel(cs5535au, ACC_BM1_PRD, prd_addr);
220} 226}
221 227
228static u32 cs5535audio_capture_read_prd(struct cs5535audio *cs5535au)
229{
230 return cs_readl(cs5535au, ACC_BM1_PRD);
231}
232
222static u32 cs5535audio_capture_read_dma_pntr(struct cs5535audio *cs5535au) 233static u32 cs5535audio_capture_read_dma_pntr(struct cs5535audio *cs5535au)
223{ 234{
224 return cs_readl(cs5535au, ACC_BM1_PNTR); 235 return cs_readl(cs5535au, ACC_BM1_PNTR);
@@ -285,9 +296,17 @@ static int snd_cs5535audio_trigger(struct snd_pcm_substream *substream, int cmd)
285 case SNDRV_PCM_TRIGGER_START: 296 case SNDRV_PCM_TRIGGER_START:
286 dma->ops->enable_dma(cs5535au); 297 dma->ops->enable_dma(cs5535au);
287 break; 298 break;
299 case SNDRV_PCM_TRIGGER_RESUME:
300 dma->ops->enable_dma(cs5535au);
301 dma->suspended = 0;
302 break;
288 case SNDRV_PCM_TRIGGER_STOP: 303 case SNDRV_PCM_TRIGGER_STOP:
289 dma->ops->disable_dma(cs5535au); 304 dma->ops->disable_dma(cs5535au);
290 break; 305 break;
306 case SNDRV_PCM_TRIGGER_SUSPEND:
307 dma->ops->disable_dma(cs5535au);
308 dma->suspended = 1;
309 break;
291 default: 310 default:
292 snd_printk(KERN_ERR "unhandled trigger\n"); 311 snd_printk(KERN_ERR "unhandled trigger\n");
293 err = -EINVAL; 312 err = -EINVAL;
@@ -375,6 +394,7 @@ static struct cs5535audio_dma_ops snd_cs5535audio_playback_dma_ops = {
375 .enable_dma = cs5535audio_playback_enable_dma, 394 .enable_dma = cs5535audio_playback_enable_dma,
376 .disable_dma = cs5535audio_playback_disable_dma, 395 .disable_dma = cs5535audio_playback_disable_dma,
377 .setup_prd = cs5535audio_playback_setup_prd, 396 .setup_prd = cs5535audio_playback_setup_prd,
397 .read_prd = cs5535audio_playback_read_prd,
378 .pause_dma = cs5535audio_playback_pause_dma, 398 .pause_dma = cs5535audio_playback_pause_dma,
379 .read_dma_pntr = cs5535audio_playback_read_dma_pntr, 399 .read_dma_pntr = cs5535audio_playback_read_dma_pntr,
380}; 400};
@@ -384,6 +404,7 @@ static struct cs5535audio_dma_ops snd_cs5535audio_capture_dma_ops = {
384 .enable_dma = cs5535audio_capture_enable_dma, 404 .enable_dma = cs5535audio_capture_enable_dma,
385 .disable_dma = cs5535audio_capture_disable_dma, 405 .disable_dma = cs5535audio_capture_disable_dma,
386 .setup_prd = cs5535audio_capture_setup_prd, 406 .setup_prd = cs5535audio_capture_setup_prd,
407 .read_prd = cs5535audio_capture_read_prd,
387 .pause_dma = cs5535audio_capture_pause_dma, 408 .pause_dma = cs5535audio_capture_pause_dma,
388 .read_dma_pntr = cs5535audio_capture_read_dma_pntr, 409 .read_dma_pntr = cs5535audio_capture_read_dma_pntr,
389}; 410};
@@ -413,6 +434,7 @@ int __devinit snd_cs5535audio_pcm(struct cs5535audio *cs5535au)
413 snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV, 434 snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV,
414 snd_dma_pci_data(cs5535au->pci), 435 snd_dma_pci_data(cs5535au->pci),
415 64*1024, 128*1024); 436 64*1024, 128*1024);
437 cs5535au->pcm = pcm;
416 438
417 return 0; 439 return 0;
418} 440}
diff --git a/sound/pci/cs5535audio/cs5535audio_pm.c b/sound/pci/cs5535audio/cs5535audio_pm.c
new file mode 100644
index 000000000000..aad0e69db9c1
--- /dev/null
+++ b/sound/pci/cs5535audio/cs5535audio_pm.c
@@ -0,0 +1,123 @@
1/*
2 * Power management for audio on multifunction CS5535 companion device
3 * Copyright (C) Jaya Kumar
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 *
19 */
20
21#include <linux/init.h>
22#include <linux/slab.h>
23#include <linux/pci.h>
24#include <linux/delay.h>
25#include <sound/driver.h>
26#include <sound/core.h>
27#include <sound/control.h>
28#include <sound/initval.h>
29#include <sound/asoundef.h>
30#include <sound/pcm.h>
31#include <sound/ac97_codec.h>
32#include "cs5535audio.h"
33
34static void snd_cs5535audio_stop_hardware(struct cs5535audio *cs5535au)
35{
36 /*
37 we depend on snd_ac97_suspend to tell the
38 AC97 codec to shutdown. the amd spec suggests
39 that the LNK_SHUTDOWN be done at the same time
40 that the codec power-down is issued. instead,
41 we do it just after rather than at the same
42 time. excluding codec specific build_ops->suspend
43 ac97 powerdown hits:
44 0x8000 EAPD
45 0x4000 Headphone amplifier
46 0x0300 ADC & DAC
47 0x0400 Analog Mixer powerdown (Vref on)
48 I am not sure if this is the best that we can do.
49 The remainder to be investigated are:
50 - analog mixer (vref off) 0x0800
51 - AC-link powerdown 0x1000
52 - codec internal clock 0x2000
53 */
54
55 /* set LNK_SHUTDOWN to shutdown AC link */
56 cs_writel(cs5535au, ACC_CODEC_CNTL, ACC_CODEC_CNTL_LNK_SHUTDOWN);
57
58}
59
60int snd_cs5535audio_suspend(struct pci_dev *pci, pm_message_t state)
61{
62 struct snd_card *card = pci_get_drvdata(pci);
63 struct cs5535audio *cs5535au = card->private_data;
64 int i;
65
66 snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
67 for (i = 0; i < NUM_CS5535AUDIO_DMAS; i++) {
68 struct cs5535audio_dma *dma = &cs5535au->dmas[i];
69 if (dma && dma->substream && !dma->suspended)
70 dma->saved_prd = dma->ops->read_prd(cs5535au);
71 }
72 snd_pcm_suspend_all(cs5535au->pcm);
73 snd_ac97_suspend(cs5535au->ac97);
74 /* save important regs, then disable aclink in hw */
75 snd_cs5535audio_stop_hardware(cs5535au);
76 pci_disable_device(pci);
77 pci_save_state(pci);
78
79 return 0;
80}
81
82int snd_cs5535audio_resume(struct pci_dev *pci)
83{
84 struct snd_card *card = pci_get_drvdata(pci);
85 struct cs5535audio *cs5535au = card->private_data;
86 u32 tmp;
87 int timeout;
88 int i;
89
90 pci_restore_state(pci);
91 pci_enable_device(pci);
92 pci_set_master(pci);
93
94 /* set LNK_WRM_RST to reset AC link */
95 cs_writel(cs5535au, ACC_CODEC_CNTL, ACC_CODEC_CNTL_LNK_WRM_RST);
96
97 timeout = 50;
98 do {
99 tmp = cs_readl(cs5535au, ACC_CODEC_STATUS);
100 if (tmp & PRM_RDY_STS)
101 break;
102 udelay(1);
103 } while (--timeout);
104
105 if (!timeout)
106 snd_printk(KERN_ERR "Failure getting AC Link ready\n");
107
108 /* we depend on ac97 to perform the codec power up */
109 snd_ac97_resume(cs5535au->ac97);
110 /* set up rate regs, dma. actual initiation is done in trig */
111 for (i = 0; i < NUM_CS5535AUDIO_DMAS; i++) {
112 struct cs5535audio_dma *dma = &cs5535au->dmas[i];
113 if (dma && dma->substream && dma->suspended) {
114 dma->substream->ops->prepare(dma->substream);
115 dma->ops->setup_prd(cs5535au, dma->saved_prd);
116 }
117 }
118
119 snd_power_change_state(card, SNDRV_CTL_POWER_D0);
120
121 return 0;
122}
123
diff --git a/sound/pci/emu10k1/emu10k1.c b/sound/pci/emu10k1/emu10k1.c
index 42b11ba1d210..549673ea14a9 100644
--- a/sound/pci/emu10k1/emu10k1.c
+++ b/sound/pci/emu10k1/emu10k1.c
@@ -46,13 +46,13 @@ MODULE_SUPPORTED_DEVICE("{{Creative Labs,SB Live!/PCI512/E-mu APS},"
46static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ 46static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
47static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ 47static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
48static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */ 48static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */
49static int extin[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 0}; 49static int extin[SNDRV_CARDS];
50static int extout[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 0}; 50static int extout[SNDRV_CARDS];
51static int seq_ports[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 4}; 51static int seq_ports[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 4};
52static int max_synth_voices[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 64}; 52static int max_synth_voices[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 64};
53static int max_buffer_size[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 128}; 53static int max_buffer_size[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 128};
54static int enable_ir[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 0}; 54static int enable_ir[SNDRV_CARDS];
55static uint subsystem[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 0}; /* Force card subsystem model */ 55static uint subsystem[SNDRV_CARDS]; /* Force card subsystem model */
56 56
57module_param_array(index, int, NULL, 0444); 57module_param_array(index, int, NULL, 0444);
58MODULE_PARM_DESC(index, "Index value for the EMU10K1 soundcard."); 58MODULE_PARM_DESC(index, "Index value for the EMU10K1 soundcard.");
diff --git a/sound/pci/emu10k1/emu10k1_main.c b/sound/pci/emu10k1/emu10k1_main.c
index 6bfa08436efa..42a358f989c3 100644
--- a/sound/pci/emu10k1/emu10k1_main.c
+++ b/sound/pci/emu10k1/emu10k1_main.c
@@ -777,14 +777,6 @@ static int snd_emu10k1_dev_free(struct snd_device *device)
777 777
778static struct snd_emu_chip_details emu_chip_details[] = { 778static struct snd_emu_chip_details emu_chip_details[] = {
779 /* Audigy 2 Value AC3 out does not work yet. Need to find out how to turn off interpolators.*/ 779 /* Audigy 2 Value AC3 out does not work yet. Need to find out how to turn off interpolators.*/
780 /* Audigy4 SB0400 */
781 {.vendor = 0x1102, .device = 0x0008, .subsystem = 0x10211102,
782 .driver = "Audigy2", .name = "Audigy 4 [SB0400]",
783 .id = "Audigy2",
784 .emu10k2_chip = 1,
785 .ca0108_chip = 1,
786 .spk71 = 1,
787 .ac97_chip = 1} ,
788 /* Tested by James@superbug.co.uk 3rd July 2005 */ 780 /* Tested by James@superbug.co.uk 3rd July 2005 */
789 /* DSP: CA0108-IAT 781 /* DSP: CA0108-IAT
790 * DAC: CS4382-KQ 782 * DAC: CS4382-KQ
@@ -799,13 +791,59 @@ static struct snd_emu_chip_details emu_chip_details[] = {
799 .ca0108_chip = 1, 791 .ca0108_chip = 1,
800 .spk71 = 1, 792 .spk71 = 1,
801 .ac97_chip = 1} , 793 .ac97_chip = 1} ,
794 /* Audigy4 (Not PRO) SB0610 */
795 /* Tested by James@superbug.co.uk 4th April 2006 */
796 /* A_IOCFG bits
797 * Output
798 * 0: ?
799 * 1: ?
800 * 2: ?
801 * 3: 0 - Digital Out, 1 - Line in
802 * 4: ?
803 * 5: ?
804 * 6: ?
805 * 7: ?
806 * Input
807 * 8: ?
808 * 9: ?
809 * A: Green jack sense (Front)
810 * B: ?
811 * C: Black jack sense (Rear/Side Right)
812 * D: Yellow jack sense (Center/LFE/Side Left)
813 * E: ?
814 * F: ?
815 *
816 * Digital Out/Line in switch using A_IOCFG bit 3 (0x08)
817 * 0 - Digital Out
818 * 1 - Line in
819 */
820 /* Mic input not tested.
821 * Analog CD input not tested
822 * Digital Out not tested.
823 * Line in working.
824 * Audio output 5.1 working. Side outputs not working.
825 */
826 /* DSP: CA10300-IAT LF
827 * DAC: Cirrus Logic CS4382-KQZ
828 * ADC: Philips 1361T
829 * AC97: Sigmatel STAC9750
830 * CA0151: None
831 */
832 {.vendor = 0x1102, .device = 0x0008, .subsystem = 0x10211102,
833 .driver = "Audigy2", .name = "Audigy 4 [SB0610]",
834 .id = "Audigy2",
835 .emu10k2_chip = 1,
836 .ca0108_chip = 1,
837 .spk71 = 1,
838 .adc_1361t = 1, /* 24 bit capture instead of 16bit */
839 .ac97_chip = 1} ,
802 /* Audigy 2 ZS Notebook Cardbus card.*/ 840 /* Audigy 2 ZS Notebook Cardbus card.*/
803 /* Tested by James@superbug.co.uk 22th December 2005 */ 841 /* Tested by James@superbug.co.uk 22th December 2005 */
804 /* Audio output 7.1/Headphones working. 842 /* Audio output 7.1/Headphones working.
805 * Digital output working. (AC3 not checked, only PCM) 843 * Digital output working. (AC3 not checked, only PCM)
806 * Audio inputs not tested. 844 * Audio inputs not tested.
807 */ 845 */
808 /* DSP: Tiny2 846 /* DSP: Tina2
809 * DAC: Wolfson WM8768/WM8568 847 * DAC: Wolfson WM8768/WM8568
810 * ADC: Wolfson WM8775 848 * ADC: Wolfson WM8775
811 * AC97: None 849 * AC97: None
@@ -1421,16 +1459,3 @@ void snd_emu10k1_resume_regs(struct snd_emu10k1 *emu)
1421 } 1459 }
1422} 1460}
1423#endif 1461#endif
1424
1425/* memory.c */
1426EXPORT_SYMBOL(snd_emu10k1_synth_alloc);
1427EXPORT_SYMBOL(snd_emu10k1_synth_free);
1428EXPORT_SYMBOL(snd_emu10k1_synth_bzero);
1429EXPORT_SYMBOL(snd_emu10k1_synth_copy_from_user);
1430EXPORT_SYMBOL(snd_emu10k1_memblk_map);
1431/* voice.c */
1432EXPORT_SYMBOL(snd_emu10k1_voice_alloc);
1433EXPORT_SYMBOL(snd_emu10k1_voice_free);
1434/* io.c */
1435EXPORT_SYMBOL(snd_emu10k1_ptr_read);
1436EXPORT_SYMBOL(snd_emu10k1_ptr_write);
diff --git a/sound/pci/emu10k1/emu10k1x.c b/sound/pci/emu10k1/emu10k1x.c
index d51290c18167..0fb27e4be07b 100644
--- a/sound/pci/emu10k1/emu10k1x.c
+++ b/sound/pci/emu10k1/emu10k1x.c
@@ -1055,8 +1055,7 @@ static int __devinit snd_emu10k1x_proc_init(struct emu10k1x * emu)
1055 struct snd_info_entry *entry; 1055 struct snd_info_entry *entry;
1056 1056
1057 if(! snd_card_proc_new(emu->card, "emu10k1x_regs", &entry)) { 1057 if(! snd_card_proc_new(emu->card, "emu10k1x_regs", &entry)) {
1058 snd_info_set_text_ops(entry, emu, 1024, snd_emu10k1x_proc_reg_read); 1058 snd_info_set_text_ops(entry, emu, snd_emu10k1x_proc_reg_read);
1059 entry->c.text.write_size = 64;
1060 entry->c.text.write = snd_emu10k1x_proc_reg_write; 1059 entry->c.text.write = snd_emu10k1x_proc_reg_write;
1061 entry->mode |= S_IWUSR; 1060 entry->mode |= S_IWUSR;
1062 entry->private_data = emu; 1061 entry->private_data = emu;
diff --git a/sound/pci/emu10k1/emumixer.c b/sound/pci/emu10k1/emumixer.c
index 2a9d12d10680..c31f3d0877fa 100644
--- a/sound/pci/emu10k1/emumixer.c
+++ b/sound/pci/emu10k1/emumixer.c
@@ -777,6 +777,8 @@ int __devinit snd_emu10k1_mixer(struct snd_emu10k1 *emu,
777 }; 777 };
778 static char *audigy_remove_ctls[] = { 778 static char *audigy_remove_ctls[] = {
779 /* Master/PCM controls on ac97 of Audigy has no effect */ 779 /* Master/PCM controls on ac97 of Audigy has no effect */
780 /* On the Audigy2 the AC97 playback is piped into
781 * the Philips ADC for 24bit capture */
780 "PCM Playback Switch", 782 "PCM Playback Switch",
781 "PCM Playback Volume", 783 "PCM Playback Volume",
782 "Master Mono Playback Switch", 784 "Master Mono Playback Switch",
@@ -804,6 +806,47 @@ int __devinit snd_emu10k1_mixer(struct snd_emu10k1 *emu,
804 "AMic Playback Volume", "Mic Playback Volume", 806 "AMic Playback Volume", "Mic Playback Volume",
805 NULL 807 NULL
806 }; 808 };
809 static char *audigy_remove_ctls_1361t_adc[] = {
810 /* On the Audigy2 the AC97 playback is piped into
811 * the Philips ADC for 24bit capture */
812 "PCM Playback Switch",
813 "PCM Playback Volume",
814 "Master Mono Playback Switch",
815 "Master Mono Playback Volume",
816 "Capture Source",
817 "Capture Switch",
818 "Capture Volume",
819 "Mic Capture Volume",
820 "Headphone Playback Switch",
821 "Headphone Playback Volume",
822 "3D Control - Center",
823 "3D Control - Depth",
824 "3D Control - Switch",
825 "Line2 Playback Volume",
826 "Line2 Capture Volume",
827 NULL
828 };
829 static char *audigy_rename_ctls_1361t_adc[] = {
830 "Master Playback Switch", "Master Capture Switch",
831 "Master Playback Volume", "Master Capture Volume",
832 "Wave Master Playback Volume", "Master Playback Volume",
833 "PC Speaker Playback Switch", "PC Speaker Capture Switch",
834 "PC Speaker Playback Volume", "PC Speaker Capture Volume",
835 "Phone Playback Switch", "Phone Capture Switch",
836 "Phone Playback Volume", "Phone Capture Volume",
837 "Mic Playback Switch", "Mic Capture Switch",
838 "Mic Playback Volume", "Mic Capture Volume",
839 "Line Playback Switch", "Line Capture Switch",
840 "Line Playback Volume", "Line Capture Volume",
841 "CD Playback Switch", "CD Capture Switch",
842 "CD Playback Volume", "CD Capture Volume",
843 "Aux Playback Switch", "Aux Capture Switch",
844 "Aux Playback Volume", "Aux Capture Volume",
845 "Video Playback Switch", "Video Capture Switch",
846 "Video Playback Volume", "Video Capture Volume",
847
848 NULL
849 };
807 850
808 if (emu->card_capabilities->ac97_chip) { 851 if (emu->card_capabilities->ac97_chip) {
809 struct snd_ac97_bus *pbus; 852 struct snd_ac97_bus *pbus;
@@ -834,7 +877,10 @@ int __devinit snd_emu10k1_mixer(struct snd_emu10k1 *emu,
834 snd_ac97_write_cache(emu->ac97, AC97_MASTER, 0x0000); 877 snd_ac97_write_cache(emu->ac97, AC97_MASTER, 0x0000);
835 /* set capture source to mic */ 878 /* set capture source to mic */
836 snd_ac97_write_cache(emu->ac97, AC97_REC_SEL, 0x0000); 879 snd_ac97_write_cache(emu->ac97, AC97_REC_SEL, 0x0000);
837 c = audigy_remove_ctls; 880 if (emu->card_capabilities->adc_1361t)
881 c = audigy_remove_ctls_1361t_adc;
882 else
883 c = audigy_remove_ctls;
838 } else { 884 } else {
839 /* 885 /*
840 * Credits for cards based on STAC9758: 886 * Credits for cards based on STAC9758:
@@ -863,11 +909,15 @@ int __devinit snd_emu10k1_mixer(struct snd_emu10k1 *emu,
863 } 909 }
864 910
865 if (emu->audigy) 911 if (emu->audigy)
866 c = audigy_rename_ctls; 912 if (emu->card_capabilities->adc_1361t)
913 c = audigy_rename_ctls_1361t_adc;
914 else
915 c = audigy_rename_ctls;
867 else 916 else
868 c = emu10k1_rename_ctls; 917 c = emu10k1_rename_ctls;
869 for (; *c; c += 2) 918 for (; *c; c += 2)
870 rename_ctl(card, c[0], c[1]); 919 rename_ctl(card, c[0], c[1]);
920
871 if (emu->card_capabilities->subsystem == 0x20071102) { /* Audigy 4 Pro */ 921 if (emu->card_capabilities->subsystem == 0x20071102) { /* Audigy 4 Pro */
872 rename_ctl(card, "Line2 Capture Volume", "Line1/Mic Capture Volume"); 922 rename_ctl(card, "Line2 Capture Volume", "Line1/Mic Capture Volume");
873 rename_ctl(card, "Analog Mix Capture Volume", "Line2 Capture Volume"); 923 rename_ctl(card, "Analog Mix Capture Volume", "Line2 Capture Volume");
diff --git a/sound/pci/emu10k1/emuproc.c b/sound/pci/emu10k1/emuproc.c
index 90f1c52703a1..b939e03aaedf 100644
--- a/sound/pci/emu10k1/emuproc.c
+++ b/sound/pci/emu10k1/emuproc.c
@@ -532,57 +532,51 @@ int __devinit snd_emu10k1_proc_init(struct snd_emu10k1 * emu)
532 struct snd_info_entry *entry; 532 struct snd_info_entry *entry;
533#ifdef CONFIG_SND_DEBUG 533#ifdef CONFIG_SND_DEBUG
534 if (! snd_card_proc_new(emu->card, "io_regs", &entry)) { 534 if (! snd_card_proc_new(emu->card, "io_regs", &entry)) {
535 snd_info_set_text_ops(entry, emu, 1024, snd_emu_proc_io_reg_read); 535 snd_info_set_text_ops(entry, emu, snd_emu_proc_io_reg_read);
536 entry->c.text.write_size = 64;
537 entry->c.text.write = snd_emu_proc_io_reg_write; 536 entry->c.text.write = snd_emu_proc_io_reg_write;
538 entry->mode |= S_IWUSR; 537 entry->mode |= S_IWUSR;
539 } 538 }
540 if (! snd_card_proc_new(emu->card, "ptr_regs00a", &entry)) { 539 if (! snd_card_proc_new(emu->card, "ptr_regs00a", &entry)) {
541 snd_info_set_text_ops(entry, emu, 65536, snd_emu_proc_ptr_reg_read00a); 540 snd_info_set_text_ops(entry, emu, snd_emu_proc_ptr_reg_read00a);
542 entry->c.text.write_size = 64;
543 entry->c.text.write = snd_emu_proc_ptr_reg_write00; 541 entry->c.text.write = snd_emu_proc_ptr_reg_write00;
544 entry->mode |= S_IWUSR; 542 entry->mode |= S_IWUSR;
545 } 543 }
546 if (! snd_card_proc_new(emu->card, "ptr_regs00b", &entry)) { 544 if (! snd_card_proc_new(emu->card, "ptr_regs00b", &entry)) {
547 snd_info_set_text_ops(entry, emu, 65536, snd_emu_proc_ptr_reg_read00b); 545 snd_info_set_text_ops(entry, emu, snd_emu_proc_ptr_reg_read00b);
548 entry->c.text.write_size = 64;
549 entry->c.text.write = snd_emu_proc_ptr_reg_write00; 546 entry->c.text.write = snd_emu_proc_ptr_reg_write00;
550 entry->mode |= S_IWUSR; 547 entry->mode |= S_IWUSR;
551 } 548 }
552 if (! snd_card_proc_new(emu->card, "ptr_regs20a", &entry)) { 549 if (! snd_card_proc_new(emu->card, "ptr_regs20a", &entry)) {
553 snd_info_set_text_ops(entry, emu, 65536, snd_emu_proc_ptr_reg_read20a); 550 snd_info_set_text_ops(entry, emu, snd_emu_proc_ptr_reg_read20a);
554 entry->c.text.write_size = 64;
555 entry->c.text.write = snd_emu_proc_ptr_reg_write20; 551 entry->c.text.write = snd_emu_proc_ptr_reg_write20;
556 entry->mode |= S_IWUSR; 552 entry->mode |= S_IWUSR;
557 } 553 }
558 if (! snd_card_proc_new(emu->card, "ptr_regs20b", &entry)) { 554 if (! snd_card_proc_new(emu->card, "ptr_regs20b", &entry)) {
559 snd_info_set_text_ops(entry, emu, 65536, snd_emu_proc_ptr_reg_read20b); 555 snd_info_set_text_ops(entry, emu, snd_emu_proc_ptr_reg_read20b);
560 entry->c.text.write_size = 64;
561 entry->c.text.write = snd_emu_proc_ptr_reg_write20; 556 entry->c.text.write = snd_emu_proc_ptr_reg_write20;
562 entry->mode |= S_IWUSR; 557 entry->mode |= S_IWUSR;
563 } 558 }
564 if (! snd_card_proc_new(emu->card, "ptr_regs20c", &entry)) { 559 if (! snd_card_proc_new(emu->card, "ptr_regs20c", &entry)) {
565 snd_info_set_text_ops(entry, emu, 65536, snd_emu_proc_ptr_reg_read20c); 560 snd_info_set_text_ops(entry, emu, snd_emu_proc_ptr_reg_read20c);
566 entry->c.text.write_size = 64;
567 entry->c.text.write = snd_emu_proc_ptr_reg_write20; 561 entry->c.text.write = snd_emu_proc_ptr_reg_write20;
568 entry->mode |= S_IWUSR; 562 entry->mode |= S_IWUSR;
569 } 563 }
570#endif 564#endif
571 565
572 if (! snd_card_proc_new(emu->card, "emu10k1", &entry)) 566 if (! snd_card_proc_new(emu->card, "emu10k1", &entry))
573 snd_info_set_text_ops(entry, emu, 2048, snd_emu10k1_proc_read); 567 snd_info_set_text_ops(entry, emu, snd_emu10k1_proc_read);
574 568
575 if (emu->card_capabilities->emu10k2_chip) { 569 if (emu->card_capabilities->emu10k2_chip) {
576 if (! snd_card_proc_new(emu->card, "spdif-in", &entry)) 570 if (! snd_card_proc_new(emu->card, "spdif-in", &entry))
577 snd_info_set_text_ops(entry, emu, 2048, snd_emu10k1_proc_spdif_read); 571 snd_info_set_text_ops(entry, emu, snd_emu10k1_proc_spdif_read);
578 } 572 }
579 if (emu->card_capabilities->ca0151_chip) { 573 if (emu->card_capabilities->ca0151_chip) {
580 if (! snd_card_proc_new(emu->card, "capture-rates", &entry)) 574 if (! snd_card_proc_new(emu->card, "capture-rates", &entry))
581 snd_info_set_text_ops(entry, emu, 2048, snd_emu10k1_proc_rates_read); 575 snd_info_set_text_ops(entry, emu, snd_emu10k1_proc_rates_read);
582 } 576 }
583 577
584 if (! snd_card_proc_new(emu->card, "voices", &entry)) 578 if (! snd_card_proc_new(emu->card, "voices", &entry))
585 snd_info_set_text_ops(entry, emu, 2048, snd_emu10k1_proc_voices_read); 579 snd_info_set_text_ops(entry, emu, snd_emu10k1_proc_voices_read);
586 580
587 if (! snd_card_proc_new(emu->card, "fx8010_gpr", &entry)) { 581 if (! snd_card_proc_new(emu->card, "fx8010_gpr", &entry)) {
588 entry->content = SNDRV_INFO_CONTENT_DATA; 582 entry->content = SNDRV_INFO_CONTENT_DATA;
@@ -616,7 +610,6 @@ int __devinit snd_emu10k1_proc_init(struct snd_emu10k1 * emu)
616 entry->content = SNDRV_INFO_CONTENT_TEXT; 610 entry->content = SNDRV_INFO_CONTENT_TEXT;
617 entry->private_data = emu; 611 entry->private_data = emu;
618 entry->mode = S_IFREG | S_IRUGO /*| S_IWUSR*/; 612 entry->mode = S_IFREG | S_IRUGO /*| S_IWUSR*/;
619 entry->c.text.read_size = 128*1024;
620 entry->c.text.read = snd_emu10k1_proc_acode_read; 613 entry->c.text.read = snd_emu10k1_proc_acode_read;
621 } 614 }
622 return 0; 615 return 0;
diff --git a/sound/pci/emu10k1/io.c b/sound/pci/emu10k1/io.c
index ef5304df8c11..029e7856c43b 100644
--- a/sound/pci/emu10k1/io.c
+++ b/sound/pci/emu10k1/io.c
@@ -62,6 +62,8 @@ unsigned int snd_emu10k1_ptr_read(struct snd_emu10k1 * emu, unsigned int reg, un
62 } 62 }
63} 63}
64 64
65EXPORT_SYMBOL(snd_emu10k1_ptr_read);
66
65void snd_emu10k1_ptr_write(struct snd_emu10k1 *emu, unsigned int reg, unsigned int chn, unsigned int data) 67void snd_emu10k1_ptr_write(struct snd_emu10k1 *emu, unsigned int reg, unsigned int chn, unsigned int data)
66{ 68{
67 unsigned int regptr; 69 unsigned int regptr;
@@ -92,6 +94,8 @@ void snd_emu10k1_ptr_write(struct snd_emu10k1 *emu, unsigned int reg, unsigned i
92 } 94 }
93} 95}
94 96
97EXPORT_SYMBOL(snd_emu10k1_ptr_write);
98
95unsigned int snd_emu10k1_ptr20_read(struct snd_emu10k1 * emu, 99unsigned int snd_emu10k1_ptr20_read(struct snd_emu10k1 * emu,
96 unsigned int reg, 100 unsigned int reg,
97 unsigned int chn) 101 unsigned int chn)
diff --git a/sound/pci/emu10k1/memory.c b/sound/pci/emu10k1/memory.c
index e7ec98649f04..4fcaefe5a3c5 100644
--- a/sound/pci/emu10k1/memory.c
+++ b/sound/pci/emu10k1/memory.c
@@ -287,6 +287,8 @@ int snd_emu10k1_memblk_map(struct snd_emu10k1 *emu, struct snd_emu10k1_memblk *b
287 return err; 287 return err;
288} 288}
289 289
290EXPORT_SYMBOL(snd_emu10k1_memblk_map);
291
290/* 292/*
291 * page allocation for DMA 293 * page allocation for DMA
292 */ 294 */
@@ -387,6 +389,7 @@ snd_emu10k1_synth_alloc(struct snd_emu10k1 *hw, unsigned int size)
387 return (struct snd_util_memblk *)blk; 389 return (struct snd_util_memblk *)blk;
388} 390}
389 391
392EXPORT_SYMBOL(snd_emu10k1_synth_alloc);
390 393
391/* 394/*
392 * free a synth sample area 395 * free a synth sample area
@@ -409,6 +412,7 @@ snd_emu10k1_synth_free(struct snd_emu10k1 *emu, struct snd_util_memblk *memblk)
409 return 0; 412 return 0;
410} 413}
411 414
415EXPORT_SYMBOL(snd_emu10k1_synth_free);
412 416
413/* check new allocation range */ 417/* check new allocation range */
414static void get_single_page_range(struct snd_util_memhdr *hdr, 418static void get_single_page_range(struct snd_util_memhdr *hdr,
@@ -540,6 +544,8 @@ int snd_emu10k1_synth_bzero(struct snd_emu10k1 *emu, struct snd_util_memblk *blk
540 return 0; 544 return 0;
541} 545}
542 546
547EXPORT_SYMBOL(snd_emu10k1_synth_bzero);
548
543/* 549/*
544 * copy_from_user(blk + offset, data, size) 550 * copy_from_user(blk + offset, data, size)
545 */ 551 */
@@ -568,3 +574,5 @@ int snd_emu10k1_synth_copy_from_user(struct snd_emu10k1 *emu, struct snd_util_me
568 } while (offset < end_offset); 574 } while (offset < end_offset);
569 return 0; 575 return 0;
570} 576}
577
578EXPORT_SYMBOL(snd_emu10k1_synth_copy_from_user);
diff --git a/sound/pci/emu10k1/p17v.h b/sound/pci/emu10k1/p17v.h
new file mode 100644
index 000000000000..7ddb5be632cf
--- /dev/null
+++ b/sound/pci/emu10k1/p17v.h
@@ -0,0 +1,111 @@
1/*
2 * Copyright (c) by James Courtier-Dutton <James@superbug.demon.co.uk>
3 * Driver p17v chips
4 * Version: 0.01
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 *
20 */
21
22/******************************************************************************/
23/* Audigy2Value Tina (P17V) pointer-offset register set,
24 * accessed through the PTR20 and DATA24 registers */
25/******************************************************************************/
26
27/* 00 - 07: Not used */
28#define P17V_PLAYBACK_FIFO_PTR 0x08 /* Current playback fifo pointer
29 * and number of sound samples in cache.
30 */
31/* 09 - 12: Not used */
32#define P17V_CAPTURE_FIFO_PTR 0x13 /* Current capture fifo pointer
33 * and number of sound samples in cache.
34 */
35/* 14 - 17: Not used */
36#define P17V_PB_CHN_SEL 0x18 /* P17v playback channel select */
37#define P17V_SE_SLOT_SEL_L 0x19 /* Sound Engine slot select low */
38#define P17V_SE_SLOT_SEL_H 0x1a /* Sound Engine slot select high */
39/* 1b - 1f: Not used */
40/* 20 - 2f: Not used */
41/* 30 - 3b: Not used */
42#define P17V_SPI 0x3c /* SPI interface register */
43#define P17V_I2C_ADDR 0x3d /* I2C Address */
44#define P17V_I2C_0 0x3e /* I2C Data */
45#define P17V_I2C_1 0x3f /* I2C Data */
46
47#define P17V_START_AUDIO 0x40 /* Start Audio bit */
48/* 41 - 47: Reserved */
49#define P17V_START_CAPTURE 0x48 /* Start Capture bit */
50#define P17V_CAPTURE_FIFO_BASE 0x49 /* Record FIFO base address */
51#define P17V_CAPTURE_FIFO_SIZE 0x4a /* Record FIFO buffer size */
52#define P17V_CAPTURE_FIFO_INDEX 0x4b /* Record FIFO capture index */
53#define P17V_CAPTURE_VOL_H 0x4c /* P17v capture volume control */
54#define P17V_CAPTURE_VOL_L 0x4d /* P17v capture volume control */
55/* 4e - 4f: Not used */
56/* 50 - 5f: Not used */
57#define P17V_SRCSel 0x60 /* SRC48 and SRCMulti sample rate select
58 * and output select
59 */
60#define P17V_MIXER_AC97_10K1_VOL_L 0x61 /* 10K to Mixer_AC97 input volume control */
61#define P17V_MIXER_AC97_10K1_VOL_H 0x62 /* 10K to Mixer_AC97 input volume control */
62#define P17V_MIXER_AC97_P17V_VOL_L 0x63 /* P17V to Mixer_AC97 input volume control */
63#define P17V_MIXER_AC97_P17V_VOL_H 0x64 /* P17V to Mixer_AC97 input volume control */
64#define P17V_MIXER_AC97_SRP_REC_VOL_L 0x65 /* SRP Record to Mixer_AC97 input volume control */
65#define P17V_MIXER_AC97_SRP_REC_VOL_H 0x66 /* SRP Record to Mixer_AC97 input volume control */
66/* 67 - 68: Reserved */
67#define P17V_MIXER_Spdif_10K1_VOL_L 0x69 /* 10K to Mixer_Spdif input volume control */
68#define P17V_MIXER_Spdif_10K1_VOL_H 0x6A /* 10K to Mixer_Spdif input volume control */
69#define P17V_MIXER_Spdif_P17V_VOL_L 0x6B /* P17V to Mixer_Spdif input volume control */
70#define P17V_MIXER_Spdif_P17V_VOL_H 0x6C /* P17V to Mixer_Spdif input volume control */
71#define P17V_MIXER_Spdif_SRP_REC_VOL_L 0x6D /* SRP Record to Mixer_Spdif input volume control */
72#define P17V_MIXER_Spdif_SRP_REC_VOL_H 0x6E /* SRP Record to Mixer_Spdif input volume control */
73/* 6f - 70: Reserved */
74#define P17V_MIXER_I2S_10K1_VOL_L 0x71 /* 10K to Mixer_I2S input volume control */
75#define P17V_MIXER_I2S_10K1_VOL_H 0x72 /* 10K to Mixer_I2S input volume control */
76#define P17V_MIXER_I2S_P17V_VOL_L 0x73 /* P17V to Mixer_I2S input volume control */
77#define P17V_MIXER_I2S_P17V_VOL_H 0x74 /* P17V to Mixer_I2S input volume control */
78#define P17V_MIXER_I2S_SRP_REC_VOL_L 0x75 /* SRP Record to Mixer_I2S input volume control */
79#define P17V_MIXER_I2S_SRP_REC_VOL_H 0x76 /* SRP Record to Mixer_I2S input volume control */
80/* 77 - 78: Reserved */
81#define P17V_MIXER_AC97_ENABLE 0x79 /* Mixer AC97 input audio enable */
82#define P17V_MIXER_SPDIF_ENABLE 0x7A /* Mixer SPDIF input audio enable */
83#define P17V_MIXER_I2S_ENABLE 0x7B /* Mixer I2S input audio enable */
84#define P17V_AUDIO_OUT_ENABLE 0x7C /* Audio out enable */
85#define P17V_MIXER_ATT 0x7D /* SRP Mixer Attenuation Select */
86#define P17V_SRP_RECORD_SRR 0x7E /* SRP Record channel source Select */
87#define P17V_SOFT_RESET_SRP_MIXER 0x7F /* SRP and mixer soft reset */
88
89#define P17V_AC97_OUT_MASTER_VOL_L 0x80 /* AC97 Output master volume control */
90#define P17V_AC97_OUT_MASTER_VOL_H 0x81 /* AC97 Output master volume control */
91#define P17V_SPDIF_OUT_MASTER_VOL_L 0x82 /* SPDIF Output master volume control */
92#define P17V_SPDIF_OUT_MASTER_VOL_H 0x83 /* SPDIF Output master volume control */
93#define P17V_I2S_OUT_MASTER_VOL_L 0x84 /* I2S Output master volume control */
94#define P17V_I2S_OUT_MASTER_VOL_H 0x85 /* I2S Output master volume control */
95/* 86 - 87: Not used */
96#define P17V_I2S_CHANNEL_SWAP_PHASE_INVERSE 0x88 /* I2S out mono channel swap
97 * and phase inverse */
98#define P17V_SPDIF_CHANNEL_SWAP_PHASE_INVERSE 0x89 /* SPDIF out mono channel swap
99 * and phase inverse */
100/* 8A: Not used */
101#define P17V_SRP_P17V_ESR 0x8B /* SRP_P17V estimated sample rate and rate lock */
102#define P17V_SRP_REC_ESR 0x8C /* SRP_REC estimated sample rate and rate lock */
103#define P17V_SRP_BYPASS 0x8D /* srps channel bypass and srps bypass */
104/* 8E - 92: Not used */
105#define P17V_I2S_SRC_SEL 0x93 /* I2SIN mode sel */
106
107
108
109
110
111
diff --git a/sound/pci/emu10k1/tina2.h b/sound/pci/emu10k1/tina2.h
index 5c43abf03e89..f2d8eb6c89e1 100644
--- a/sound/pci/emu10k1/tina2.h
+++ b/sound/pci/emu10k1/tina2.h
@@ -1,11 +1,7 @@
1/* 1/*
2 * Copyright (c) by James Courtier-Dutton <James@superbug.demon.co.uk> 2 * Copyright (c) by James Courtier-Dutton <James@superbug.demon.co.uk>
3 * Driver p16v chips 3 * Driver tina2 chips
4 * Version: 0.21 4 * Version: 0.1
5 *
6 *
7 * This code was initally based on code from ALSA's emu10k1x.c which is:
8 * Copyright (c) by Francisco Moraes <fmoraes@nc.rr.com>
9 * 5 *
10 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by 7 * it under the terms of the GNU General Public License as published by
diff --git a/sound/pci/emu10k1/voice.c b/sound/pci/emu10k1/voice.c
index 56ffb7dc3ee2..94eca82dd4fc 100644
--- a/sound/pci/emu10k1/voice.c
+++ b/sound/pci/emu10k1/voice.c
@@ -139,6 +139,8 @@ int snd_emu10k1_voice_alloc(struct snd_emu10k1 *emu, int type, int number,
139 return result; 139 return result;
140} 140}
141 141
142EXPORT_SYMBOL(snd_emu10k1_voice_alloc);
143
142int snd_emu10k1_voice_free(struct snd_emu10k1 *emu, 144int snd_emu10k1_voice_free(struct snd_emu10k1 *emu,
143 struct snd_emu10k1_voice *pvoice) 145 struct snd_emu10k1_voice *pvoice)
144{ 146{
@@ -153,3 +155,5 @@ int snd_emu10k1_voice_free(struct snd_emu10k1 *emu,
153 spin_unlock_irqrestore(&emu->voice_lock, flags); 155 spin_unlock_irqrestore(&emu->voice_lock, flags);
154 return 0; 156 return 0;
155} 157}
158
159EXPORT_SYMBOL(snd_emu10k1_voice_free);
diff --git a/sound/pci/ens1370.c b/sound/pci/ens1370.c
index ca9e34e88f62..9d46bbee2a40 100644
--- a/sound/pci/ens1370.c
+++ b/sound/pci/ens1370.c
@@ -1915,7 +1915,7 @@ static void __devinit snd_ensoniq_proc_init(struct ensoniq * ensoniq)
1915 struct snd_info_entry *entry; 1915 struct snd_info_entry *entry;
1916 1916
1917 if (! snd_card_proc_new(ensoniq->card, "audiopci", &entry)) 1917 if (! snd_card_proc_new(ensoniq->card, "audiopci", &entry))
1918 snd_info_set_text_ops(entry, ensoniq, 1024, snd_ensoniq_proc_read); 1918 snd_info_set_text_ops(entry, ensoniq, snd_ensoniq_proc_read);
1919} 1919}
1920 1920
1921/* 1921/*
diff --git a/sound/pci/es1938.c b/sound/pci/es1938.c
index 6f9094ca4fb4..ca6603fe0b11 100644
--- a/sound/pci/es1938.c
+++ b/sound/pci/es1938.c
@@ -1756,7 +1756,8 @@ static int __devinit snd_es1938_probe(struct pci_dev *pci,
1756 } 1756 }
1757 } 1757 }
1758 if (snd_mpu401_uart_new(card, 0, MPU401_HW_MPU401, 1758 if (snd_mpu401_uart_new(card, 0, MPU401_HW_MPU401,
1759 chip->mpu_port, 1, chip->irq, 0, &chip->rmidi) < 0) { 1759 chip->mpu_port, MPU401_INFO_INTEGRATED,
1760 chip->irq, 0, &chip->rmidi) < 0) {
1760 printk(KERN_ERR "es1938: unable to initialize MPU-401\n"); 1761 printk(KERN_ERR "es1938: unable to initialize MPU-401\n");
1761 } else { 1762 } else {
1762 // this line is vital for MIDI interrupt handling on ess-solo1 1763 // this line is vital for MIDI interrupt handling on ess-solo1
diff --git a/sound/pci/es1968.c b/sound/pci/es1968.c
index 5ff4175c7b6d..bfa0876e715e 100644
--- a/sound/pci/es1968.c
+++ b/sound/pci/es1968.c
@@ -132,7 +132,7 @@ static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card *
132static int total_bufsize[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1024 }; 132static int total_bufsize[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1024 };
133static int pcm_substreams_p[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 4 }; 133static int pcm_substreams_p[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 4 };
134static int pcm_substreams_c[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1 }; 134static int pcm_substreams_c[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1 };
135static int clock[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 0}; 135static int clock[SNDRV_CARDS];
136static int use_pm[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 2}; 136static int use_pm[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 2};
137static int enable_mpu[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 2}; 137static int enable_mpu[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 2};
138#ifdef SUPPORT_JOYSTICK 138#ifdef SUPPORT_JOYSTICK
@@ -2727,7 +2727,8 @@ static int __devinit snd_es1968_probe(struct pci_dev *pci,
2727 } 2727 }
2728 if (enable_mpu[dev]) { 2728 if (enable_mpu[dev]) {
2729 if ((err = snd_mpu401_uart_new(card, 0, MPU401_HW_MPU401, 2729 if ((err = snd_mpu401_uart_new(card, 0, MPU401_HW_MPU401,
2730 chip->io_port + ESM_MPU401_PORT, 1, 2730 chip->io_port + ESM_MPU401_PORT,
2731 MPU401_INFO_INTEGRATED,
2731 chip->irq, 0, &chip->rmidi)) < 0) { 2732 chip->irq, 0, &chip->rmidi)) < 0) {
2732 printk(KERN_WARNING "es1968: skipping MPU-401 MIDI support..\n"); 2733 printk(KERN_WARNING "es1968: skipping MPU-401 MIDI support..\n");
2733 } 2734 }
diff --git a/sound/pci/fm801.c b/sound/pci/fm801.c
index d72fc28c580e..0afa573dd244 100644
--- a/sound/pci/fm801.c
+++ b/sound/pci/fm801.c
@@ -56,7 +56,7 @@ static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card *
56 * 3 = MediaForte 64-PCR 56 * 3 = MediaForte 64-PCR
57 * High 16-bits are video (radio) device number + 1 57 * High 16-bits are video (radio) device number + 1
58 */ 58 */
59static int tea575x_tuner[SNDRV_CARDS] = { [0 ... (SNDRV_CARDS-1)] = 0 }; 59static int tea575x_tuner[SNDRV_CARDS];
60 60
61module_param_array(index, int, NULL, 0444); 61module_param_array(index, int, NULL, 0444);
62MODULE_PARM_DESC(index, "Index value for the FM801 soundcard."); 62MODULE_PARM_DESC(index, "Index value for the FM801 soundcard.");
@@ -1448,7 +1448,8 @@ static int __devinit snd_card_fm801_probe(struct pci_dev *pci,
1448 return err; 1448 return err;
1449 } 1449 }
1450 if ((err = snd_mpu401_uart_new(card, 0, MPU401_HW_FM801, 1450 if ((err = snd_mpu401_uart_new(card, 0, MPU401_HW_FM801,
1451 FM801_REG(chip, MPU401_DATA), 1, 1451 FM801_REG(chip, MPU401_DATA),
1452 MPU401_INFO_INTEGRATED,
1452 chip->irq, 0, &chip->rmidi)) < 0) { 1453 chip->irq, 0, &chip->rmidi)) < 0) {
1453 snd_card_free(card); 1454 snd_card_free(card);
1454 return err; 1455 return err;
diff --git a/sound/pci/hda/Makefile b/sound/pci/hda/Makefile
index ddfb5ff7fb8f..dbacba6177db 100644
--- a/sound/pci/hda/Makefile
+++ b/sound/pci/hda/Makefile
@@ -1,5 +1,5 @@
1snd-hda-intel-objs := hda_intel.o 1snd-hda-intel-objs := hda_intel.o
2snd-hda-codec-objs := hda_codec.o hda_generic.o patch_realtek.o patch_cmedia.o patch_analog.o patch_sigmatel.o patch_si3054.o 2snd-hda-codec-objs := hda_codec.o hda_generic.o patch_realtek.o patch_cmedia.o patch_analog.o patch_sigmatel.o patch_si3054.o patch_atihdmi.o
3ifdef CONFIG_PROC_FS 3ifdef CONFIG_PROC_FS
4snd-hda-codec-objs += hda_proc.o 4snd-hda-codec-objs += hda_proc.o
5endif 5endif
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
index 5bee3b536478..8c2a8174ece1 100644
--- a/sound/pci/hda/hda_codec.c
+++ b/sound/pci/hda/hda_codec.c
@@ -86,6 +86,8 @@ unsigned int snd_hda_codec_read(struct hda_codec *codec, hda_nid_t nid, int dire
86 return res; 86 return res;
87} 87}
88 88
89EXPORT_SYMBOL(snd_hda_codec_read);
90
89/** 91/**
90 * snd_hda_codec_write - send a single command without waiting for response 92 * snd_hda_codec_write - send a single command without waiting for response
91 * @codec: the HDA codec 93 * @codec: the HDA codec
@@ -108,6 +110,8 @@ int snd_hda_codec_write(struct hda_codec *codec, hda_nid_t nid, int direct,
108 return err; 110 return err;
109} 111}
110 112
113EXPORT_SYMBOL(snd_hda_codec_write);
114
111/** 115/**
112 * snd_hda_sequence_write - sequence writes 116 * snd_hda_sequence_write - sequence writes
113 * @codec: the HDA codec 117 * @codec: the HDA codec
@@ -122,6 +126,8 @@ void snd_hda_sequence_write(struct hda_codec *codec, const struct hda_verb *seq)
122 snd_hda_codec_write(codec, seq->nid, 0, seq->verb, seq->param); 126 snd_hda_codec_write(codec, seq->nid, 0, seq->verb, seq->param);
123} 127}
124 128
129EXPORT_SYMBOL(snd_hda_sequence_write);
130
125/** 131/**
126 * snd_hda_get_sub_nodes - get the range of sub nodes 132 * snd_hda_get_sub_nodes - get the range of sub nodes
127 * @codec: the HDA codec 133 * @codec: the HDA codec
@@ -140,6 +146,8 @@ int snd_hda_get_sub_nodes(struct hda_codec *codec, hda_nid_t nid, hda_nid_t *sta
140 return (int)(parm & 0x7fff); 146 return (int)(parm & 0x7fff);
141} 147}
142 148
149EXPORT_SYMBOL(snd_hda_get_sub_nodes);
150
143/** 151/**
144 * snd_hda_get_connections - get connection list 152 * snd_hda_get_connections - get connection list
145 * @codec: the HDA codec 153 * @codec: the HDA codec
@@ -256,6 +264,8 @@ int snd_hda_queue_unsol_event(struct hda_bus *bus, u32 res, u32 res_ex)
256 return 0; 264 return 0;
257} 265}
258 266
267EXPORT_SYMBOL(snd_hda_queue_unsol_event);
268
259/* 269/*
260 * process queueud unsolicited events 270 * process queueud unsolicited events
261 */ 271 */
@@ -384,6 +394,7 @@ int snd_hda_bus_new(struct snd_card *card, const struct hda_bus_template *temp,
384 return 0; 394 return 0;
385} 395}
386 396
397EXPORT_SYMBOL(snd_hda_bus_new);
387 398
388/* 399/*
389 * find a matching codec preset 400 * find a matching codec preset
@@ -587,6 +598,8 @@ int snd_hda_codec_new(struct hda_bus *bus, unsigned int codec_addr,
587 return 0; 598 return 0;
588} 599}
589 600
601EXPORT_SYMBOL(snd_hda_codec_new);
602
590/** 603/**
591 * snd_hda_codec_setup_stream - set up the codec for streaming 604 * snd_hda_codec_setup_stream - set up the codec for streaming
592 * @codec: the CODEC to set up 605 * @codec: the CODEC to set up
@@ -609,6 +622,7 @@ void snd_hda_codec_setup_stream(struct hda_codec *codec, hda_nid_t nid, u32 stre
609 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_STREAM_FORMAT, format); 622 snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_STREAM_FORMAT, format);
610} 623}
611 624
625EXPORT_SYMBOL(snd_hda_codec_setup_stream);
612 626
613/* 627/*
614 * amp access functions 628 * amp access functions
@@ -1294,6 +1308,7 @@ int snd_hda_build_controls(struct hda_bus *bus)
1294 return 0; 1308 return 0;
1295} 1309}
1296 1310
1311EXPORT_SYMBOL(snd_hda_build_controls);
1297 1312
1298/* 1313/*
1299 * stream formats 1314 * stream formats
@@ -1382,6 +1397,8 @@ unsigned int snd_hda_calc_stream_format(unsigned int rate,
1382 return val; 1397 return val;
1383} 1398}
1384 1399
1400EXPORT_SYMBOL(snd_hda_calc_stream_format);
1401
1385/** 1402/**
1386 * snd_hda_query_supported_pcm - query the supported PCM rates and formats 1403 * snd_hda_query_supported_pcm - query the supported PCM rates and formats
1387 * @codec: the HDA codec 1404 * @codec: the HDA codec
@@ -1663,6 +1680,7 @@ int snd_hda_build_pcms(struct hda_bus *bus)
1663 return 0; 1680 return 0;
1664} 1681}
1665 1682
1683EXPORT_SYMBOL(snd_hda_build_pcms);
1666 1684
1667/** 1685/**
1668 * snd_hda_check_board_config - compare the current codec with the config table 1686 * snd_hda_check_board_config - compare the current codec with the config table
@@ -2165,6 +2183,8 @@ int snd_hda_suspend(struct hda_bus *bus, pm_message_t state)
2165 return 0; 2183 return 0;
2166} 2184}
2167 2185
2186EXPORT_SYMBOL(snd_hda_suspend);
2187
2168/** 2188/**
2169 * snd_hda_resume - resume the codecs 2189 * snd_hda_resume - resume the codecs
2170 * @bus: the HDA bus 2190 * @bus: the HDA bus
@@ -2187,6 +2207,8 @@ int snd_hda_resume(struct hda_bus *bus)
2187 return 0; 2207 return 0;
2188} 2208}
2189 2209
2210EXPORT_SYMBOL(snd_hda_resume);
2211
2190/** 2212/**
2191 * snd_hda_resume_ctls - resume controls in the new control list 2213 * snd_hda_resume_ctls - resume controls in the new control list
2192 * @codec: the HDA codec 2214 * @codec: the HDA codec
@@ -2247,25 +2269,6 @@ int snd_hda_resume_spdif_in(struct hda_codec *codec)
2247#endif 2269#endif
2248 2270
2249/* 2271/*
2250 * symbols exported for controller modules
2251 */
2252EXPORT_SYMBOL(snd_hda_codec_read);
2253EXPORT_SYMBOL(snd_hda_codec_write);
2254EXPORT_SYMBOL(snd_hda_sequence_write);
2255EXPORT_SYMBOL(snd_hda_get_sub_nodes);
2256EXPORT_SYMBOL(snd_hda_queue_unsol_event);
2257EXPORT_SYMBOL(snd_hda_bus_new);
2258EXPORT_SYMBOL(snd_hda_codec_new);
2259EXPORT_SYMBOL(snd_hda_codec_setup_stream);
2260EXPORT_SYMBOL(snd_hda_calc_stream_format);
2261EXPORT_SYMBOL(snd_hda_build_pcms);
2262EXPORT_SYMBOL(snd_hda_build_controls);
2263#ifdef CONFIG_PM
2264EXPORT_SYMBOL(snd_hda_suspend);
2265EXPORT_SYMBOL(snd_hda_resume);
2266#endif
2267
2268/*
2269 * INIT part 2272 * INIT part
2270 */ 2273 */
2271 2274
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index e821d65afa11..4070b5cd9b6b 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -82,6 +82,7 @@ MODULE_SUPPORTED_DEVICE("{{Intel, ICH6},"
82 "{Intel, ICH8}," 82 "{Intel, ICH8},"
83 "{ATI, SB450}," 83 "{ATI, SB450},"
84 "{ATI, SB600}," 84 "{ATI, SB600},"
85 "{ATI, RS600},"
85 "{VIA, VT8251}," 86 "{VIA, VT8251},"
86 "{VIA, VT8237A}," 87 "{VIA, VT8237A},"
87 "{SiS, SIS966}," 88 "{SiS, SIS966},"
@@ -167,6 +168,12 @@ enum { SDI0, SDI1, SDI2, SDI3, SDO0, SDO1, SDO2, SDO3 };
167#define ULI_PLAYBACK_INDEX 5 168#define ULI_PLAYBACK_INDEX 5
168#define ULI_NUM_PLAYBACK 6 169#define ULI_NUM_PLAYBACK 6
169 170
171/* ATI HDMI has 1 playback and 0 capture */
172#define ATIHDMI_CAPTURE_INDEX 0
173#define ATIHDMI_NUM_CAPTURE 0
174#define ATIHDMI_PLAYBACK_INDEX 0
175#define ATIHDMI_NUM_PLAYBACK 1
176
170/* this number is statically defined for simplicity */ 177/* this number is statically defined for simplicity */
171#define MAX_AZX_DEV 16 178#define MAX_AZX_DEV 16
172 179
@@ -331,6 +338,7 @@ struct azx {
331enum { 338enum {
332 AZX_DRIVER_ICH, 339 AZX_DRIVER_ICH,
333 AZX_DRIVER_ATI, 340 AZX_DRIVER_ATI,
341 AZX_DRIVER_ATIHDMI,
334 AZX_DRIVER_VIA, 342 AZX_DRIVER_VIA,
335 AZX_DRIVER_SIS, 343 AZX_DRIVER_SIS,
336 AZX_DRIVER_ULI, 344 AZX_DRIVER_ULI,
@@ -340,6 +348,7 @@ enum {
340static char *driver_short_names[] __devinitdata = { 348static char *driver_short_names[] __devinitdata = {
341 [AZX_DRIVER_ICH] = "HDA Intel", 349 [AZX_DRIVER_ICH] = "HDA Intel",
342 [AZX_DRIVER_ATI] = "HDA ATI SB", 350 [AZX_DRIVER_ATI] = "HDA ATI SB",
351 [AZX_DRIVER_ATIHDMI] = "HDA ATI HDMI",
343 [AZX_DRIVER_VIA] = "HDA VIA VT82xx", 352 [AZX_DRIVER_VIA] = "HDA VIA VT82xx",
344 [AZX_DRIVER_SIS] = "HDA SIS966", 353 [AZX_DRIVER_SIS] = "HDA SIS966",
345 [AZX_DRIVER_ULI] = "HDA ULI M5461", 354 [AZX_DRIVER_ULI] = "HDA ULI M5461",
@@ -1393,10 +1402,10 @@ static int azx_free(struct azx *chip)
1393 msleep(1); 1402 msleep(1);
1394 } 1403 }
1395 1404
1396 if (chip->remap_addr)
1397 iounmap(chip->remap_addr);
1398 if (chip->irq >= 0) 1405 if (chip->irq >= 0)
1399 free_irq(chip->irq, (void*)chip); 1406 free_irq(chip->irq, (void*)chip);
1407 if (chip->remap_addr)
1408 iounmap(chip->remap_addr);
1400 1409
1401 if (chip->bdl.area) 1410 if (chip->bdl.area)
1402 snd_dma_free_pages(&chip->bdl); 1411 snd_dma_free_pages(&chip->bdl);
@@ -1495,6 +1504,12 @@ static int __devinit azx_create(struct snd_card *card, struct pci_dev *pci,
1495 chip->playback_index_offset = ULI_PLAYBACK_INDEX; 1504 chip->playback_index_offset = ULI_PLAYBACK_INDEX;
1496 chip->capture_index_offset = ULI_CAPTURE_INDEX; 1505 chip->capture_index_offset = ULI_CAPTURE_INDEX;
1497 break; 1506 break;
1507 case AZX_DRIVER_ATIHDMI:
1508 chip->playback_streams = ATIHDMI_NUM_PLAYBACK;
1509 chip->capture_streams = ATIHDMI_NUM_CAPTURE;
1510 chip->playback_index_offset = ATIHDMI_PLAYBACK_INDEX;
1511 chip->capture_index_offset = ATIHDMI_CAPTURE_INDEX;
1512 break;
1498 default: 1513 default:
1499 chip->playback_streams = ICH6_NUM_PLAYBACK; 1514 chip->playback_streams = ICH6_NUM_PLAYBACK;
1500 chip->capture_streams = ICH6_NUM_CAPTURE; 1515 chip->capture_streams = ICH6_NUM_CAPTURE;
@@ -1621,6 +1636,7 @@ static struct pci_device_id azx_ids[] __devinitdata = {
1621 { 0x8086, 0x284b, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_ICH }, /* ICH8 */ 1636 { 0x8086, 0x284b, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_ICH }, /* ICH8 */
1622 { 0x1002, 0x437b, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_ATI }, /* ATI SB450 */ 1637 { 0x1002, 0x437b, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_ATI }, /* ATI SB450 */
1623 { 0x1002, 0x4383, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_ATI }, /* ATI SB600 */ 1638 { 0x1002, 0x4383, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_ATI }, /* ATI SB600 */
1639 { 0x1002, 0x793b, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_ATIHDMI }, /* ATI RS600 HDMI */
1624 { 0x1106, 0x3288, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_VIA }, /* VIA VT8251/VT8237A */ 1640 { 0x1106, 0x3288, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_VIA }, /* VIA VT8251/VT8237A */
1625 { 0x1039, 0x7502, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_SIS }, /* SIS966 */ 1641 { 0x1039, 0x7502, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_SIS }, /* SIS966 */
1626 { 0x10b9, 0x5461, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_ULI }, /* ULI M5461 */ 1642 { 0x10b9, 0x5461, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_ULI }, /* ULI M5461 */
diff --git a/sound/pci/hda/hda_patch.h b/sound/pci/hda/hda_patch.h
index acaef3c811b8..0b668793face 100644
--- a/sound/pci/hda/hda_patch.h
+++ b/sound/pci/hda/hda_patch.h
@@ -12,6 +12,8 @@ extern struct hda_codec_preset snd_hda_preset_analog[];
12extern struct hda_codec_preset snd_hda_preset_sigmatel[]; 12extern struct hda_codec_preset snd_hda_preset_sigmatel[];
13/* SiLabs 3054/3055 modem codecs */ 13/* SiLabs 3054/3055 modem codecs */
14extern struct hda_codec_preset snd_hda_preset_si3054[]; 14extern struct hda_codec_preset snd_hda_preset_si3054[];
15/* ATI HDMI codecs */
16extern struct hda_codec_preset snd_hda_preset_atihdmi[];
15 17
16static const struct hda_codec_preset *hda_preset_tables[] = { 18static const struct hda_codec_preset *hda_preset_tables[] = {
17 snd_hda_preset_realtek, 19 snd_hda_preset_realtek,
@@ -19,5 +21,6 @@ static const struct hda_codec_preset *hda_preset_tables[] = {
19 snd_hda_preset_analog, 21 snd_hda_preset_analog,
20 snd_hda_preset_sigmatel, 22 snd_hda_preset_sigmatel,
21 snd_hda_preset_si3054, 23 snd_hda_preset_si3054,
24 snd_hda_preset_atihdmi,
22 NULL 25 NULL
23}; 26};
diff --git a/sound/pci/hda/hda_proc.c b/sound/pci/hda/hda_proc.c
index ca514a6a5875..c2f0fe85bf35 100644
--- a/sound/pci/hda/hda_proc.c
+++ b/sound/pci/hda/hda_proc.c
@@ -182,6 +182,10 @@ static void print_pin_caps(struct snd_info_buffer *buffer,
182 snd_iprintf(buffer, " OUT"); 182 snd_iprintf(buffer, " OUT");
183 if (caps & AC_PINCAP_HP_DRV) 183 if (caps & AC_PINCAP_HP_DRV)
184 snd_iprintf(buffer, " HP"); 184 snd_iprintf(buffer, " HP");
185 if (caps & AC_PINCAP_EAPD)
186 snd_iprintf(buffer, " EAPD");
187 if (caps & AC_PINCAP_PRES_DETECT)
188 snd_iprintf(buffer, " Detect");
185 snd_iprintf(buffer, "\n"); 189 snd_iprintf(buffer, "\n");
186 caps = snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_CONFIG_DEFAULT, 0); 190 caps = snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_CONFIG_DEFAULT, 0);
187 snd_iprintf(buffer, " Pin Default 0x%08x: [%s] %s at %s %s\n", caps, 191 snd_iprintf(buffer, " Pin Default 0x%08x: [%s] %s at %s %s\n", caps,
@@ -318,7 +322,7 @@ int snd_hda_codec_proc_new(struct hda_codec *codec)
318 if (err < 0) 322 if (err < 0)
319 return err; 323 return err;
320 324
321 snd_info_set_text_ops(entry, codec, 32 * 1024, print_codec_info); 325 snd_info_set_text_ops(entry, codec, print_codec_info);
322 return 0; 326 return 0;
323} 327}
324 328
diff --git a/sound/pci/hda/patch_analog.c b/sound/pci/hda/patch_analog.c
index 40f000ba1362..dd4e00a82b55 100644
--- a/sound/pci/hda/patch_analog.c
+++ b/sound/pci/hda/patch_analog.c
@@ -789,6 +789,8 @@ static struct hda_board_config ad1986a_cfg_tbl[] = {
789 { .modelname = "3stack", .config = AD1986A_3STACK }, 789 { .modelname = "3stack", .config = AD1986A_3STACK },
790 { .pci_subvendor = 0x10de, .pci_subdevice = 0xcb84, 790 { .pci_subvendor = 0x10de, .pci_subdevice = 0xcb84,
791 .config = AD1986A_3STACK }, /* ASUS A8N-VM CSM */ 791 .config = AD1986A_3STACK }, /* ASUS A8N-VM CSM */
792 { .pci_subvendor = 0x1043, .pci_subdevice = 0x81b3,
793 .config = AD1986A_3STACK }, /* ASUS P5RD2-VM / P5GPL-X SE */
792 { .modelname = "laptop", .config = AD1986A_LAPTOP }, 794 { .modelname = "laptop", .config = AD1986A_LAPTOP },
793 { .pci_subvendor = 0x144d, .pci_subdevice = 0xc01e, 795 { .pci_subvendor = 0x144d, .pci_subdevice = 0xc01e,
794 .config = AD1986A_LAPTOP }, /* FSC V2060 */ 796 .config = AD1986A_LAPTOP }, /* FSC V2060 */
@@ -809,6 +811,8 @@ static struct hda_board_config ad1986a_cfg_tbl[] = {
809 .config = AD1986A_LAPTOP_EAPD }, /* ASUS Z62F */ 811 .config = AD1986A_LAPTOP_EAPD }, /* ASUS Z62F */
810 { .pci_subvendor = 0x103c, .pci_subdevice = 0x30af, 812 { .pci_subvendor = 0x103c, .pci_subdevice = 0x30af,
811 .config = AD1986A_LAPTOP_EAPD }, /* HP Compaq Presario B2800 */ 813 .config = AD1986A_LAPTOP_EAPD }, /* HP Compaq Presario B2800 */
814 { .pci_subvendor = 0x17aa, .pci_subdevice = 0x2066,
815 .config = AD1986A_LAPTOP_EAPD }, /* Lenovo 3000 N100-07684JU */
812 {} 816 {}
813}; 817};
814 818
@@ -963,7 +967,7 @@ static struct snd_kcontrol_new ad1983_mixers[] = {
963 }, 967 },
964 { 968 {
965 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 969 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
966 .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,NONE) "Route", 970 .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,NONE) "Source",
967 .info = ad1983_spdif_route_info, 971 .info = ad1983_spdif_route_info,
968 .get = ad1983_spdif_route_get, 972 .get = ad1983_spdif_route_get,
969 .put = ad1983_spdif_route_put, 973 .put = ad1983_spdif_route_put,
@@ -1103,7 +1107,7 @@ static struct snd_kcontrol_new ad1981_mixers[] = {
1103 /* identical with AD1983 */ 1107 /* identical with AD1983 */
1104 { 1108 {
1105 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1109 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
1106 .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,NONE) "Route", 1110 .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,NONE) "Source",
1107 .info = ad1983_spdif_route_info, 1111 .info = ad1983_spdif_route_info,
1108 .get = ad1983_spdif_route_get, 1112 .get = ad1983_spdif_route_get,
1109 .put = ad1983_spdif_route_put, 1113 .put = ad1983_spdif_route_put,
@@ -1329,13 +1333,60 @@ static int ad1981_hp_init(struct hda_codec *codec)
1329 return 0; 1333 return 0;
1330} 1334}
1331 1335
1336/* configuration for Lenovo Thinkpad T60 */
1337static struct snd_kcontrol_new ad1981_thinkpad_mixers[] = {
1338 HDA_CODEC_VOLUME("Master Playback Volume", 0x05, 0x0, HDA_OUTPUT),
1339 HDA_CODEC_MUTE("Master Playback Switch", 0x05, 0x0, HDA_OUTPUT),
1340 HDA_CODEC_VOLUME("PCM Playback Volume", 0x11, 0x0, HDA_OUTPUT),
1341 HDA_CODEC_MUTE("PCM Playback Switch", 0x11, 0x0, HDA_OUTPUT),
1342 HDA_CODEC_VOLUME("Mic Playback Volume", 0x12, 0x0, HDA_OUTPUT),
1343 HDA_CODEC_MUTE("Mic Playback Switch", 0x12, 0x0, HDA_OUTPUT),
1344 HDA_CODEC_VOLUME("CD Playback Volume", 0x1d, 0x0, HDA_OUTPUT),
1345 HDA_CODEC_MUTE("CD Playback Switch", 0x1d, 0x0, HDA_OUTPUT),
1346 HDA_CODEC_VOLUME("Mic Boost", 0x08, 0x0, HDA_INPUT),
1347 HDA_CODEC_VOLUME("Capture Volume", 0x15, 0x0, HDA_OUTPUT),
1348 HDA_CODEC_MUTE("Capture Switch", 0x15, 0x0, HDA_OUTPUT),
1349 {
1350 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
1351 .name = "Capture Source",
1352 .info = ad198x_mux_enum_info,
1353 .get = ad198x_mux_enum_get,
1354 .put = ad198x_mux_enum_put,
1355 },
1356 /* identical with AD1983 */
1357 {
1358 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
1359 .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,NONE) "Source",
1360 .info = ad1983_spdif_route_info,
1361 .get = ad1983_spdif_route_get,
1362 .put = ad1983_spdif_route_put,
1363 },
1364 { } /* end */
1365};
1366
1367static struct hda_input_mux ad1981_thinkpad_capture_source = {
1368 .num_items = 3,
1369 .items = {
1370 { "Mic", 0x0 },
1371 { "Mix", 0x2 },
1372 { "CD", 0x4 },
1373 },
1374};
1375
1332/* models */ 1376/* models */
1333enum { AD1981_BASIC, AD1981_HP }; 1377enum { AD1981_BASIC, AD1981_HP, AD1981_THINKPAD };
1334 1378
1335static struct hda_board_config ad1981_cfg_tbl[] = { 1379static struct hda_board_config ad1981_cfg_tbl[] = {
1336 { .modelname = "hp", .config = AD1981_HP }, 1380 { .modelname = "hp", .config = AD1981_HP },
1337 /* All HP models */ 1381 /* All HP models */
1338 { .pci_subvendor = 0x103c, .config = AD1981_HP }, 1382 { .pci_subvendor = 0x103c, .config = AD1981_HP },
1383 { .pci_subvendor = 0x30b0, .pci_subdevice = 0x103c,
1384 .config = AD1981_HP }, /* HP nx6320 (reversed SSID, H/W bug) */
1385 { .modelname = "thinkpad", .config = AD1981_THINKPAD },
1386 /* Lenovo Thinkpad T60/X60/Z6xx */
1387 { .pci_subvendor = 0x17aa, .config = AD1981_THINKPAD },
1388 { .pci_subvendor = 0x1014, .pci_subdevice = 0x0597,
1389 .config = AD1981_THINKPAD }, /* Z60m/t */
1339 { .modelname = "basic", .config = AD1981_BASIC }, 1390 { .modelname = "basic", .config = AD1981_BASIC },
1340 {} 1391 {}
1341}; 1392};
@@ -1381,6 +1432,10 @@ static int patch_ad1981(struct hda_codec *codec)
1381 codec->patch_ops.init = ad1981_hp_init; 1432 codec->patch_ops.init = ad1981_hp_init;
1382 codec->patch_ops.unsol_event = ad1981_hp_unsol_event; 1433 codec->patch_ops.unsol_event = ad1981_hp_unsol_event;
1383 break; 1434 break;
1435 case AD1981_THINKPAD:
1436 spec->mixers[0] = ad1981_thinkpad_mixers;
1437 spec->input_mux = &ad1981_thinkpad_capture_source;
1438 break;
1384 } 1439 }
1385 1440
1386 return 0; 1441 return 0;
diff --git a/sound/pci/hda/patch_atihdmi.c b/sound/pci/hda/patch_atihdmi.c
new file mode 100644
index 000000000000..a27440ffd1c8
--- /dev/null
+++ b/sound/pci/hda/patch_atihdmi.c
@@ -0,0 +1,165 @@
1/*
2 * Universal Interface for Intel High Definition Audio Codec
3 *
4 * HD audio interface patch for ATI HDMI codecs
5 *
6 * Copyright (c) 2006 ATI Technologies Inc.
7 *
8 *
9 * This driver is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * This driver is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 */
23
24#include <sound/driver.h>
25#include <linux/init.h>
26#include <linux/delay.h>
27#include <linux/slab.h>
28#include <linux/pci.h>
29#include <sound/core.h>
30#include "hda_codec.h"
31#include "hda_local.h"
32
33struct atihdmi_spec {
34 struct hda_multi_out multiout;
35
36 struct hda_pcm pcm_rec;
37};
38
39static struct hda_verb atihdmi_basic_init[] = {
40 /* enable digital output on pin widget */
41 { 0x03, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
42 {} /* terminator */
43};
44
45/*
46 * Controls
47 */
48static int atihdmi_build_controls(struct hda_codec *codec)
49{
50 struct atihdmi_spec *spec = codec->spec;
51 int err;
52
53 err = snd_hda_create_spdif_out_ctls(codec, spec->multiout.dig_out_nid);
54 if (err < 0)
55 return err;
56
57 return 0;
58}
59
60static int atihdmi_init(struct hda_codec *codec)
61{
62 snd_hda_sequence_write(codec, atihdmi_basic_init);
63 return 0;
64}
65
66#ifdef CONFIG_PM
67/*
68 * resume
69 */
70static int atihdmi_resume(struct hda_codec *codec)
71{
72 atihdmi_init(codec);
73 snd_hda_resume_spdif_out(codec);
74
75 return 0;
76}
77#endif
78
79/*
80 * Digital out
81 */
82static int atihdmi_dig_playback_pcm_open(struct hda_pcm_stream *hinfo,
83 struct hda_codec *codec,
84 struct snd_pcm_substream *substream)
85{
86 struct atihdmi_spec *spec = codec->spec;
87 return snd_hda_multi_out_dig_open(codec, &spec->multiout);
88}
89
90static int atihdmi_dig_playback_pcm_close(struct hda_pcm_stream *hinfo,
91 struct hda_codec *codec,
92 struct snd_pcm_substream *substream)
93{
94 struct atihdmi_spec *spec = codec->spec;
95 return snd_hda_multi_out_dig_close(codec, &spec->multiout);
96}
97
98static struct hda_pcm_stream atihdmi_pcm_digital_playback = {
99 .substreams = 1,
100 .channels_min = 2,
101 .channels_max = 2,
102 .nid = 0x2, /* NID to query formats and rates and setup streams */
103 .ops = {
104 .open = atihdmi_dig_playback_pcm_open,
105 .close = atihdmi_dig_playback_pcm_close
106 },
107};
108
109static int atihdmi_build_pcms(struct hda_codec *codec)
110{
111 struct atihdmi_spec *spec = codec->spec;
112 struct hda_pcm *info = &spec->pcm_rec;
113
114 codec->num_pcms = 1;
115 codec->pcm_info = info;
116
117 info->name = "ATI HDMI";
118 info->stream[SNDRV_PCM_STREAM_PLAYBACK] = atihdmi_pcm_digital_playback;
119
120 return 0;
121}
122
123static void atihdmi_free(struct hda_codec *codec)
124{
125 kfree(codec->spec);
126}
127
128static struct hda_codec_ops atihdmi_patch_ops = {
129 .build_controls = atihdmi_build_controls,
130 .build_pcms = atihdmi_build_pcms,
131 .init = atihdmi_init,
132 .free = atihdmi_free,
133#ifdef CONFIG_PM
134 .resume = atihdmi_resume,
135#endif
136};
137
138static int patch_atihdmi(struct hda_codec *codec)
139{
140 struct atihdmi_spec *spec;
141
142 spec = kzalloc(sizeof(*spec), GFP_KERNEL);
143 if (spec == NULL)
144 return -ENOMEM;
145
146 codec->spec = spec;
147
148 spec->multiout.num_dacs = 0; /* no analog */
149 spec->multiout.max_channels = 2;
150 spec->multiout.dig_out_nid = 0x2; /* NID for copying analog to digital,
151 * seems to be unused in pure-digital
152 * case. */
153
154 codec->patch_ops = atihdmi_patch_ops;
155
156 return 0;
157}
158
159/*
160 * patch entries
161 */
162struct hda_codec_preset snd_hda_preset_atihdmi[] = {
163 { .id = 0x1002793c, .name = "ATI RS600 HDMI", .patch = patch_atihdmi },
164 {} /* terminator */
165};
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index f0e9a9c90780..98b9f16c26ff 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -2174,6 +2174,7 @@ static struct hda_board_config alc880_cfg_tbl[] = {
2174 2174
2175 { .modelname = "lg", .config = ALC880_LG }, 2175 { .modelname = "lg", .config = ALC880_LG },
2176 { .pci_subvendor = 0x1854, .pci_subdevice = 0x003b, .config = ALC880_LG }, 2176 { .pci_subvendor = 0x1854, .pci_subdevice = 0x003b, .config = ALC880_LG },
2177 { .pci_subvendor = 0x1854, .pci_subdevice = 0x0068, .config = ALC880_LG },
2177 2178
2178 { .modelname = "lg-lw", .config = ALC880_LG_LW }, 2179 { .modelname = "lg-lw", .config = ALC880_LG_LW },
2179 { .pci_subvendor = 0x1854, .pci_subdevice = 0x0018, .config = ALC880_LG_LW }, 2180 { .pci_subvendor = 0x1854, .pci_subdevice = 0x0018, .config = ALC880_LG_LW },
@@ -3105,6 +3106,7 @@ static struct hda_verb alc260_init_verbs[] = {
3105 { } 3106 { }
3106}; 3107};
3107 3108
3109#if 0 /* should be identical with alc260_init_verbs? */
3108static struct hda_verb alc260_hp_init_verbs[] = { 3110static struct hda_verb alc260_hp_init_verbs[] = {
3109 /* Headphone and output */ 3111 /* Headphone and output */
3110 {0x10, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc0}, 3112 {0x10, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc0},
@@ -3151,6 +3153,7 @@ static struct hda_verb alc260_hp_init_verbs[] = {
3151 {0x0a, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x01 << 8))}, 3153 {0x0a, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x01 << 8))},
3152 { } 3154 { }
3153}; 3155};
3156#endif
3154 3157
3155static struct hda_verb alc260_hp_3013_init_verbs[] = { 3158static struct hda_verb alc260_hp_3013_init_verbs[] = {
3156 /* Line out and output */ 3159 /* Line out and output */
@@ -3822,12 +3825,16 @@ static struct hda_board_config alc260_cfg_tbl[] = {
3822 { .modelname = "basic", .config = ALC260_BASIC }, 3825 { .modelname = "basic", .config = ALC260_BASIC },
3823 { .pci_subvendor = 0x104d, .pci_subdevice = 0x81bb, 3826 { .pci_subvendor = 0x104d, .pci_subdevice = 0x81bb,
3824 .config = ALC260_BASIC }, /* Sony VAIO */ 3827 .config = ALC260_BASIC }, /* Sony VAIO */
3828 { .pci_subvendor = 0x104d, .pci_subdevice = 0x81cc,
3829 .config = ALC260_BASIC }, /* Sony VAIO VGN-S3HP */
3830 { .pci_subvendor = 0x104d, .pci_subdevice = 0x81cd,
3831 .config = ALC260_BASIC }, /* Sony VAIO */
3825 { .pci_subvendor = 0x152d, .pci_subdevice = 0x0729, 3832 { .pci_subvendor = 0x152d, .pci_subdevice = 0x0729,
3826 .config = ALC260_BASIC }, /* CTL Travel Master U553W */ 3833 .config = ALC260_BASIC }, /* CTL Travel Master U553W */
3827 { .modelname = "hp", .config = ALC260_HP }, 3834 { .modelname = "hp", .config = ALC260_HP },
3828 { .pci_subvendor = 0x103c, .pci_subdevice = 0x3010, .config = ALC260_HP }, 3835 { .pci_subvendor = 0x103c, .pci_subdevice = 0x3010, .config = ALC260_HP },
3829 { .pci_subvendor = 0x103c, .pci_subdevice = 0x3011, .config = ALC260_HP }, 3836 { .pci_subvendor = 0x103c, .pci_subdevice = 0x3011, .config = ALC260_HP },
3830 { .pci_subvendor = 0x103c, .pci_subdevice = 0x3012, .config = ALC260_HP }, 3837 { .pci_subvendor = 0x103c, .pci_subdevice = 0x3012, .config = ALC260_HP_3013 },
3831 { .pci_subvendor = 0x103c, .pci_subdevice = 0x3013, .config = ALC260_HP_3013 }, 3838 { .pci_subvendor = 0x103c, .pci_subdevice = 0x3013, .config = ALC260_HP_3013 },
3832 { .pci_subvendor = 0x103c, .pci_subdevice = 0x3014, .config = ALC260_HP }, 3839 { .pci_subvendor = 0x103c, .pci_subdevice = 0x3014, .config = ALC260_HP },
3833 { .pci_subvendor = 0x103c, .pci_subdevice = 0x3015, .config = ALC260_HP }, 3840 { .pci_subvendor = 0x103c, .pci_subdevice = 0x3015, .config = ALC260_HP },
@@ -3862,7 +3869,7 @@ static struct alc_config_preset alc260_presets[] = {
3862 .mixers = { alc260_base_output_mixer, 3869 .mixers = { alc260_base_output_mixer,
3863 alc260_input_mixer, 3870 alc260_input_mixer,
3864 alc260_capture_alt_mixer }, 3871 alc260_capture_alt_mixer },
3865 .init_verbs = { alc260_hp_init_verbs }, 3872 .init_verbs = { alc260_init_verbs },
3866 .num_dacs = ARRAY_SIZE(alc260_dac_nids), 3873 .num_dacs = ARRAY_SIZE(alc260_dac_nids),
3867 .dac_nids = alc260_dac_nids, 3874 .dac_nids = alc260_dac_nids,
3868 .num_adc_nids = ARRAY_SIZE(alc260_hp_adc_nids), 3875 .num_adc_nids = ARRAY_SIZE(alc260_hp_adc_nids),
@@ -4094,21 +4101,6 @@ static struct snd_kcontrol_new alc882_base_mixer[] = {
4094 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x1, HDA_INPUT), 4101 HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x1, HDA_INPUT),
4095 HDA_CODEC_VOLUME("PC Speaker Playback Volume", 0x0b, 0x05, HDA_INPUT), 4102 HDA_CODEC_VOLUME("PC Speaker Playback Volume", 0x0b, 0x05, HDA_INPUT),
4096 HDA_CODEC_MUTE("PC Speaker Playback Switch", 0x0b, 0x05, HDA_INPUT), 4103 HDA_CODEC_MUTE("PC Speaker Playback Switch", 0x0b, 0x05, HDA_INPUT),
4097 HDA_CODEC_VOLUME("Capture Volume", 0x07, 0x0, HDA_INPUT),
4098 HDA_CODEC_MUTE("Capture Switch", 0x07, 0x0, HDA_INPUT),
4099 HDA_CODEC_VOLUME_IDX("Capture Volume", 1, 0x08, 0x0, HDA_INPUT),
4100 HDA_CODEC_MUTE_IDX("Capture Switch", 1, 0x08, 0x0, HDA_INPUT),
4101 HDA_CODEC_VOLUME_IDX("Capture Volume", 2, 0x09, 0x0, HDA_INPUT),
4102 HDA_CODEC_MUTE_IDX("Capture Switch", 2, 0x09, 0x0, HDA_INPUT),
4103 {
4104 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
4105 /* .name = "Capture Source", */
4106 .name = "Input Source",
4107 .count = 3,
4108 .info = alc882_mux_enum_info,
4109 .get = alc882_mux_enum_get,
4110 .put = alc882_mux_enum_put,
4111 },
4112 { } /* end */ 4104 { } /* end */
4113}; 4105};
4114 4106
@@ -4342,8 +4334,6 @@ static struct alc_config_preset alc882_presets[] = {
4342 .num_dacs = ARRAY_SIZE(alc882_dac_nids), 4334 .num_dacs = ARRAY_SIZE(alc882_dac_nids),
4343 .dac_nids = alc882_dac_nids, 4335 .dac_nids = alc882_dac_nids,
4344 .dig_out_nid = ALC882_DIGOUT_NID, 4336 .dig_out_nid = ALC882_DIGOUT_NID,
4345 .num_adc_nids = ARRAY_SIZE(alc882_adc_nids),
4346 .adc_nids = alc882_adc_nids,
4347 .dig_in_nid = ALC882_DIGIN_NID, 4337 .dig_in_nid = ALC882_DIGIN_NID,
4348 .num_channel_mode = ARRAY_SIZE(alc882_ch_modes), 4338 .num_channel_mode = ARRAY_SIZE(alc882_ch_modes),
4349 .channel_mode = alc882_ch_modes, 4339 .channel_mode = alc882_ch_modes,
@@ -4355,8 +4345,6 @@ static struct alc_config_preset alc882_presets[] = {
4355 .num_dacs = ARRAY_SIZE(alc882_dac_nids), 4345 .num_dacs = ARRAY_SIZE(alc882_dac_nids),
4356 .dac_nids = alc882_dac_nids, 4346 .dac_nids = alc882_dac_nids,
4357 .dig_out_nid = ALC882_DIGOUT_NID, 4347 .dig_out_nid = ALC882_DIGOUT_NID,
4358 .num_adc_nids = ARRAY_SIZE(alc882_adc_nids),
4359 .adc_nids = alc882_adc_nids,
4360 .dig_in_nid = ALC882_DIGIN_NID, 4348 .dig_in_nid = ALC882_DIGIN_NID,
4361 .num_channel_mode = ARRAY_SIZE(alc882_sixstack_modes), 4349 .num_channel_mode = ARRAY_SIZE(alc882_sixstack_modes),
4362 .channel_mode = alc882_sixstack_modes, 4350 .channel_mode = alc882_sixstack_modes,
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
index 8c440fb98603..36f199442fdc 100644
--- a/sound/pci/hda/patch_sigmatel.c
+++ b/sound/pci/hda/patch_sigmatel.c
@@ -41,6 +41,7 @@
41#define STAC_REF 0 41#define STAC_REF 0
42#define STAC_D945GTP3 1 42#define STAC_D945GTP3 1
43#define STAC_D945GTP5 2 43#define STAC_D945GTP5 2
44#define STAC_MACMINI 3
44 45
45struct sigmatel_spec { 46struct sigmatel_spec {
46 struct snd_kcontrol_new *mixers[4]; 47 struct snd_kcontrol_new *mixers[4];
@@ -52,6 +53,7 @@ struct sigmatel_spec {
52 unsigned int mic_switch: 1; 53 unsigned int mic_switch: 1;
53 unsigned int alt_switch: 1; 54 unsigned int alt_switch: 1;
54 unsigned int hp_detect: 1; 55 unsigned int hp_detect: 1;
56 unsigned int gpio_mute: 1;
55 57
56 /* playback */ 58 /* playback */
57 struct hda_multi_out multiout; 59 struct hda_multi_out multiout;
@@ -293,6 +295,7 @@ static unsigned int *stac922x_brd_tbl[] = {
293 ref922x_pin_configs, 295 ref922x_pin_configs,
294 d945gtp3_pin_configs, 296 d945gtp3_pin_configs,
295 d945gtp5_pin_configs, 297 d945gtp5_pin_configs,
298 NULL, /* STAC_MACMINI */
296}; 299};
297 300
298static struct hda_board_config stac922x_cfg_tbl[] = { 301static struct hda_board_config stac922x_cfg_tbl[] = {
@@ -324,6 +327,9 @@ static struct hda_board_config stac922x_cfg_tbl[] = {
324 { .pci_subvendor = PCI_VENDOR_ID_INTEL, 327 { .pci_subvendor = PCI_VENDOR_ID_INTEL,
325 .pci_subdevice = 0x0417, 328 .pci_subdevice = 0x0417,
326 .config = STAC_D945GTP5 }, /* Intel D975XBK - 5 Stack */ 329 .config = STAC_D945GTP5 }, /* Intel D975XBK - 5 Stack */
330 { .pci_subvendor = 0x8384,
331 .pci_subdevice = 0x7680,
332 .config = STAC_MACMINI }, /* Apple Mac Mini (early 2006) */
327 {} /* terminator */ 333 {} /* terminator */
328}; 334};
329 335
@@ -841,6 +847,19 @@ static int stac92xx_auto_create_analog_input_ctls(struct hda_codec *codec, const
841 } 847 }
842 } 848 }
843 849
850 if (imux->num_items == 1) {
851 /*
852 * Set the current input for the muxes.
853 * The STAC9221 has two input muxes with identical source
854 * NID lists. Hopefully this won't get confused.
855 */
856 for (i = 0; i < spec->num_muxes; i++) {
857 snd_hda_codec_write(codec, spec->mux_nids[i], 0,
858 AC_VERB_SET_CONNECT_SEL,
859 imux->items[0].index);
860 }
861 }
862
844 return 0; 863 return 0;
845} 864}
846 865
@@ -946,6 +965,45 @@ static int stac9200_parse_auto_config(struct hda_codec *codec)
946 return 1; 965 return 1;
947} 966}
948 967
968/*
969 * Early 2006 Intel Macintoshes with STAC9220X5 codecs seem to have a
970 * funky external mute control using GPIO pins.
971 */
972
973static void stac922x_gpio_mute(struct hda_codec *codec, int pin, int muted)
974{
975 unsigned int gpiostate, gpiomask, gpiodir;
976
977 gpiostate = snd_hda_codec_read(codec, codec->afg, 0,
978 AC_VERB_GET_GPIO_DATA, 0);
979
980 if (!muted)
981 gpiostate |= (1 << pin);
982 else
983 gpiostate &= ~(1 << pin);
984
985 gpiomask = snd_hda_codec_read(codec, codec->afg, 0,
986 AC_VERB_GET_GPIO_MASK, 0);
987 gpiomask |= (1 << pin);
988
989 gpiodir = snd_hda_codec_read(codec, codec->afg, 0,
990 AC_VERB_GET_GPIO_DIRECTION, 0);
991 gpiodir |= (1 << pin);
992
993 /* AppleHDA seems to do this -- WTF is this verb?? */
994 snd_hda_codec_write(codec, codec->afg, 0, 0x7e7, 0);
995
996 snd_hda_codec_write(codec, codec->afg, 0,
997 AC_VERB_SET_GPIO_MASK, gpiomask);
998 snd_hda_codec_write(codec, codec->afg, 0,
999 AC_VERB_SET_GPIO_DIRECTION, gpiodir);
1000
1001 msleep(1);
1002
1003 snd_hda_codec_write(codec, codec->afg, 0,
1004 AC_VERB_SET_GPIO_DATA, gpiostate);
1005}
1006
949static int stac92xx_init(struct hda_codec *codec) 1007static int stac92xx_init(struct hda_codec *codec)
950{ 1008{
951 struct sigmatel_spec *spec = codec->spec; 1009 struct sigmatel_spec *spec = codec->spec;
@@ -982,6 +1040,11 @@ static int stac92xx_init(struct hda_codec *codec)
982 stac92xx_auto_set_pinctl(codec, cfg->dig_in_pin, 1040 stac92xx_auto_set_pinctl(codec, cfg->dig_in_pin,
983 AC_PINCTL_IN_EN); 1041 AC_PINCTL_IN_EN);
984 1042
1043 if (spec->gpio_mute) {
1044 stac922x_gpio_mute(codec, 0, 0);
1045 stac922x_gpio_mute(codec, 1, 0);
1046 }
1047
985 return 0; 1048 return 0;
986} 1049}
987 1050
@@ -1132,7 +1195,7 @@ static int patch_stac922x(struct hda_codec *codec)
1132 spec->board_config = snd_hda_check_board_config(codec, stac922x_cfg_tbl); 1195 spec->board_config = snd_hda_check_board_config(codec, stac922x_cfg_tbl);
1133 if (spec->board_config < 0) 1196 if (spec->board_config < 0)
1134 snd_printdd(KERN_INFO "hda_codec: Unknown model for STAC922x, using BIOS defaults\n"); 1197 snd_printdd(KERN_INFO "hda_codec: Unknown model for STAC922x, using BIOS defaults\n");
1135 else { 1198 else if (stac922x_brd_tbl[spec->board_config] != NULL) {
1136 spec->num_pins = 10; 1199 spec->num_pins = 10;
1137 spec->pin_nids = stac922x_pin_nids; 1200 spec->pin_nids = stac922x_pin_nids;
1138 spec->pin_configs = stac922x_brd_tbl[spec->board_config]; 1201 spec->pin_configs = stac922x_brd_tbl[spec->board_config];
@@ -1154,6 +1217,9 @@ static int patch_stac922x(struct hda_codec *codec)
1154 return err; 1217 return err;
1155 } 1218 }
1156 1219
1220 if (spec->board_config == STAC_MACMINI)
1221 spec->gpio_mute = 1;
1222
1157 codec->patch_ops = stac92xx_patch_ops; 1223 codec->patch_ops = stac92xx_patch_ops;
1158 1224
1159 return 0; 1225 return 0;
@@ -1262,13 +1328,13 @@ static int vaio_master_sw_put(struct snd_kcontrol *kcontrol,
1262 int change; 1328 int change;
1263 1329
1264 change = snd_hda_codec_amp_update(codec, 0x02, 0, HDA_OUTPUT, 0, 1330 change = snd_hda_codec_amp_update(codec, 0x02, 0, HDA_OUTPUT, 0,
1265 0x80, valp[0] & 0x80); 1331 0x80, (valp[0] ? 0 : 0x80));
1266 change |= snd_hda_codec_amp_update(codec, 0x02, 1, HDA_OUTPUT, 0, 1332 change |= snd_hda_codec_amp_update(codec, 0x02, 1, HDA_OUTPUT, 0,
1267 0x80, valp[1] & 0x80); 1333 0x80, (valp[1] ? 0 : 0x80));
1268 snd_hda_codec_amp_update(codec, 0x05, 0, HDA_OUTPUT, 0, 1334 snd_hda_codec_amp_update(codec, 0x05, 0, HDA_OUTPUT, 0,
1269 0x80, valp[0] & 0x80); 1335 0x80, (valp[0] ? 0 : 0x80));
1270 snd_hda_codec_amp_update(codec, 0x05, 1, HDA_OUTPUT, 0, 1336 snd_hda_codec_amp_update(codec, 0x05, 1, HDA_OUTPUT, 0,
1271 0x80, valp[1] & 0x80); 1337 0x80, (valp[1] ? 0 : 0x80));
1272 return change; 1338 return change;
1273} 1339}
1274 1340
@@ -1370,6 +1436,12 @@ struct hda_codec_preset snd_hda_preset_sigmatel[] = {
1370 { .id = 0x83847681, .name = "STAC9220D/9223D A2", .patch = patch_stac922x }, 1436 { .id = 0x83847681, .name = "STAC9220D/9223D A2", .patch = patch_stac922x },
1371 { .id = 0x83847682, .name = "STAC9221 A2", .patch = patch_stac922x }, 1437 { .id = 0x83847682, .name = "STAC9221 A2", .patch = patch_stac922x },
1372 { .id = 0x83847683, .name = "STAC9221D A2", .patch = patch_stac922x }, 1438 { .id = 0x83847683, .name = "STAC9221D A2", .patch = patch_stac922x },
1439 { .id = 0x83847618, .name = "STAC9227", .patch = patch_stac922x },
1440 { .id = 0x83847619, .name = "STAC9227", .patch = patch_stac922x },
1441 { .id = 0x83847616, .name = "STAC9228", .patch = patch_stac922x },
1442 { .id = 0x83847617, .name = "STAC9228", .patch = patch_stac922x },
1443 { .id = 0x83847614, .name = "STAC9229", .patch = patch_stac922x },
1444 { .id = 0x83847615, .name = "STAC9229", .patch = patch_stac922x },
1373 { .id = 0x83847620, .name = "STAC9274", .patch = patch_stac927x }, 1445 { .id = 0x83847620, .name = "STAC9274", .patch = patch_stac927x },
1374 { .id = 0x83847621, .name = "STAC9274D", .patch = patch_stac927x }, 1446 { .id = 0x83847621, .name = "STAC9274D", .patch = patch_stac927x },
1375 { .id = 0x83847622, .name = "STAC9273X", .patch = patch_stac927x }, 1447 { .id = 0x83847622, .name = "STAC9273X", .patch = patch_stac927x },
diff --git a/sound/pci/ice1712/aureon.c b/sound/pci/ice1712/aureon.c
index 336dc489aee1..ca74f5b85f42 100644
--- a/sound/pci/ice1712/aureon.c
+++ b/sound/pci/ice1712/aureon.c
@@ -1281,9 +1281,15 @@ static int aureon_set_headphone_amp(struct snd_ice1712 *ice, int enable)
1281 1281
1282 tmp2 = tmp = snd_ice1712_gpio_read(ice); 1282 tmp2 = tmp = snd_ice1712_gpio_read(ice);
1283 if (enable) 1283 if (enable)
1284 tmp |= AUREON_HP_SEL; 1284 if (ice->eeprom.subvendor != VT1724_SUBDEVICE_PRODIGY71LT)
1285 tmp |= AUREON_HP_SEL;
1286 else
1287 tmp |= PRODIGY_HP_SEL;
1285 else 1288 else
1286 tmp &= ~ AUREON_HP_SEL; 1289 if (ice->eeprom.subvendor != VT1724_SUBDEVICE_PRODIGY71LT)
1290 tmp &= ~ AUREON_HP_SEL;
1291 else
1292 tmp &= ~ PRODIGY_HP_SEL;
1287 if (tmp != tmp2) { 1293 if (tmp != tmp2) {
1288 snd_ice1712_gpio_write(ice, tmp); 1294 snd_ice1712_gpio_write(ice, tmp);
1289 return 1; 1295 return 1;
@@ -2079,16 +2085,16 @@ static unsigned char prodigy71_eeprom[] __devinitdata = {
2079}; 2085};
2080 2086
2081static unsigned char prodigy71lt_eeprom[] __devinitdata = { 2087static unsigned char prodigy71lt_eeprom[] __devinitdata = {
2082 0x0b, /* SYSCINF: clock 512, spdif-in/ADC, 4DACs */ 2088 0x4b, /* SYSCINF: clock 512, spdif-in/ADC, 4DACs */
2083 0x80, /* ACLINK: I2S */ 2089 0x80, /* ACLINK: I2S */
2084 0xfc, /* I2S: vol, 96k, 24bit, 192k */ 2090 0xfc, /* I2S: vol, 96k, 24bit, 192k */
2085 0xc3, /* SPDUF: out-en, out-int */ 2091 0xc3, /* SPDIF: out-en, out-int, spdif-in */
2086 0x00, /* GPIO_DIR */ 2092 0xff, /* GPIO_DIR */
2087 0x07, /* GPIO_DIR1 */ 2093 0xff, /* GPIO_DIR1 */
2088 0x00, /* GPIO_DIR2 */ 2094 0x5f, /* GPIO_DIR2 */
2089 0xff, /* GPIO_MASK */ 2095 0x00, /* GPIO_MASK */
2090 0xf8, /* GPIO_MASK1 */ 2096 0x00, /* GPIO_MASK1 */
2091 0xff, /* GPIO_MASK2 */ 2097 0x00, /* GPIO_MASK2 */
2092 0x00, /* GPIO_STATE */ 2098 0x00, /* GPIO_STATE */
2093 0x00, /* GPIO_STATE1 */ 2099 0x00, /* GPIO_STATE1 */
2094 0x00, /* GPIO_STATE2 */ 2100 0x00, /* GPIO_STATE2 */
diff --git a/sound/pci/ice1712/aureon.h b/sound/pci/ice1712/aureon.h
index 98a6752280f2..3b7bea656c57 100644
--- a/sound/pci/ice1712/aureon.h
+++ b/sound/pci/ice1712/aureon.h
@@ -58,5 +58,6 @@ extern struct snd_ice1712_card_info snd_vt1724_aureon_cards[];
58#define PRODIGY_WM_CS (1 << 8) 58#define PRODIGY_WM_CS (1 << 8)
59#define PRODIGY_SPI_MOSI (1 << 10) 59#define PRODIGY_SPI_MOSI (1 << 10)
60#define PRODIGY_SPI_CLK (1 << 9) 60#define PRODIGY_SPI_CLK (1 << 9)
61#define PRODIGY_HP_SEL (1 << 5)
61 62
62#endif /* __SOUND_AUREON_H */ 63#endif /* __SOUND_AUREON_H */
diff --git a/sound/pci/ice1712/ews.c b/sound/pci/ice1712/ews.c
index 2c529e741384..b135389fec6c 100644
--- a/sound/pci/ice1712/ews.c
+++ b/sound/pci/ice1712/ews.c
@@ -1031,6 +1031,9 @@ struct snd_ice1712_card_info snd_ice1712_ews_cards[] __devinitdata = {
1031 .model = "dmx6fire", 1031 .model = "dmx6fire",
1032 .chip_init = snd_ice1712_ews_init, 1032 .chip_init = snd_ice1712_ews_init,
1033 .build_controls = snd_ice1712_ews_add_controls, 1033 .build_controls = snd_ice1712_ews_add_controls,
1034 .mpu401_1_name = "MIDI-Front DMX6fire",
1035 .mpu401_2_name = "Wavetable DMX6fire",
1036 .mpu401_2_info_flags = MPU401_INFO_OUTPUT,
1034 }, 1037 },
1035 { } /* terminator */ 1038 { } /* terminator */
1036}; 1039};
diff --git a/sound/pci/ice1712/ice1712.c b/sound/pci/ice1712/ice1712.c
index c56793b381e2..845907159b74 100644
--- a/sound/pci/ice1712/ice1712.c
+++ b/sound/pci/ice1712/ice1712.c
@@ -61,7 +61,6 @@
61#include <sound/core.h> 61#include <sound/core.h>
62#include <sound/cs8427.h> 62#include <sound/cs8427.h>
63#include <sound/info.h> 63#include <sound/info.h>
64#include <sound/mpu401.h>
65#include <sound/initval.h> 64#include <sound/initval.h>
66 65
67#include <sound/asoundef.h> 66#include <sound/asoundef.h>
@@ -1596,7 +1595,7 @@ static void __devinit snd_ice1712_proc_init(struct snd_ice1712 * ice)
1596 struct snd_info_entry *entry; 1595 struct snd_info_entry *entry;
1597 1596
1598 if (! snd_card_proc_new(ice->card, "ice1712", &entry)) 1597 if (! snd_card_proc_new(ice->card, "ice1712", &entry))
1599 snd_info_set_text_ops(entry, ice, 1024, snd_ice1712_proc_read); 1598 snd_info_set_text_ops(entry, ice, snd_ice1712_proc_read);
1600} 1599}
1601 1600
1602/* 1601/*
@@ -2398,13 +2397,14 @@ static int __devinit snd_ice1712_chip_init(struct snd_ice1712 *ice)
2398 udelay(200); 2397 udelay(200);
2399 outb(ICE1712_NATIVE, ICEREG(ice, CONTROL)); 2398 outb(ICE1712_NATIVE, ICEREG(ice, CONTROL));
2400 udelay(200); 2399 udelay(200);
2401 if (ice->eeprom.subvendor == ICE1712_SUBDEVICE_DMX6FIRE && !ice->dxr_enable) { 2400 if (ice->eeprom.subvendor == ICE1712_SUBDEVICE_DMX6FIRE &&
2402 /* Limit active ADCs and DACs to 6; */ 2401 !ice->dxr_enable)
2403 /* Note: DXR extension not supported */ 2402 /* Set eeprom value to limit active ADCs and DACs to 6;
2404 pci_write_config_byte(ice->pci, 0x60, 0x2a); 2403 * Also disable AC97 as no hardware in standard 6fire card/box
2405 } else { 2404 * Note: DXR extensions are not currently supported
2406 pci_write_config_byte(ice->pci, 0x60, ice->eeprom.data[ICE_EEP1_CODEC]); 2405 */
2407 } 2406 ice->eeprom.data[ICE_EEP1_CODEC] = 0x3a;
2407 pci_write_config_byte(ice->pci, 0x60, ice->eeprom.data[ICE_EEP1_CODEC]);
2408 pci_write_config_byte(ice->pci, 0x61, ice->eeprom.data[ICE_EEP1_ACLINK]); 2408 pci_write_config_byte(ice->pci, 0x61, ice->eeprom.data[ICE_EEP1_ACLINK]);
2409 pci_write_config_byte(ice->pci, 0x62, ice->eeprom.data[ICE_EEP1_I2SID]); 2409 pci_write_config_byte(ice->pci, 0x62, ice->eeprom.data[ICE_EEP1_I2SID]);
2410 pci_write_config_byte(ice->pci, 0x63, ice->eeprom.data[ICE_EEP1_SPDIF]); 2410 pci_write_config_byte(ice->pci, 0x63, ice->eeprom.data[ICE_EEP1_SPDIF]);
@@ -2737,21 +2737,38 @@ static int __devinit snd_ice1712_probe(struct pci_dev *pci,
2737 2737
2738 if (! c->no_mpu401) { 2738 if (! c->no_mpu401) {
2739 if ((err = snd_mpu401_uart_new(card, 0, MPU401_HW_ICE1712, 2739 if ((err = snd_mpu401_uart_new(card, 0, MPU401_HW_ICE1712,
2740 ICEREG(ice, MPU1_CTRL), 1, 2740 ICEREG(ice, MPU1_CTRL),
2741 (c->mpu401_1_info_flags |
2742 MPU401_INFO_INTEGRATED),
2741 ice->irq, 0, 2743 ice->irq, 0,
2742 &ice->rmidi[0])) < 0) { 2744 &ice->rmidi[0])) < 0) {
2743 snd_card_free(card); 2745 snd_card_free(card);
2744 return err; 2746 return err;
2745 } 2747 }
2746 2748 if (c->mpu401_1_name)
2747 if (ice->eeprom.data[ICE_EEP1_CODEC] & ICE1712_CFG_2xMPU401) 2749 /* Prefered name available in card_info */
2750 snprintf(ice->rmidi[0]->name,
2751 sizeof(ice->rmidi[0]->name),
2752 "%s %d", c->mpu401_1_name, card->number);
2753
2754 if (ice->eeprom.data[ICE_EEP1_CODEC] & ICE1712_CFG_2xMPU401) {
2755 /* 2nd port used */
2748 if ((err = snd_mpu401_uart_new(card, 1, MPU401_HW_ICE1712, 2756 if ((err = snd_mpu401_uart_new(card, 1, MPU401_HW_ICE1712,
2749 ICEREG(ice, MPU2_CTRL), 1, 2757 ICEREG(ice, MPU2_CTRL),
2758 (c->mpu401_2_info_flags |
2759 MPU401_INFO_INTEGRATED),
2750 ice->irq, 0, 2760 ice->irq, 0,
2751 &ice->rmidi[1])) < 0) { 2761 &ice->rmidi[1])) < 0) {
2752 snd_card_free(card); 2762 snd_card_free(card);
2753 return err; 2763 return err;
2754 } 2764 }
2765 if (c->mpu401_2_name)
2766 /* Prefered name available in card_info */
2767 snprintf(ice->rmidi[1]->name,
2768 sizeof(ice->rmidi[1]->name),
2769 "%s %d", c->mpu401_2_name,
2770 card->number);
2771 }
2755 } 2772 }
2756 2773
2757 snd_ice1712_set_input_clock_source(ice, 0); 2774 snd_ice1712_set_input_clock_source(ice, 0);
diff --git a/sound/pci/ice1712/ice1712.h b/sound/pci/ice1712/ice1712.h
index 053f8e56fd68..ce27eac40d4e 100644
--- a/sound/pci/ice1712/ice1712.h
+++ b/sound/pci/ice1712/ice1712.h
@@ -29,6 +29,7 @@
29#include <sound/ak4xxx-adda.h> 29#include <sound/ak4xxx-adda.h>
30#include <sound/ak4114.h> 30#include <sound/ak4114.h>
31#include <sound/pcm.h> 31#include <sound/pcm.h>
32#include <sound/mpu401.h>
32 33
33 34
34/* 35/*
@@ -495,6 +496,10 @@ struct snd_ice1712_card_info {
495 int (*chip_init)(struct snd_ice1712 *); 496 int (*chip_init)(struct snd_ice1712 *);
496 int (*build_controls)(struct snd_ice1712 *); 497 int (*build_controls)(struct snd_ice1712 *);
497 unsigned int no_mpu401: 1; 498 unsigned int no_mpu401: 1;
499 unsigned int mpu401_1_info_flags;
500 unsigned int mpu401_2_info_flags;
501 const char *mpu401_1_name;
502 const char *mpu401_2_name;
498 unsigned int eeprom_size; 503 unsigned int eeprom_size;
499 unsigned char *eeprom_data; 504 unsigned char *eeprom_data;
500}; 505};
diff --git a/sound/pci/ice1712/ice1724.c b/sound/pci/ice1712/ice1724.c
index b1c007e022d2..34a58c629f47 100644
--- a/sound/pci/ice1712/ice1724.c
+++ b/sound/pci/ice1712/ice1724.c
@@ -1293,7 +1293,7 @@ static void __devinit snd_vt1724_proc_init(struct snd_ice1712 * ice)
1293 struct snd_info_entry *entry; 1293 struct snd_info_entry *entry;
1294 1294
1295 if (! snd_card_proc_new(ice->card, "ice1724", &entry)) 1295 if (! snd_card_proc_new(ice->card, "ice1724", &entry))
1296 snd_info_set_text_ops(entry, ice, 1024, snd_vt1724_proc_read); 1296 snd_info_set_text_ops(entry, ice, snd_vt1724_proc_read);
1297} 1297}
1298 1298
1299/* 1299/*
@@ -2388,7 +2388,8 @@ static int __devinit snd_vt1724_probe(struct pci_dev *pci,
2388 if (! c->no_mpu401) { 2388 if (! c->no_mpu401) {
2389 if (ice->eeprom.data[ICE_EEP2_SYSCONF] & VT1724_CFG_MPU401) { 2389 if (ice->eeprom.data[ICE_EEP2_SYSCONF] & VT1724_CFG_MPU401) {
2390 if ((err = snd_mpu401_uart_new(card, 0, MPU401_HW_ICE1712, 2390 if ((err = snd_mpu401_uart_new(card, 0, MPU401_HW_ICE1712,
2391 ICEREG1724(ice, MPU_CTRL), 1, 2391 ICEREG1724(ice, MPU_CTRL),
2392 MPU401_INFO_INTEGRATED,
2392 ice->irq, 0, 2393 ice->irq, 0,
2393 &ice->rmidi[0])) < 0) { 2394 &ice->rmidi[0])) < 0) {
2394 snd_card_free(card); 2395 snd_card_free(card);
diff --git a/sound/pci/ice1712/pontis.c b/sound/pci/ice1712/pontis.c
index d23fb3fc2133..0efcad9260a5 100644
--- a/sound/pci/ice1712/pontis.c
+++ b/sound/pci/ice1712/pontis.c
@@ -680,9 +680,8 @@ static void wm_proc_init(struct snd_ice1712 *ice)
680{ 680{
681 struct snd_info_entry *entry; 681 struct snd_info_entry *entry;
682 if (! snd_card_proc_new(ice->card, "wm_codec", &entry)) { 682 if (! snd_card_proc_new(ice->card, "wm_codec", &entry)) {
683 snd_info_set_text_ops(entry, ice, 1024, wm_proc_regs_read); 683 snd_info_set_text_ops(entry, ice, wm_proc_regs_read);
684 entry->mode |= S_IWUSR; 684 entry->mode |= S_IWUSR;
685 entry->c.text.write_size = 1024;
686 entry->c.text.write = wm_proc_regs_write; 685 entry->c.text.write = wm_proc_regs_write;
687 } 686 }
688} 687}
@@ -705,9 +704,8 @@ static void cs_proc_regs_read(struct snd_info_entry *entry, struct snd_info_buff
705static void cs_proc_init(struct snd_ice1712 *ice) 704static void cs_proc_init(struct snd_ice1712 *ice)
706{ 705{
707 struct snd_info_entry *entry; 706 struct snd_info_entry *entry;
708 if (! snd_card_proc_new(ice->card, "cs_codec", &entry)) { 707 if (! snd_card_proc_new(ice->card, "cs_codec", &entry))
709 snd_info_set_text_ops(entry, ice, 1024, cs_proc_regs_read); 708 snd_info_set_text_ops(entry, ice, cs_proc_regs_read);
710 }
711} 709}
712 710
713 711
diff --git a/sound/pci/intel8x0.c b/sound/pci/intel8x0.c
index 0df7602568e2..edc14475ef82 100644
--- a/sound/pci/intel8x0.c
+++ b/sound/pci/intel8x0.c
@@ -66,7 +66,7 @@ MODULE_SUPPORTED_DEVICE("{{Intel,82801AA-ICH},"
66 66
67static int index = SNDRV_DEFAULT_IDX1; /* Index 0-MAX */ 67static int index = SNDRV_DEFAULT_IDX1; /* Index 0-MAX */
68static char *id = SNDRV_DEFAULT_STR1; /* ID for this card */ 68static char *id = SNDRV_DEFAULT_STR1; /* ID for this card */
69static int ac97_clock = 0; 69static int ac97_clock;
70static char *ac97_quirk; 70static char *ac97_quirk;
71static int buggy_semaphore; 71static int buggy_semaphore;
72static int buggy_irq = -1; /* auto-check */ 72static int buggy_irq = -1; /* auto-check */
@@ -1807,6 +1807,12 @@ static struct ac97_quirk ac97_quirks[] __devinitdata = {
1807 }, 1807 },
1808 { 1808 {
1809 .subvendor = 0x1028, 1809 .subvendor = 0x1028,
1810 .subdevice = 0x014e,
1811 .name = "Dell D800", /* STAC9750/51 */
1812 .type = AC97_TUNE_HP_ONLY
1813 },
1814 {
1815 .subvendor = 0x1028,
1810 .subdevice = 0x0163, 1816 .subdevice = 0x0163,
1811 .name = "Dell Unknown", /* STAC9750/51 */ 1817 .name = "Dell Unknown", /* STAC9750/51 */
1812 .type = AC97_TUNE_HP_ONLY 1818 .type = AC97_TUNE_HP_ONLY
@@ -2645,7 +2651,7 @@ static void __devinit snd_intel8x0_proc_init(struct intel8x0 * chip)
2645 struct snd_info_entry *entry; 2651 struct snd_info_entry *entry;
2646 2652
2647 if (! snd_card_proc_new(chip->card, "intel8x0", &entry)) 2653 if (! snd_card_proc_new(chip->card, "intel8x0", &entry))
2648 snd_info_set_text_ops(entry, chip, 1024, snd_intel8x0_proc_read); 2654 snd_info_set_text_ops(entry, chip, snd_intel8x0_proc_read);
2649} 2655}
2650#else 2656#else
2651#define snd_intel8x0_proc_init(x) 2657#define snd_intel8x0_proc_init(x)
diff --git a/sound/pci/intel8x0m.c b/sound/pci/intel8x0m.c
index 720635f0cb81..24703d75b65a 100644
--- a/sound/pci/intel8x0m.c
+++ b/sound/pci/intel8x0m.c
@@ -59,7 +59,7 @@ MODULE_SUPPORTED_DEVICE("{{Intel,82801AA-ICH},"
59 59
60static int index = -2; /* Exclude the first card */ 60static int index = -2; /* Exclude the first card */
61static char *id = SNDRV_DEFAULT_STR1; /* ID for this card */ 61static char *id = SNDRV_DEFAULT_STR1; /* ID for this card */
62static int ac97_clock = 0; 62static int ac97_clock;
63 63
64module_param(index, int, 0444); 64module_param(index, int, 0444);
65MODULE_PARM_DESC(index, "Index value for Intel i8x0 modemcard."); 65MODULE_PARM_DESC(index, "Index value for Intel i8x0 modemcard.");
@@ -1092,7 +1092,7 @@ static void __devinit snd_intel8x0m_proc_init(struct intel8x0m * chip)
1092 struct snd_info_entry *entry; 1092 struct snd_info_entry *entry;
1093 1093
1094 if (! snd_card_proc_new(chip->card, "intel8x0m", &entry)) 1094 if (! snd_card_proc_new(chip->card, "intel8x0m", &entry))
1095 snd_info_set_text_ops(entry, chip, 1024, snd_intel8x0m_proc_read); 1095 snd_info_set_text_ops(entry, chip, snd_intel8x0m_proc_read);
1096} 1096}
1097#else /* !CONFIG_PROC_FS */ 1097#else /* !CONFIG_PROC_FS */
1098#define snd_intel8x0m_proc_init(chip) 1098#define snd_intel8x0m_proc_init(chip)
diff --git a/sound/pci/korg1212/korg1212.c b/sound/pci/korg1212/korg1212.c
index e39fad1a4200..6e97932de34f 100644
--- a/sound/pci/korg1212/korg1212.c
+++ b/sound/pci/korg1212/korg1212.c
@@ -2085,7 +2085,7 @@ static void __devinit snd_korg1212_proc_init(struct snd_korg1212 *korg1212)
2085 struct snd_info_entry *entry; 2085 struct snd_info_entry *entry;
2086 2086
2087 if (! snd_card_proc_new(korg1212->card, "korg1212", &entry)) 2087 if (! snd_card_proc_new(korg1212->card, "korg1212", &entry))
2088 snd_info_set_text_ops(entry, korg1212, 1024, snd_korg1212_proc_read); 2088 snd_info_set_text_ops(entry, korg1212, snd_korg1212_proc_read);
2089} 2089}
2090 2090
2091static int 2091static int
diff --git a/sound/pci/maestro3.c b/sound/pci/maestro3.c
index 1928e06b6d82..1c344fbd964d 100644
--- a/sound/pci/maestro3.c
+++ b/sound/pci/maestro3.c
@@ -2861,7 +2861,8 @@ snd_m3_probe(struct pci_dev *pci, const struct pci_device_id *pci_id)
2861#if 0 /* TODO: not supported yet */ 2861#if 0 /* TODO: not supported yet */
2862 /* TODO enable MIDI IRQ and I/O */ 2862 /* TODO enable MIDI IRQ and I/O */
2863 err = snd_mpu401_uart_new(chip->card, 0, MPU401_HW_MPU401, 2863 err = snd_mpu401_uart_new(chip->card, 0, MPU401_HW_MPU401,
2864 chip->iobase + MPU401_DATA_PORT, 1, 2864 chip->iobase + MPU401_DATA_PORT,
2865 MPU401_INFO_INTEGRATED,
2865 chip->irq, 0, &chip->rmidi); 2866 chip->irq, 0, &chip->rmidi);
2866 if (err < 0) 2867 if (err < 0)
2867 printk(KERN_WARNING "maestro3: no MIDI support.\n"); 2868 printk(KERN_WARNING "maestro3: no MIDI support.\n");
diff --git a/sound/pci/mixart/mixart.c b/sound/pci/mixart/mixart.c
index 09cc0786495a..366c4a7e65c6 100644
--- a/sound/pci/mixart/mixart.c
+++ b/sound/pci/mixart/mixart.c
@@ -1244,7 +1244,6 @@ static void __devinit snd_mixart_proc_init(struct snd_mixart *chip)
1244 /* text interface to read perf and temp meters */ 1244 /* text interface to read perf and temp meters */
1245 if (! snd_card_proc_new(chip->card, "board_info", &entry)) { 1245 if (! snd_card_proc_new(chip->card, "board_info", &entry)) {
1246 entry->private_data = chip; 1246 entry->private_data = chip;
1247 entry->c.text.read_size = 1024;
1248 entry->c.text.read = snd_mixart_proc_read; 1247 entry->c.text.read = snd_mixart_proc_read;
1249 } 1248 }
1250 1249
diff --git a/sound/pci/pcxhr/pcxhr.c b/sound/pci/pcxhr/pcxhr.c
index dafa2235abaa..8198884b51ee 100644
--- a/sound/pci/pcxhr/pcxhr.c
+++ b/sound/pci/pcxhr/pcxhr.c
@@ -1150,9 +1150,9 @@ static void __devinit pcxhr_proc_init(struct snd_pcxhr *chip)
1150 struct snd_info_entry *entry; 1150 struct snd_info_entry *entry;
1151 1151
1152 if (! snd_card_proc_new(chip->card, "info", &entry)) 1152 if (! snd_card_proc_new(chip->card, "info", &entry))
1153 snd_info_set_text_ops(entry, chip, 1024, pcxhr_proc_info); 1153 snd_info_set_text_ops(entry, chip, pcxhr_proc_info);
1154 if (! snd_card_proc_new(chip->card, "sync", &entry)) 1154 if (! snd_card_proc_new(chip->card, "sync", &entry))
1155 snd_info_set_text_ops(entry, chip, 1024, pcxhr_proc_sync); 1155 snd_info_set_text_ops(entry, chip, pcxhr_proc_sync);
1156} 1156}
1157/* end of proc interface */ 1157/* end of proc interface */
1158 1158
diff --git a/sound/pci/riptide/riptide.c b/sound/pci/riptide/riptide.c
index d8cc985d7241..5618ec9740bd 100644
--- a/sound/pci/riptide/riptide.c
+++ b/sound/pci/riptide/riptide.c
@@ -1836,11 +1836,11 @@ static int snd_riptide_free(struct snd_riptide *chip)
1836 UNSET_GRESET(cif->hwport); 1836 UNSET_GRESET(cif->hwport);
1837 kfree(chip->cif); 1837 kfree(chip->cif);
1838 } 1838 }
1839 if (chip->irq >= 0)
1840 free_irq(chip->irq, chip);
1839 if (chip->fw_entry) 1841 if (chip->fw_entry)
1840 release_firmware(chip->fw_entry); 1842 release_firmware(chip->fw_entry);
1841 release_and_free_resource(chip->res_port); 1843 release_and_free_resource(chip->res_port);
1842 if (chip->irq >= 0)
1843 free_irq(chip->irq, chip);
1844 kfree(chip); 1844 kfree(chip);
1845 return 0; 1845 return 0;
1846} 1846}
@@ -1992,7 +1992,7 @@ static void __devinit snd_riptide_proc_init(struct snd_riptide *chip)
1992 struct snd_info_entry *entry; 1992 struct snd_info_entry *entry;
1993 1993
1994 if (!snd_card_proc_new(chip->card, "riptide", &entry)) 1994 if (!snd_card_proc_new(chip->card, "riptide", &entry))
1995 snd_info_set_text_ops(entry, chip, 4096, snd_riptide_proc_read); 1995 snd_info_set_text_ops(entry, chip, snd_riptide_proc_read);
1996} 1996}
1997 1997
1998static int __devinit snd_riptide_mixer(struct snd_riptide *chip) 1998static int __devinit snd_riptide_mixer(struct snd_riptide *chip)
diff --git a/sound/pci/rme32.c b/sound/pci/rme32.c
index 55b1d4838d97..2cb9fe98db2f 100644
--- a/sound/pci/rme32.c
+++ b/sound/pci/rme32.c
@@ -1368,18 +1368,18 @@ static int __devinit snd_rme32_create(struct rme32 * rme32)
1368 return err; 1368 return err;
1369 rme32->port = pci_resource_start(rme32->pci, 0); 1369 rme32->port = pci_resource_start(rme32->pci, 0);
1370 1370
1371 if (request_irq(pci->irq, snd_rme32_interrupt, SA_INTERRUPT | SA_SHIRQ, "RME32", (void *) rme32)) {
1372 snd_printk(KERN_ERR "unable to grab IRQ %d\n", pci->irq);
1373 return -EBUSY;
1374 }
1375 rme32->irq = pci->irq;
1376
1377 if ((rme32->iobase = ioremap_nocache(rme32->port, RME32_IO_SIZE)) == 0) { 1371 if ((rme32->iobase = ioremap_nocache(rme32->port, RME32_IO_SIZE)) == 0) {
1378 snd_printk(KERN_ERR "unable to remap memory region 0x%lx-0x%lx\n", 1372 snd_printk(KERN_ERR "unable to remap memory region 0x%lx-0x%lx\n",
1379 rme32->port, rme32->port + RME32_IO_SIZE - 1); 1373 rme32->port, rme32->port + RME32_IO_SIZE - 1);
1380 return -ENOMEM; 1374 return -ENOMEM;
1381 } 1375 }
1382 1376
1377 if (request_irq(pci->irq, snd_rme32_interrupt, SA_INTERRUPT | SA_SHIRQ, "RME32", (void *) rme32)) {
1378 snd_printk(KERN_ERR "unable to grab IRQ %d\n", pci->irq);
1379 return -EBUSY;
1380 }
1381 rme32->irq = pci->irq;
1382
1383 /* read the card's revision number */ 1383 /* read the card's revision number */
1384 pci_read_config_byte(pci, 8, &rme32->rev); 1384 pci_read_config_byte(pci, 8, &rme32->rev);
1385 1385
@@ -1578,7 +1578,7 @@ static void __devinit snd_rme32_proc_init(struct rme32 * rme32)
1578 struct snd_info_entry *entry; 1578 struct snd_info_entry *entry;
1579 1579
1580 if (! snd_card_proc_new(rme32->card, "rme32", &entry)) 1580 if (! snd_card_proc_new(rme32->card, "rme32", &entry))
1581 snd_info_set_text_ops(entry, rme32, 1024, snd_rme32_proc_read); 1581 snd_info_set_text_ops(entry, rme32, snd_rme32_proc_read);
1582} 1582}
1583 1583
1584/* 1584/*
diff --git a/sound/pci/rme96.c b/sound/pci/rme96.c
index 3c1bc533d511..991cb18c14f3 100644
--- a/sound/pci/rme96.c
+++ b/sound/pci/rme96.c
@@ -1151,6 +1151,25 @@ static struct snd_pcm_hw_constraint_list hw_constraints_period_bytes = {
1151 .mask = 0 1151 .mask = 0
1152}; 1152};
1153 1153
1154static void
1155rme96_set_buffer_size_constraint(struct rme96 *rme96,
1156 struct snd_pcm_runtime *runtime)
1157{
1158 unsigned int size;
1159
1160 snd_pcm_hw_constraint_minmax(runtime, SNDRV_PCM_HW_PARAM_BUFFER_BYTES,
1161 RME96_BUFFER_SIZE, RME96_BUFFER_SIZE);
1162 if ((size = rme96->playback_periodsize) != 0 ||
1163 (size = rme96->capture_periodsize) != 0)
1164 snd_pcm_hw_constraint_minmax(runtime,
1165 SNDRV_PCM_HW_PARAM_PERIOD_BYTES,
1166 size, size);
1167 else
1168 snd_pcm_hw_constraint_list(runtime, 0,
1169 SNDRV_PCM_HW_PARAM_PERIOD_BYTES,
1170 &hw_constraints_period_bytes);
1171}
1172
1154static int 1173static int
1155snd_rme96_playback_spdif_open(struct snd_pcm_substream *substream) 1174snd_rme96_playback_spdif_open(struct snd_pcm_substream *substream)
1156{ 1175{
@@ -1180,8 +1199,7 @@ snd_rme96_playback_spdif_open(struct snd_pcm_substream *substream)
1180 runtime->hw.rate_min = rate; 1199 runtime->hw.rate_min = rate;
1181 runtime->hw.rate_max = rate; 1200 runtime->hw.rate_max = rate;
1182 } 1201 }
1183 snd_pcm_hw_constraint_minmax(runtime, SNDRV_PCM_HW_PARAM_BUFFER_BYTES, RME96_BUFFER_SIZE, RME96_BUFFER_SIZE); 1202 rme96_set_buffer_size_constraint(rme96, runtime);
1184 snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_BYTES, &hw_constraints_period_bytes);
1185 1203
1186 rme96->wcreg_spdif_stream = rme96->wcreg_spdif; 1204 rme96->wcreg_spdif_stream = rme96->wcreg_spdif;
1187 rme96->spdif_ctl->vd[0].access &= ~SNDRV_CTL_ELEM_ACCESS_INACTIVE; 1205 rme96->spdif_ctl->vd[0].access &= ~SNDRV_CTL_ELEM_ACCESS_INACTIVE;
@@ -1219,9 +1237,7 @@ snd_rme96_capture_spdif_open(struct snd_pcm_substream *substream)
1219 rme96->capture_substream = substream; 1237 rme96->capture_substream = substream;
1220 spin_unlock_irq(&rme96->lock); 1238 spin_unlock_irq(&rme96->lock);
1221 1239
1222 snd_pcm_hw_constraint_minmax(runtime, SNDRV_PCM_HW_PARAM_BUFFER_BYTES, RME96_BUFFER_SIZE, RME96_BUFFER_SIZE); 1240 rme96_set_buffer_size_constraint(rme96, runtime);
1223 snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_BYTES, &hw_constraints_period_bytes);
1224
1225 return 0; 1241 return 0;
1226} 1242}
1227 1243
@@ -1254,8 +1270,7 @@ snd_rme96_playback_adat_open(struct snd_pcm_substream *substream)
1254 runtime->hw.rate_min = rate; 1270 runtime->hw.rate_min = rate;
1255 runtime->hw.rate_max = rate; 1271 runtime->hw.rate_max = rate;
1256 } 1272 }
1257 snd_pcm_hw_constraint_minmax(runtime, SNDRV_PCM_HW_PARAM_BUFFER_BYTES, RME96_BUFFER_SIZE, RME96_BUFFER_SIZE); 1273 rme96_set_buffer_size_constraint(rme96, runtime);
1258 snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_BYTES, &hw_constraints_period_bytes);
1259 return 0; 1274 return 0;
1260} 1275}
1261 1276
@@ -1291,8 +1306,7 @@ snd_rme96_capture_adat_open(struct snd_pcm_substream *substream)
1291 rme96->capture_substream = substream; 1306 rme96->capture_substream = substream;
1292 spin_unlock_irq(&rme96->lock); 1307 spin_unlock_irq(&rme96->lock);
1293 1308
1294 snd_pcm_hw_constraint_minmax(runtime, SNDRV_PCM_HW_PARAM_BUFFER_BYTES, RME96_BUFFER_SIZE, RME96_BUFFER_SIZE); 1309 rme96_set_buffer_size_constraint(rme96, runtime);
1295 snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_BYTES, &hw_constraints_period_bytes);
1296 return 0; 1310 return 0;
1297} 1311}
1298 1312
@@ -1569,17 +1583,17 @@ snd_rme96_create(struct rme96 *rme96)
1569 return err; 1583 return err;
1570 rme96->port = pci_resource_start(rme96->pci, 0); 1584 rme96->port = pci_resource_start(rme96->pci, 0);
1571 1585
1586 if ((rme96->iobase = ioremap_nocache(rme96->port, RME96_IO_SIZE)) == 0) {
1587 snd_printk(KERN_ERR "unable to remap memory region 0x%lx-0x%lx\n", rme96->port, rme96->port + RME96_IO_SIZE - 1);
1588 return -ENOMEM;
1589 }
1590
1572 if (request_irq(pci->irq, snd_rme96_interrupt, SA_INTERRUPT|SA_SHIRQ, "RME96", (void *)rme96)) { 1591 if (request_irq(pci->irq, snd_rme96_interrupt, SA_INTERRUPT|SA_SHIRQ, "RME96", (void *)rme96)) {
1573 snd_printk(KERN_ERR "unable to grab IRQ %d\n", pci->irq); 1592 snd_printk(KERN_ERR "unable to grab IRQ %d\n", pci->irq);
1574 return -EBUSY; 1593 return -EBUSY;
1575 } 1594 }
1576 rme96->irq = pci->irq; 1595 rme96->irq = pci->irq;
1577 1596
1578 if ((rme96->iobase = ioremap_nocache(rme96->port, RME96_IO_SIZE)) == 0) {
1579 snd_printk(KERN_ERR "unable to remap memory region 0x%lx-0x%lx\n", rme96->port, rme96->port + RME96_IO_SIZE - 1);
1580 return -ENOMEM;
1581 }
1582
1583 /* read the card's revision number */ 1597 /* read the card's revision number */
1584 pci_read_config_byte(pci, 8, &rme96->rev); 1598 pci_read_config_byte(pci, 8, &rme96->rev);
1585 1599
@@ -1805,7 +1819,7 @@ snd_rme96_proc_init(struct rme96 *rme96)
1805 struct snd_info_entry *entry; 1819 struct snd_info_entry *entry;
1806 1820
1807 if (! snd_card_proc_new(rme96->card, "rme96", &entry)) 1821 if (! snd_card_proc_new(rme96->card, "rme96", &entry))
1808 snd_info_set_text_ops(entry, rme96, 1024, snd_rme96_proc_read); 1822 snd_info_set_text_ops(entry, rme96, snd_rme96_proc_read);
1809} 1823}
1810 1824
1811/* 1825/*
diff --git a/sound/pci/rme9652/hdsp.c b/sound/pci/rme9652/hdsp.c
index 61f82f0d5cc6..eaf3c22449ad 100644
--- a/sound/pci/rme9652/hdsp.c
+++ b/sound/pci/rme9652/hdsp.c
@@ -389,7 +389,7 @@ MODULE_SUPPORTED_DEVICE("{{RME Hammerfall-DSP},"
389 389
390/* use hotplug firmeare loader? */ 390/* use hotplug firmeare loader? */
391#if defined(CONFIG_FW_LOADER) || defined(CONFIG_FW_LOADER_MODULE) 391#if defined(CONFIG_FW_LOADER) || defined(CONFIG_FW_LOADER_MODULE)
392#ifndef HDSP_USE_HWDEP_LOADER 392#if !defined(HDSP_USE_HWDEP_LOADER) && !defined(CONFIG_SND_HDSP)
393#define HDSP_FW_LOADER 393#define HDSP_FW_LOADER
394#endif 394#endif
395#endif 395#endif
@@ -3169,9 +3169,10 @@ snd_hdsp_proc_read(struct snd_info_entry *entry, struct snd_info_buffer *buffer)
3169 char *clock_source; 3169 char *clock_source;
3170 int x; 3170 int x;
3171 3171
3172 if (hdsp_check_for_iobox (hdsp)) 3172 if (hdsp_check_for_iobox (hdsp)) {
3173 snd_iprintf(buffer, "No I/O box connected.\nPlease connect one and upload firmware.\n"); 3173 snd_iprintf(buffer, "No I/O box connected.\nPlease connect one and upload firmware.\n");
3174 return; 3174 return;
3175 }
3175 3176
3176 if (hdsp_check_for_firmware(hdsp, 0)) { 3177 if (hdsp_check_for_firmware(hdsp, 0)) {
3177 if (hdsp->state & HDSP_FirmwareCached) { 3178 if (hdsp->state & HDSP_FirmwareCached) {
@@ -3470,7 +3471,7 @@ static void __devinit snd_hdsp_proc_init(struct hdsp *hdsp)
3470 struct snd_info_entry *entry; 3471 struct snd_info_entry *entry;
3471 3472
3472 if (! snd_card_proc_new(hdsp->card, "hdsp", &entry)) 3473 if (! snd_card_proc_new(hdsp->card, "hdsp", &entry))
3473 snd_info_set_text_ops(entry, hdsp, 1024, snd_hdsp_proc_read); 3474 snd_info_set_text_ops(entry, hdsp, snd_hdsp_proc_read);
3474} 3475}
3475 3476
3476static void snd_hdsp_free_buffers(struct hdsp *hdsp) 3477static void snd_hdsp_free_buffers(struct hdsp *hdsp)
diff --git a/sound/pci/rme9652/hdspm.c b/sound/pci/rme9652/hdspm.c
index 722b9e6ce54a..bba1615504d3 100644
--- a/sound/pci/rme9652/hdspm.c
+++ b/sound/pci/rme9652/hdspm.c
@@ -2489,7 +2489,7 @@ static void __devinit snd_hdspm_proc_init(struct hdspm * hdspm)
2489 struct snd_info_entry *entry; 2489 struct snd_info_entry *entry;
2490 2490
2491 if (!snd_card_proc_new(hdspm->card, "hdspm", &entry)) 2491 if (!snd_card_proc_new(hdspm->card, "hdspm", &entry))
2492 snd_info_set_text_ops(entry, hdspm, 1024, 2492 snd_info_set_text_ops(entry, hdspm,
2493 snd_hdspm_proc_read); 2493 snd_hdspm_proc_read);
2494} 2494}
2495 2495
diff --git a/sound/pci/rme9652/rme9652.c b/sound/pci/rme9652/rme9652.c
index 75d6406303d3..3b945e8c1b15 100644
--- a/sound/pci/rme9652/rme9652.c
+++ b/sound/pci/rme9652/rme9652.c
@@ -41,7 +41,7 @@
41static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ 41static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
42static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ 42static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
43static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */ 43static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */
44static int precise_ptr[SNDRV_CARDS] = { [0 ... (SNDRV_CARDS-1)] = 0 }; /* Enable precise pointer */ 44static int precise_ptr[SNDRV_CARDS]; /* Enable precise pointer */
45 45
46module_param_array(index, int, NULL, 0444); 46module_param_array(index, int, NULL, 0444);
47MODULE_PARM_DESC(index, "Index value for RME Digi9652 (Hammerfall) soundcard."); 47MODULE_PARM_DESC(index, "Index value for RME Digi9652 (Hammerfall) soundcard.");
@@ -1787,7 +1787,7 @@ static void __devinit snd_rme9652_proc_init(struct snd_rme9652 *rme9652)
1787 struct snd_info_entry *entry; 1787 struct snd_info_entry *entry;
1788 1788
1789 if (! snd_card_proc_new(rme9652->card, "rme9652", &entry)) 1789 if (! snd_card_proc_new(rme9652->card, "rme9652", &entry))
1790 snd_info_set_text_ops(entry, rme9652, 1024, snd_rme9652_proc_read); 1790 snd_info_set_text_ops(entry, rme9652, snd_rme9652_proc_read);
1791} 1791}
1792 1792
1793static void snd_rme9652_free_buffers(struct snd_rme9652 *rme9652) 1793static void snd_rme9652_free_buffers(struct snd_rme9652 *rme9652)
diff --git a/sound/pci/sonicvibes.c b/sound/pci/sonicvibes.c
index 91f8bf3ae9fa..dcf402948347 100644
--- a/sound/pci/sonicvibes.c
+++ b/sound/pci/sonicvibes.c
@@ -54,8 +54,8 @@ MODULE_SUPPORTED_DEVICE("{{S3,SonicVibes PCI}}");
54static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ 54static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
55static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ 55static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
56static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */ 56static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */
57static int reverb[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 0}; 57static int reverb[SNDRV_CARDS];
58static int mge[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 0}; 58static int mge[SNDRV_CARDS];
59static unsigned int dmaio = 0x7a00; /* DDMA i/o address */ 59static unsigned int dmaio = 0x7a00; /* DDMA i/o address */
60 60
61module_param_array(index, int, NULL, 0444); 61module_param_array(index, int, NULL, 0444);
@@ -1144,7 +1144,7 @@ static void __devinit snd_sonicvibes_proc_init(struct sonicvibes * sonic)
1144 struct snd_info_entry *entry; 1144 struct snd_info_entry *entry;
1145 1145
1146 if (! snd_card_proc_new(sonic->card, "sonicvibes", &entry)) 1146 if (! snd_card_proc_new(sonic->card, "sonicvibes", &entry))
1147 snd_info_set_text_ops(entry, sonic, 1024, snd_sonicvibes_proc_read); 1147 snd_info_set_text_ops(entry, sonic, snd_sonicvibes_proc_read);
1148} 1148}
1149 1149
1150/* 1150/*
@@ -1456,7 +1456,7 @@ static int __devinit snd_sonic_probe(struct pci_dev *pci,
1456 return err; 1456 return err;
1457 } 1457 }
1458 if ((err = snd_mpu401_uart_new(card, 0, MPU401_HW_SONICVIBES, 1458 if ((err = snd_mpu401_uart_new(card, 0, MPU401_HW_SONICVIBES,
1459 sonic->midi_port, 1, 1459 sonic->midi_port, MPU401_INFO_INTEGRATED,
1460 sonic->irq, 0, 1460 sonic->irq, 0,
1461 &midi_uart)) < 0) { 1461 &midi_uart)) < 0) {
1462 snd_card_free(card); 1462 snd_card_free(card);
diff --git a/sound/pci/trident/trident.c b/sound/pci/trident/trident.c
index 9624a5f2b875..5629b7eba96d 100644
--- a/sound/pci/trident/trident.c
+++ b/sound/pci/trident/trident.c
@@ -148,7 +148,8 @@ static int __devinit snd_trident_probe(struct pci_dev *pci,
148 } 148 }
149 if (trident->device != TRIDENT_DEVICE_ID_SI7018 && 149 if (trident->device != TRIDENT_DEVICE_ID_SI7018 &&
150 (err = snd_mpu401_uart_new(card, 0, MPU401_HW_TRID4DWAVE, 150 (err = snd_mpu401_uart_new(card, 0, MPU401_HW_TRID4DWAVE,
151 trident->midi_port, 1, 151 trident->midi_port,
152 MPU401_INFO_INTEGRATED,
152 trident->irq, 0, &trident->rmidi)) < 0) { 153 trident->irq, 0, &trident->rmidi)) < 0) {
153 snd_card_free(card); 154 snd_card_free(card);
154 return err; 155 return err;
diff --git a/sound/pci/trident/trident_main.c b/sound/pci/trident/trident_main.c
index 52178b8ad49d..d99ed7237750 100644
--- a/sound/pci/trident/trident_main.c
+++ b/sound/pci/trident/trident_main.c
@@ -306,6 +306,8 @@ void snd_trident_start_voice(struct snd_trident * trident, unsigned int voice)
306 outl(mask, TRID_REG(trident, reg)); 306 outl(mask, TRID_REG(trident, reg));
307} 307}
308 308
309EXPORT_SYMBOL(snd_trident_start_voice);
310
309/*--------------------------------------------------------------------------- 311/*---------------------------------------------------------------------------
310 void snd_trident_stop_voice(struct snd_trident * trident, unsigned int voice) 312 void snd_trident_stop_voice(struct snd_trident * trident, unsigned int voice)
311 313
@@ -328,6 +330,8 @@ void snd_trident_stop_voice(struct snd_trident * trident, unsigned int voice)
328 outl(mask, TRID_REG(trident, reg)); 330 outl(mask, TRID_REG(trident, reg));
329} 331}
330 332
333EXPORT_SYMBOL(snd_trident_stop_voice);
334
331/*--------------------------------------------------------------------------- 335/*---------------------------------------------------------------------------
332 int snd_trident_allocate_pcm_channel(struct snd_trident *trident) 336 int snd_trident_allocate_pcm_channel(struct snd_trident *trident)
333 337
@@ -502,6 +506,8 @@ void snd_trident_write_voice_regs(struct snd_trident * trident,
502#endif 506#endif
503} 507}
504 508
509EXPORT_SYMBOL(snd_trident_write_voice_regs);
510
505/*--------------------------------------------------------------------------- 511/*---------------------------------------------------------------------------
506 snd_trident_write_cso_reg 512 snd_trident_write_cso_reg
507 513
@@ -3332,7 +3338,7 @@ static void __devinit snd_trident_proc_init(struct snd_trident * trident)
3332 if (trident->device == TRIDENT_DEVICE_ID_SI7018) 3338 if (trident->device == TRIDENT_DEVICE_ID_SI7018)
3333 s = "sis7018"; 3339 s = "sis7018";
3334 if (! snd_card_proc_new(trident->card, s, &entry)) 3340 if (! snd_card_proc_new(trident->card, s, &entry))
3335 snd_info_set_text_ops(entry, trident, 1024, snd_trident_proc_read); 3341 snd_info_set_text_ops(entry, trident, snd_trident_proc_read);
3336} 3342}
3337 3343
3338static int snd_trident_dev_free(struct snd_device *device) 3344static int snd_trident_dev_free(struct snd_device *device)
@@ -3884,6 +3890,8 @@ struct snd_trident_voice *snd_trident_alloc_voice(struct snd_trident * trident,
3884 return NULL; 3890 return NULL;
3885} 3891}
3886 3892
3893EXPORT_SYMBOL(snd_trident_alloc_voice);
3894
3887void snd_trident_free_voice(struct snd_trident * trident, struct snd_trident_voice *voice) 3895void snd_trident_free_voice(struct snd_trident * trident, struct snd_trident_voice *voice)
3888{ 3896{
3889 unsigned long flags; 3897 unsigned long flags;
@@ -3912,6 +3920,8 @@ void snd_trident_free_voice(struct snd_trident * trident, struct snd_trident_voi
3912 private_free(voice); 3920 private_free(voice);
3913} 3921}
3914 3922
3923EXPORT_SYMBOL(snd_trident_free_voice);
3924
3915static void snd_trident_clear_voices(struct snd_trident * trident, unsigned short v_min, unsigned short v_max) 3925static void snd_trident_clear_voices(struct snd_trident * trident, unsigned short v_min, unsigned short v_max)
3916{ 3926{
3917 unsigned int i, val, mask[2] = { 0, 0 }; 3927 unsigned int i, val, mask[2] = { 0, 0 };
@@ -3993,13 +4003,3 @@ int snd_trident_resume(struct pci_dev *pci)
3993 return 0; 4003 return 0;
3994} 4004}
3995#endif /* CONFIG_PM */ 4005#endif /* CONFIG_PM */
3996
3997EXPORT_SYMBOL(snd_trident_alloc_voice);
3998EXPORT_SYMBOL(snd_trident_free_voice);
3999EXPORT_SYMBOL(snd_trident_start_voice);
4000EXPORT_SYMBOL(snd_trident_stop_voice);
4001EXPORT_SYMBOL(snd_trident_write_voice_regs);
4002/* trident_memory.c symbols */
4003EXPORT_SYMBOL(snd_trident_synth_alloc);
4004EXPORT_SYMBOL(snd_trident_synth_free);
4005EXPORT_SYMBOL(snd_trident_synth_copy_from_user);
diff --git a/sound/pci/trident/trident_memory.c b/sound/pci/trident/trident_memory.c
index 46c6982c9e88..aff3f874131c 100644
--- a/sound/pci/trident/trident_memory.c
+++ b/sound/pci/trident/trident_memory.c
@@ -349,6 +349,7 @@ snd_trident_synth_alloc(struct snd_trident *hw, unsigned int size)
349 return blk; 349 return blk;
350} 350}
351 351
352EXPORT_SYMBOL(snd_trident_synth_alloc);
352 353
353/* 354/*
354 * free a synth sample area 355 * free a synth sample area
@@ -365,6 +366,7 @@ snd_trident_synth_free(struct snd_trident *hw, struct snd_util_memblk *blk)
365 return 0; 366 return 0;
366} 367}
367 368
369EXPORT_SYMBOL(snd_trident_synth_free);
368 370
369/* 371/*
370 * reset TLB entry and free kernel page 372 * reset TLB entry and free kernel page
@@ -486,3 +488,4 @@ int snd_trident_synth_copy_from_user(struct snd_trident *trident,
486 return 0; 488 return 0;
487} 489}
488 490
491EXPORT_SYMBOL(snd_trident_synth_copy_from_user);
diff --git a/sound/pci/trident/trident_synth.c b/sound/pci/trident/trident_synth.c
index cc7af8bc55a0..9b7dee84743b 100644
--- a/sound/pci/trident/trident_synth.c
+++ b/sound/pci/trident/trident_synth.c
@@ -914,7 +914,9 @@ static int snd_trident_synth_create_port(struct snd_trident * trident, int idx)
914 &callbacks, 914 &callbacks,
915 SNDRV_SEQ_PORT_CAP_WRITE | SNDRV_SEQ_PORT_CAP_SUBS_WRITE, 915 SNDRV_SEQ_PORT_CAP_WRITE | SNDRV_SEQ_PORT_CAP_SUBS_WRITE,
916 SNDRV_SEQ_PORT_TYPE_DIRECT_SAMPLE | 916 SNDRV_SEQ_PORT_TYPE_DIRECT_SAMPLE |
917 SNDRV_SEQ_PORT_TYPE_SYNTH, 917 SNDRV_SEQ_PORT_TYPE_SYNTH |
918 SNDRV_SEQ_PORT_TYPE_HARDWARE |
919 SNDRV_SEQ_PORT_TYPE_SYNTHESIZER,
918 16, 0, 920 16, 0,
919 name); 921 name);
920 if (p->chset->port < 0) { 922 if (p->chset->port < 0) {
diff --git a/sound/pci/via82xx.c b/sound/pci/via82xx.c
index 39daf62d2bad..2527bbd958c5 100644
--- a/sound/pci/via82xx.c
+++ b/sound/pci/via82xx.c
@@ -1775,6 +1775,12 @@ static struct ac97_quirk ac97_quirks[] = {
1775 .name = "Targa Traveller 811", 1775 .name = "Targa Traveller 811",
1776 .type = AC97_TUNE_HP_ONLY, 1776 .type = AC97_TUNE_HP_ONLY,
1777 }, 1777 },
1778 {
1779 .subvendor = 0x161f,
1780 .subdevice = 0x2032,
1781 .name = "m680x",
1782 .type = AC97_TUNE_HP_ONLY, /* http://launchpad.net/bugs/38546 */
1783 },
1778 { } /* terminator */ 1784 { } /* terminator */
1779}; 1785};
1780 1786
@@ -1973,7 +1979,7 @@ static int __devinit snd_via686_init_misc(struct via82xx *chip)
1973 pci_write_config_byte(chip->pci, VIA_PNP_CONTROL, legacy_cfg); 1979 pci_write_config_byte(chip->pci, VIA_PNP_CONTROL, legacy_cfg);
1974 if (chip->mpu_res) { 1980 if (chip->mpu_res) {
1975 if (snd_mpu401_uart_new(chip->card, 0, MPU401_HW_VIA686A, 1981 if (snd_mpu401_uart_new(chip->card, 0, MPU401_HW_VIA686A,
1976 mpu_port, 1, 1982 mpu_port, MPU401_INFO_INTEGRATED,
1977 chip->irq, 0, &chip->rmidi) < 0) { 1983 chip->irq, 0, &chip->rmidi) < 0) {
1978 printk(KERN_WARNING "unable to initialize MPU-401" 1984 printk(KERN_WARNING "unable to initialize MPU-401"
1979 " at 0x%lx, skipping\n", mpu_port); 1985 " at 0x%lx, skipping\n", mpu_port);
@@ -2015,7 +2021,7 @@ static void __devinit snd_via82xx_proc_init(struct via82xx *chip)
2015 struct snd_info_entry *entry; 2021 struct snd_info_entry *entry;
2016 2022
2017 if (! snd_card_proc_new(chip->card, "via82xx", &entry)) 2023 if (! snd_card_proc_new(chip->card, "via82xx", &entry))
2018 snd_info_set_text_ops(entry, chip, 1024, snd_via82xx_proc_read); 2024 snd_info_set_text_ops(entry, chip, snd_via82xx_proc_read);
2019} 2025}
2020 2026
2021/* 2027/*
@@ -2365,7 +2371,7 @@ static int __devinit check_dxs_list(struct pci_dev *pci, int revision)
2365 { .subvendor = 0x1462, .subdevice = 0x0470, .action = VIA_DXS_SRC }, /* MSI KT880 Delta-FSR */ 2371 { .subvendor = 0x1462, .subdevice = 0x0470, .action = VIA_DXS_SRC }, /* MSI KT880 Delta-FSR */
2366 { .subvendor = 0x1462, .subdevice = 0x3800, .action = VIA_DXS_ENABLE }, /* MSI KT266 */ 2372 { .subvendor = 0x1462, .subdevice = 0x3800, .action = VIA_DXS_ENABLE }, /* MSI KT266 */
2367 { .subvendor = 0x1462, .subdevice = 0x5901, .action = VIA_DXS_NO_VRA }, /* MSI KT6 Delta-SR */ 2373 { .subvendor = 0x1462, .subdevice = 0x5901, .action = VIA_DXS_NO_VRA }, /* MSI KT6 Delta-SR */
2368 { .subvendor = 0x1462, .subdevice = 0x7023, .action = VIA_DXS_NO_VRA }, /* MSI K8T Neo2-FI */ 2374 { .subvendor = 0x1462, .subdevice = 0x7023, .action = VIA_DXS_SRC }, /* MSI K8T Neo2-FI */
2369 { .subvendor = 0x1462, .subdevice = 0x7120, .action = VIA_DXS_ENABLE }, /* MSI KT4V */ 2375 { .subvendor = 0x1462, .subdevice = 0x7120, .action = VIA_DXS_ENABLE }, /* MSI KT4V */
2370 { .subvendor = 0x1462, .subdevice = 0x7142, .action = VIA_DXS_ENABLE }, /* MSI K8MM-V */ 2376 { .subvendor = 0x1462, .subdevice = 0x7142, .action = VIA_DXS_ENABLE }, /* MSI K8MM-V */
2371 { .subvendor = 0x1462, .subdevice = 0xb012, .action = VIA_DXS_SRC }, /* P4M800/VIA8237R */ 2377 { .subvendor = 0x1462, .subdevice = 0xb012, .action = VIA_DXS_SRC }, /* P4M800/VIA8237R */
diff --git a/sound/pci/via82xx_modem.c b/sound/pci/via82xx_modem.c
index ef97e50cd6c2..577a2b03759f 100644
--- a/sound/pci/via82xx_modem.c
+++ b/sound/pci/via82xx_modem.c
@@ -929,7 +929,7 @@ static void __devinit snd_via82xx_proc_init(struct via82xx_modem *chip)
929 struct snd_info_entry *entry; 929 struct snd_info_entry *entry;
930 930
931 if (! snd_card_proc_new(chip->card, "via82xx", &entry)) 931 if (! snd_card_proc_new(chip->card, "via82xx", &entry))
932 snd_info_set_text_ops(entry, chip, 1024, snd_via82xx_proc_read); 932 snd_info_set_text_ops(entry, chip, snd_via82xx_proc_read);
933} 933}
934 934
935/* 935/*
diff --git a/sound/pci/ymfpci/ymfpci.c b/sound/pci/ymfpci/ymfpci.c
index 65ebf5f1933a..26aa775b7b69 100644
--- a/sound/pci/ymfpci/ymfpci.c
+++ b/sound/pci/ymfpci/ymfpci.c
@@ -308,7 +308,8 @@ static int __devinit snd_card_ymfpci_probe(struct pci_dev *pci,
308 } 308 }
309 if (chip->mpu_res) { 309 if (chip->mpu_res) {
310 if ((err = snd_mpu401_uart_new(card, 0, MPU401_HW_YMFPCI, 310 if ((err = snd_mpu401_uart_new(card, 0, MPU401_HW_YMFPCI,
311 mpu_port[dev], 1, 311 mpu_port[dev],
312 MPU401_INFO_INTEGRATED,
312 pci->irq, 0, &chip->rawmidi)) < 0) { 313 pci->irq, 0, &chip->rawmidi)) < 0) {
313 printk(KERN_WARNING "ymfpci: cannot initialize MPU401 at 0x%lx, skipping...\n", mpu_port[dev]); 314 printk(KERN_WARNING "ymfpci: cannot initialize MPU401 at 0x%lx, skipping...\n", mpu_port[dev]);
314 legacy_ctrl &= ~YMFPCI_LEGACY_MIEN; /* disable MPU401 irq */ 315 legacy_ctrl &= ~YMFPCI_LEGACY_MIEN; /* disable MPU401 irq */
diff --git a/sound/pci/ymfpci/ymfpci_main.c b/sound/pci/ymfpci/ymfpci_main.c
index 8ac5ab50b5c7..f894752523bb 100644
--- a/sound/pci/ymfpci/ymfpci_main.c
+++ b/sound/pci/ymfpci/ymfpci_main.c
@@ -1919,7 +1919,7 @@ static int __devinit snd_ymfpci_proc_init(struct snd_card *card, struct snd_ymfp
1919 struct snd_info_entry *entry; 1919 struct snd_info_entry *entry;
1920 1920
1921 if (! snd_card_proc_new(card, "ymfpci", &entry)) 1921 if (! snd_card_proc_new(card, "ymfpci", &entry))
1922 snd_info_set_text_ops(entry, chip, 1024, snd_ymfpci_proc_read); 1922 snd_info_set_text_ops(entry, chip, snd_ymfpci_proc_read);
1923 return 0; 1923 return 0;
1924} 1924}
1925 1925