Add a PCI ID for the Xonar HDAV1.3 Slim. There is no actual support,
but the presence of the ID allows the EEPROM repair code to work for
this card.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
The controller on the Xonar DS is labeled "AV66", not "AV200".
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
For the WM8776 chip, this driver uses a different sample format and
more features than the Windows driver. When rebooting from Linux into
Windows, the latter driver does not reset the chip but assumes all its
registers have their default settings, so we get garbled sound or, if
the output happened to be muted before rebooting, no sound.
To make that driver happy, hook our driver's cleanup function into the
shutdown notifier and ensure that the chip gets reset.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Reported-and-tested-by: Nathan Schagen
Cc: <stable@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Use DEFINE_PCI_DEVICE_TABLE() to make PCI device ids go to
.devinit.rodata section, so they can be discarded in some cases,
and make them const.
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
The virtuoso.c file has become rather big. This patch splits it up so
that only code for very similar card models is in one file.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
When resuming, we better take the DACs out of the reset state before
trying to use them.
Reference: kernel bug #13599http://bugzilla.kernel.org/show_bug.cgi?id=13599
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Cc: <stable@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Add support for the Asus Xonar Essence ST and its daughterboard.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
The Xonar HDAV1.3 has a digital input jack, so enable the corresponding
device.
This is not related to the HDMI stuff, which stays unsupported.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Add another PCI ID for a second revision of the Xonar DX.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Use -60 dB as the minimum value of the master volume mixer control.
While the DACs would support ranges down to about -120 dB, such
attenuations are not useful in practice.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Under as yet unknown circumstances, the first word of the sound card's
EEPROM gets overwritten. When this has happened, we cannot rely on the
subsystem IDs that the kernel reads from the PCI configuration
registers. Instead, we read the IDs directly from the EEPROM and do the
ID matching manually.
Because the model-specific driver cannot determine the model before
calling oxygen_pci_probe(), that function now gets a get_model()
callback as parameter. The customizing of the model structure, which
was formerly done by the probe() callback, also has moved into
get_model().
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Move the owner field out of the oxygen_model structure and make it
a parameter of oxygen_pci_probe(), because the actual owner module does
not depend on the card model. Furthermore, moving it out of the model
structure allows us to create the card structure before the actual model
is known.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This reverts commit 7e86c0e685 ("do not
overwrite EEPROM on Xonar D2/D2X") because it did not actually help with
the problem.
More user reports show that the overwriting of the EEPROM is not
triggered by using this driver but by installing Linux, and that the
installation of any other operating system (even one without any CMI8788
driver) has the same effect. In other words, the presence of this
driver does not have any effect on the occurrence of the error. (So
far, the available evidence seems to point to a BIOS bug.)
Furthermore, it turns out that the EEPROM chip is protected against
stray write commands by the command format and by requiring a separate
write-enable command, so the error scenario in the previous commit (that
SPI writes can be misinterpreted as an EEPROM write command) is not even
theoretically possible.
The mixer control that was removed as a consequence of the previous
commit can only be partially emulated in userspace, which also means it
cannot be seen be the in-kernel OSS API emulation, so it is better to
revert that change.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Cc: <stable@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This hardware has a better chance of working correctly if we don't
forget to enable it.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Cc: <stable@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
On the Asus Xonar D2 and D2X models, the SPI chip select signal for the
fourth DAC shares its pin with the serial clock for the EEPROM that
contains the PCI subdevice ID values. It appears that when DAC
registers are written and some other unknown conditions occur (probably
noise on the EEPROM's chip select line), the EEPROM gets overwritten
with garbage, which makes it impossible to properly detect the card
later.
Therefore, we better avoid DAC register writes and make sure that the
driver works with the DAC's registers' default values. Consequently,
the sample format is now I2S instead of left-justified (no user-visible
change), and the DAC's volume/mute registers cannot be used anymore
(volume changes are now done by the software volume plugin).
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Cc: <stable@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Rename the callback function that switches between line and mic inputs
on the Xonar D1 because it is also usable on other models.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Do not use a hardcoded number when iterating over the PCM1796 DACs to
allow for cards with a different number of analog output channels.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Introduce some trivial functions to better document the relationships of
the various model callbacks.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
To enable the MIDI port, model drivers must now set flags in
device_config, not only in misc_flags. This allows model drivers to
enable the UART without creating an ALSA MIDI device.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Rename the pcm_dev_cfg field to device_config because there will be
additional flags that do not describe PCM devices.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Factor out the common code of the mixer callbacks that handle controls
that just switch a single GPIO bit.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
The Xonar D2X and DX are very similar to the D2 and D1, respectively, so
we can handle the differences dynamically instead of using a separate
model structure for each one.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Add a probe callback to the model structure so that model-specific
drivers can refine their model detection before the card is initialized.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Add support for the Asus Xonar D1. It is the same as the DX, but
without the external power detection.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Move the setting of the output enable GPIO bit to a separate function.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Create separate functions for the code that initializes the hardware, as
opposed to initializing internal driver state, so that they can be
reused for resume support.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
When initializing the DAC volume registers, we can just use the generic
volume update functions instead of setting the registers manually.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Save the written values of all CMI8788 and AC97 registers and of some of
the DAC/ADC registers so that it is possible to restore the register
state later.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Adjust the MODULE_LICENSE strings to properly reflect the actual license.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Add a pointer for DAC volume TLV data to the model structure so that the
model driver do not need to manually assign it in their control filter.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Initialize the playback volume controls as being muted and having
minimal volume.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Add fields for the DAC volume limits to the module structure so that
model drivers do not need to install their own control info handlers.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Fix the GPIO 1 mixer control to enable I/O through the front panel
connector of the Xonar DX.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
On the Xonar DX, initialize all bits of the two-wire control register.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Add a mixer control for switching whatever it is that is connected to
GPIO pin 1 on the Xonar DX.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
If the card model does not have a digital input or an AC97 codec,
disable the respective interrupt and mixer controls.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
When selecting the capture source on the Xonar DX, the input jack must
be routed to either the line input or the microphone input by setting a
GPIO pin. This requires an additional callback so that the model driver
can hook into the toggling of AC97 switches.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Change the card short name to show to show the card name instead of the
chip name.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
When playing data at 96 kHz or higher, reduce the DAC oversampling rate
to 32.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Move the code that is common to all Xonar models to a separate function,
and make it more generic in preparation for another model.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Rename all CS5381 symbols to CS53x1 because they can also be used for
Xonar models with a CS5361.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Use separate model structures for the D2 and D2X so that the init
function does not have to check for the model again.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>