// SPDX-License-Identifier: GPL-2.0-or-later /* * cs5530.c - Initialisation code for Cyrix/NatSemi VSA1 softaudio * * (C) Copyright 2007 Ash Willis <[email protected]> * (C) Copyright 2003 Red Hat Inc <[email protected]> * * This driver was ported (shamelessly ripped ;) from oss/kahlua.c but I did * mess with it a bit. The chip seems to have to have trouble with full duplex * mode. If we're recording in 8bit 8000kHz, say, and we then attempt to * simultaneously play back audio at 16bit 44100kHz, the device actually plays * back in the same format in which it is capturing. By forcing the chip to * always play/capture in 16/44100, we can let alsa-lib convert the samples and * that way we can hack up some full duplex audio. * * XpressAudio(tm) is used on the Cyrix MediaGX (now NatSemi Geode) systems. * The older version (VSA1) provides fairly good soundblaster emulation * although there are a couple of bugs: large DMA buffers break record, * and the MPU event handling seems suspect. VSA2 allows the native driver * to control the AC97 audio engine directly and requires a different driver. * * Thanks to National Semiconductor for providing the needed information * on the XpressAudio(tm) internals. * * TO DO: * Investigate whether we can portably support Cognac (5520) in the * same manner. */ #include <linux/delay.h> #include <linux/module.h> #include <linux/pci.h> #include <linux/slab.h> #include <sound/core.h> #include <sound/sb.h> #include <sound/initval.h> MODULE_AUTHOR(…) …; MODULE_DESCRIPTION(…) …; MODULE_LICENSE(…) …; static int index[SNDRV_CARDS] = …; static char *id[SNDRV_CARDS] = …; static bool enable[SNDRV_CARDS] = …; module_param_array(…); MODULE_PARM_DESC(…) …; module_param_array(…); MODULE_PARM_DESC(…) …; module_param_array(…); MODULE_PARM_DESC(…) …; struct snd_cs5530 { … }; static const struct pci_device_id snd_cs5530_ids[] = …; MODULE_DEVICE_TABLE(pci, snd_cs5530_ids); static u8 snd_cs5530_mixer_read(unsigned long io, u8 reg) { … } static int snd_cs5530_create(struct snd_card *card, struct pci_dev *pci) { … } static int snd_cs5530_probe(struct pci_dev *pci, const struct pci_device_id *pci_id) { … } static struct pci_driver cs5530_driver = …; module_pci_driver(…) …;