#include <linux/delay.h>
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/pci.h>
#include <linux/slab.h>
#include <linux/module.h>
#include <linux/dma-mapping.h>
#include <sound/core.h>
#include <sound/initval.h>
#include <sound/pcm.h>
#include <sound/ac97_codec.h>
#include <sound/info.h>
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;
static int index[SNDRV_CARDS] = …;
static char *id[SNDRV_CARDS] = …;
static bool enable[SNDRV_CARDS] = …;
static uint subsystem[SNDRV_CARDS];
module_param_array(…);
MODULE_PARM_DESC(…) …;
module_param_array(…);
MODULE_PARM_DESC(…) …;
module_param_array(…);
MODULE_PARM_DESC(…) …;
module_param_array(…);
MODULE_PARM_DESC(…) …;
#include "ca0106.h"
static const struct snd_ca0106_details ca0106_chip_details[] = …;
static const struct snd_pcm_hardware snd_ca0106_playback_hw = …;
static const struct snd_pcm_hardware snd_ca0106_capture_hw = …;
unsigned int snd_ca0106_ptr_read(struct snd_ca0106 * emu,
unsigned int reg,
unsigned int chn)
{ … }
void snd_ca0106_ptr_write(struct snd_ca0106 *emu,
unsigned int reg,
unsigned int chn,
unsigned int data)
{ … }
int snd_ca0106_spi_write(struct snd_ca0106 * emu,
unsigned int data)
{ … }
int snd_ca0106_i2c_write(struct snd_ca0106 *emu,
u32 reg,
u32 value)
{ … }
static void snd_ca0106_intr_enable(struct snd_ca0106 *emu, unsigned int intrenb)
{ … }
static void snd_ca0106_intr_disable(struct snd_ca0106 *emu, unsigned int intrenb)
{ … }
static void snd_ca0106_pcm_free_substream(struct snd_pcm_runtime *runtime)
{ … }
static const int spi_dacd_reg[] = …;
static const int spi_dacd_bit[] = …;
static void restore_spdif_bits(struct snd_ca0106 *chip, int idx)
{ … }
static int snd_ca0106_channel_dac(struct snd_ca0106 *chip,
const struct snd_ca0106_details *details,
int channel_id)
{ … }
static int snd_ca0106_pcm_power_dac(struct snd_ca0106 *chip, int channel_id,
int power)
{ … }
static int snd_ca0106_pcm_open_playback_channel(struct snd_pcm_substream *substream,
int channel_id)
{ … }
static int snd_ca0106_pcm_close_playback(struct snd_pcm_substream *substream)
{ … }
static int snd_ca0106_pcm_open_playback_front(struct snd_pcm_substream *substream)
{ … }
static int snd_ca0106_pcm_open_playback_center_lfe(struct snd_pcm_substream *substream)
{ … }
static int snd_ca0106_pcm_open_playback_unknown(struct snd_pcm_substream *substream)
{ … }
static int snd_ca0106_pcm_open_playback_rear(struct snd_pcm_substream *substream)
{ … }
static int snd_ca0106_pcm_open_capture_channel(struct snd_pcm_substream *substream,
int channel_id)
{ … }
static int snd_ca0106_pcm_close_capture(struct snd_pcm_substream *substream)
{ … }
static int snd_ca0106_pcm_open_0_capture(struct snd_pcm_substream *substream)
{ … }
static int snd_ca0106_pcm_open_1_capture(struct snd_pcm_substream *substream)
{ … }
static int snd_ca0106_pcm_open_2_capture(struct snd_pcm_substream *substream)
{ … }
static int snd_ca0106_pcm_open_3_capture(struct snd_pcm_substream *substream)
{ … }
static int snd_ca0106_pcm_prepare_playback(struct snd_pcm_substream *substream)
{ … }
static int snd_ca0106_pcm_prepare_capture(struct snd_pcm_substream *substream)
{ … }
static int snd_ca0106_pcm_trigger_playback(struct snd_pcm_substream *substream,
int cmd)
{ … }
static int snd_ca0106_pcm_trigger_capture(struct snd_pcm_substream *substream,
int cmd)
{ … }
static snd_pcm_uframes_t
snd_ca0106_pcm_pointer_playback(struct snd_pcm_substream *substream)
{ … }
static snd_pcm_uframes_t
snd_ca0106_pcm_pointer_capture(struct snd_pcm_substream *substream)
{ … }
static const struct snd_pcm_ops snd_ca0106_playback_front_ops = …;
static const struct snd_pcm_ops snd_ca0106_capture_0_ops = …;
static const struct snd_pcm_ops snd_ca0106_capture_1_ops = …;
static const struct snd_pcm_ops snd_ca0106_capture_2_ops = …;
static const struct snd_pcm_ops snd_ca0106_capture_3_ops = …;
static const struct snd_pcm_ops snd_ca0106_playback_center_lfe_ops = …;
static const struct snd_pcm_ops snd_ca0106_playback_unknown_ops = …;
static const struct snd_pcm_ops snd_ca0106_playback_rear_ops = …;
static unsigned short snd_ca0106_ac97_read(struct snd_ac97 *ac97,
unsigned short reg)
{ … }
static void snd_ca0106_ac97_write(struct snd_ac97 *ac97,
unsigned short reg, unsigned short val)
{ … }
static int snd_ca0106_ac97(struct snd_ca0106 *chip)
{ … }
static void ca0106_stop_chip(struct snd_ca0106 *chip);
static void snd_ca0106_free(struct snd_card *card)
{ … }
static irqreturn_t snd_ca0106_interrupt(int irq, void *dev_id)
{ … }
static const struct snd_pcm_chmap_elem surround_map[] = …;
static const struct snd_pcm_chmap_elem clfe_map[] = …;
static const struct snd_pcm_chmap_elem side_map[] = …;
static int snd_ca0106_pcm(struct snd_ca0106 *emu, int device)
{ … }
#define SPI_REG(reg, value) …
static const unsigned int spi_dac_init[] = …;
static const unsigned int i2c_adc_init[][2] = …;
static void ca0106_init_chip(struct snd_ca0106 *chip, int resume)
{ … }
static void ca0106_stop_chip(struct snd_ca0106 *chip)
{ … }
static int snd_ca0106_create(int dev, struct snd_card *card,
struct pci_dev *pci)
{ … }
static void ca0106_midi_interrupt_enable(struct snd_ca_midi *midi, int intr)
{ … }
static void ca0106_midi_interrupt_disable(struct snd_ca_midi *midi, int intr)
{ … }
static unsigned char ca0106_midi_read(struct snd_ca_midi *midi, int idx)
{ … }
static void ca0106_midi_write(struct snd_ca_midi *midi, int data, int idx)
{ … }
static struct snd_card *ca0106_dev_id_card(void *dev_id)
{ … }
static int ca0106_dev_id_port(void *dev_id)
{ … }
static int snd_ca0106_midi(struct snd_ca0106 *chip, unsigned int channel)
{ … }
static int __snd_ca0106_probe(struct pci_dev *pci,
const struct pci_device_id *pci_id)
{ … }
static int snd_ca0106_probe(struct pci_dev *pci,
const struct pci_device_id *pci_id)
{ … }
#ifdef CONFIG_PM_SLEEP
static int snd_ca0106_suspend(struct device *dev)
{ … }
static int snd_ca0106_resume(struct device *dev)
{ … }
static SIMPLE_DEV_PM_OPS(snd_ca0106_pm, snd_ca0106_suspend, snd_ca0106_resume);
#define SND_CA0106_PM_OPS …
#else
#define SND_CA0106_PM_OPS …
#endif
static const struct pci_device_id snd_ca0106_ids[] = …;
MODULE_DEVICE_TABLE(pci, snd_ca0106_ids);
static struct pci_driver ca0106_driver = …;
module_pci_driver(…) …;