diff options
Diffstat (limited to 'sound/pci/azt3328.c')
-rw-r--r-- | sound/pci/azt3328.c | 34 |
1 files changed, 23 insertions, 11 deletions
diff --git a/sound/pci/azt3328.c b/sound/pci/azt3328.c index 43edd2839b5a..36d3666a5b77 100644 --- a/sound/pci/azt3328.c +++ b/sound/pci/azt3328.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | * azt3328.c - driver for Aztech AZF3328 based soundcards (e.g. PCI168). | 2 | * azt3328.c - driver for Aztech AZF3328 based soundcards (e.g. PCI168). |
3 | * Copyright (C) 2002, 2005 by Andreas Mohr <andi AT lisas.de> | 3 | * Copyright (C) 2002, 2005, 2006, 2007 by Andreas Mohr <andi AT lisas.de> |
4 | * | 4 | * |
5 | * Framework borrowed from Bart Hartgers's als4000.c. | 5 | * Framework borrowed from Bart Hartgers's als4000.c. |
6 | * Driver developed on PCI168 AP(W) version (PCI rev. 10, subsystem ID 1801), | 6 | * Driver developed on PCI168 AP(W) version (PCI rev. 10, subsystem ID 1801), |
@@ -52,6 +52,9 @@ | |||
52 | * - full duplex 16bit playback/record at independent sampling rate | 52 | * - full duplex 16bit playback/record at independent sampling rate |
53 | * - MPU401 (+ legacy address support) FIXME: how to enable legacy addr?? | 53 | * - MPU401 (+ legacy address support) FIXME: how to enable legacy addr?? |
54 | * - game port (legacy address support) | 54 | * - game port (legacy address support) |
55 | * - builtin 3D enhancement (said to be YAMAHA Ymersion) | ||
56 | * - builtin DirectInput support, helps reduce CPU overhead (interrupt-driven | ||
57 | * features supported) | ||
55 | * - built-in General DirectX timer having a 20 bits counter | 58 | * - built-in General DirectX timer having a 20 bits counter |
56 | * with 1us resolution (see below!) | 59 | * with 1us resolution (see below!) |
57 | * - I2S serial port for external DAC | 60 | * - I2S serial port for external DAC |
@@ -94,6 +97,10 @@ | |||
94 | * | 97 | * |
95 | * BUGS | 98 | * BUGS |
96 | * - full-duplex might *still* be problematic, not fully tested recently | 99 | * - full-duplex might *still* be problematic, not fully tested recently |
100 | * - (non-bug) "Bass/Treble or 3D settings don't work" - they do get evaluated | ||
101 | * if you set PCM output switch to "pre 3D" instead of "post 3D". | ||
102 | * If this can't be set, then get a mixer application that Isn't Stupid (tm) | ||
103 | * (e.g. kmix, gamix) - unfortunately several are!! | ||
97 | * | 104 | * |
98 | * TODO | 105 | * TODO |
99 | * - test MPU401 MIDI playback etc. | 106 | * - test MPU401 MIDI playback etc. |
@@ -622,7 +629,7 @@ snd_azf3328_put_mixer_enum(struct snd_kcontrol *kcontrol, | |||
622 | return (nreg != oreg); | 629 | return (nreg != oreg); |
623 | } | 630 | } |
624 | 631 | ||
625 | static const struct snd_kcontrol_new snd_azf3328_mixer_controls[] __devinitdata = { | 632 | static struct snd_kcontrol_new snd_azf3328_mixer_controls[] __devinitdata = { |
626 | AZF3328_MIXER_SWITCH("Master Playback Switch", IDX_MIXER_PLAY_MASTER, 15, 1), | 633 | AZF3328_MIXER_SWITCH("Master Playback Switch", IDX_MIXER_PLAY_MASTER, 15, 1), |
627 | AZF3328_MIXER_VOL_STEREO("Master Playback Volume", IDX_MIXER_PLAY_MASTER, 0x1f, 1), | 634 | AZF3328_MIXER_VOL_STEREO("Master Playback Volume", IDX_MIXER_PLAY_MASTER, 0x1f, 1), |
628 | AZF3328_MIXER_SWITCH("Wave Playback Switch", IDX_MIXER_WAVEOUT, 15, 1), | 635 | AZF3328_MIXER_SWITCH("Wave Playback Switch", IDX_MIXER_WAVEOUT, 15, 1), |
@@ -652,7 +659,7 @@ static const struct snd_kcontrol_new snd_azf3328_mixer_controls[] __devinitdata | |||
652 | AZF3328_MIXER_VOL_MONO("Modem Capture Volume", IDX_MIXER_MODEMIN, 0x1f, 1), | 659 | AZF3328_MIXER_VOL_MONO("Modem Capture Volume", IDX_MIXER_MODEMIN, 0x1f, 1), |
653 | AZF3328_MIXER_ENUM("Mic Select", IDX_MIXER_ADVCTL2, 2, 8), | 660 | AZF3328_MIXER_ENUM("Mic Select", IDX_MIXER_ADVCTL2, 2, 8), |
654 | AZF3328_MIXER_ENUM("Mono Output Select", IDX_MIXER_ADVCTL2, 2, 9), | 661 | 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! */ | 662 | AZF3328_MIXER_ENUM("PCM Output Route", IDX_MIXER_ADVCTL2, 2, 15), /* PCM Out Path, place in front since it controls *both* 3D and Bass/Treble! */ |
656 | AZF3328_MIXER_VOL_SPECIAL("Tone Control - Treble", IDX_MIXER_BASSTREBLE, 0x07, 1, 0), | 663 | AZF3328_MIXER_VOL_SPECIAL("Tone Control - Treble", IDX_MIXER_BASSTREBLE, 0x07, 1, 0), |
657 | AZF3328_MIXER_VOL_SPECIAL("Tone Control - Bass", IDX_MIXER_BASSTREBLE, 0x07, 9, 0), | 664 | AZF3328_MIXER_VOL_SPECIAL("Tone Control - Bass", IDX_MIXER_BASSTREBLE, 0x07, 9, 0), |
658 | AZF3328_MIXER_SWITCH("3D Control - Switch", IDX_MIXER_ADVCTL2, 13, 0), | 665 | AZF3328_MIXER_SWITCH("3D Control - Switch", IDX_MIXER_ADVCTL2, 13, 0), |
@@ -678,7 +685,7 @@ static const struct snd_kcontrol_new snd_azf3328_mixer_controls[] __devinitdata | |||
678 | #endif | 685 | #endif |
679 | }; | 686 | }; |
680 | 687 | ||
681 | static const u16 __devinitdata snd_azf3328_init_values[][2] = { | 688 | static u16 __devinitdata snd_azf3328_init_values[][2] = { |
682 | { IDX_MIXER_PLAY_MASTER, MIXER_MUTE_MASK|0x1f1f }, | 689 | { IDX_MIXER_PLAY_MASTER, MIXER_MUTE_MASK|0x1f1f }, |
683 | { IDX_MIXER_MODEMOUT, MIXER_MUTE_MASK|0x1f1f }, | 690 | { IDX_MIXER_MODEMOUT, MIXER_MUTE_MASK|0x1f1f }, |
684 | { IDX_MIXER_BASSTREBLE, 0x0000 }, | 691 | { IDX_MIXER_BASSTREBLE, 0x0000 }, |
@@ -1369,7 +1376,6 @@ snd_azf3328_playback_close(struct snd_pcm_substream *substream) | |||
1369 | struct snd_azf3328 *chip = snd_pcm_substream_chip(substream); | 1376 | struct snd_azf3328 *chip = snd_pcm_substream_chip(substream); |
1370 | 1377 | ||
1371 | snd_azf3328_dbgcallenter(); | 1378 | snd_azf3328_dbgcallenter(); |
1372 | |||
1373 | chip->playback_substream = NULL; | 1379 | chip->playback_substream = NULL; |
1374 | snd_azf3328_dbgcallleave(); | 1380 | snd_azf3328_dbgcallleave(); |
1375 | return 0; | 1381 | return 0; |
@@ -1660,10 +1666,10 @@ snd_azf3328_test_bit(unsigned int reg, int bit) | |||
1660 | } | 1666 | } |
1661 | #endif | 1667 | #endif |
1662 | 1668 | ||
1669 | #if DEBUG_MISC | ||
1663 | static void | 1670 | static void |
1664 | snd_azf3328_debug_show_ports(const struct snd_azf3328 *chip) | 1671 | snd_azf3328_debug_show_ports(const struct snd_azf3328 *chip) |
1665 | { | 1672 | { |
1666 | #if DEBUG_MISC | ||
1667 | u16 tmp; | 1673 | u16 tmp; |
1668 | 1674 | ||
1669 | snd_azf3328_dbgmisc("codec_port 0x%lx, io2_port 0x%lx, mpu_port 0x%lx, synth_port 0x%lx, mixer_port 0x%lx, irq %d\n", chip->codec_port, chip->io2_port, chip->mpu_port, chip->synth_port, chip->mixer_port, chip->irq); | 1675 | snd_azf3328_dbgmisc("codec_port 0x%lx, io2_port 0x%lx, mpu_port 0x%lx, synth_port 0x%lx, mixer_port 0x%lx, irq %d\n", chip->codec_port, chip->io2_port, chip->mpu_port, chip->synth_port, chip->mixer_port, chip->irq); |
@@ -1673,10 +1679,16 @@ snd_azf3328_debug_show_ports(const struct snd_azf3328 *chip) | |||
1673 | for (tmp=0; tmp <= 0x01; tmp += 1) | 1679 | for (tmp=0; tmp <= 0x01; tmp += 1) |
1674 | snd_azf3328_dbgmisc("0x%02x: opl 0x%04x, mpu300 0x%04x, mpu310 0x%04x, mpu320 0x%04x, mpu330 0x%04x\n", tmp, inb(0x388 + tmp), inb(0x300 + tmp), inb(0x310 + tmp), inb(0x320 + tmp), inb(0x330 + tmp)); | 1680 | snd_azf3328_dbgmisc("0x%02x: opl 0x%04x, mpu300 0x%04x, mpu310 0x%04x, mpu320 0x%04x, mpu330 0x%04x\n", tmp, inb(0x388 + tmp), inb(0x300 + tmp), inb(0x310 + tmp), inb(0x320 + tmp), inb(0x330 + tmp)); |
1675 | 1681 | ||
1676 | for (tmp = 0; tmp <= 0x6E; tmp += 2) | 1682 | for (tmp = 0; tmp < AZF_IO_SIZE_CODEC; tmp += 2) |
1677 | snd_azf3328_dbgmisc("0x%02x: 0x%04x\n", tmp, snd_azf3328_codec_inb(chip, tmp)); | 1683 | snd_azf3328_dbgmisc("codec 0x%02x: 0x%04x\n", tmp, snd_azf3328_codec_inw(chip, tmp)); |
1678 | #endif | 1684 | |
1685 | for (tmp = 0; tmp < AZF_IO_SIZE_MIXER; tmp += 2) | ||
1686 | snd_azf3328_dbgmisc("mixer 0x%02x: 0x%04x\n", tmp, snd_azf3328_mixer_inw(chip, tmp)); | ||
1679 | } | 1687 | } |
1688 | #else | ||
1689 | static inline void | ||
1690 | snd_azf3328_debug_show_ports(const struct snd_azf3328 *chip) {} | ||
1691 | #endif | ||
1680 | 1692 | ||
1681 | static int __devinit | 1693 | static int __devinit |
1682 | snd_azf3328_create(struct snd_card *card, | 1694 | snd_azf3328_create(struct snd_card *card, |
@@ -1842,8 +1854,8 @@ snd_azf3328_probe(struct pci_dev *pci, const struct pci_device_id *pci_id) | |||
1842 | 1854 | ||
1843 | #ifdef MODULE | 1855 | #ifdef MODULE |
1844 | printk( | 1856 | printk( |
1845 | "azt3328: Sound driver for Aztech AZF3328-based soundcards such as PCI168\n" | 1857 | "azt3328: Sound driver for Aztech AZF3328-based soundcards such as PCI168.\n" |
1846 | "azt3328: (hardware was completely undocumented - ZERO support from Aztech).\n" | 1858 | "azt3328: Hardware was completely undocumented, unfortunately.\n" |
1847 | "azt3328: Feel free to contact andi AT lisas.de for bug reports etc.!\n" | 1859 | "azt3328: Feel free to contact andi AT lisas.de for bug reports etc.!\n" |
1848 | "azt3328: User-scalable sequencer timer set to %dHz (1024000Hz / %d).\n", | 1860 | "azt3328: User-scalable sequencer timer set to %dHz (1024000Hz / %d).\n", |
1849 | 1024000 / seqtimer_scaling, seqtimer_scaling); | 1861 | 1024000 / seqtimer_scaling, seqtimer_scaling); |