#include "cx88.h"
#include "cx88-reg.h"
#include <linux/module.h>
#include <linux/init.h>
#include <linux/delay.h>
#include <linux/device.h>
#include <linux/interrupt.h>
#include <linux/vmalloc.h>
#include <linux/dma-mapping.h>
#include <linux/pci.h>
#include <linux/slab.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/pcm_params.h>
#include <sound/control.h>
#include <sound/initval.h>
#include <sound/tlv.h>
#include <media/i2c/wm8775.h>
#define dprintk(level, fmt, arg...) …
struct cx88_audio_buffer { … };
struct cx88_audio_dev { … };
static int index[SNDRV_CARDS] = …;
static const char *id[SNDRV_CARDS] = …;
static bool enable[SNDRV_CARDS] = …;
module_param_array(…);
MODULE_PARM_DESC(…) …;
module_param_array(…);
MODULE_PARM_DESC(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;
MODULE_VERSION(…);
static unsigned int debug;
module_param(debug, int, 0644);
MODULE_PARM_DESC(…) …;
static int _cx88_start_audio_dma(struct cx88_audio_dev *chip)
{ … }
static int _cx88_stop_audio_dma(struct cx88_audio_dev *chip)
{ … }
#define MAX_IRQ_LOOP …
static const char *cx88_aud_irqs[32] = …;
static void cx8801_aud_irq(struct cx88_audio_dev *chip)
{ … }
static irqreturn_t cx8801_irq(int irq, void *dev_id)
{ … }
static int cx88_alsa_dma_init(struct cx88_audio_dev *chip,
unsigned long nr_pages)
{ … }
static int cx88_alsa_dma_map(struct cx88_audio_dev *dev)
{ … }
static int cx88_alsa_dma_unmap(struct cx88_audio_dev *dev)
{ … }
static int cx88_alsa_dma_free(struct cx88_audio_buffer *buf)
{ … }
static int dsp_buffer_free(struct cx88_audio_dev *chip)
{ … }
#define DEFAULT_FIFO_SIZE …
static const struct snd_pcm_hardware snd_cx88_digital_hw = …;
static int snd_cx88_pcm_open(struct snd_pcm_substream *substream)
{ … }
static int snd_cx88_close(struct snd_pcm_substream *substream)
{ … }
static int snd_cx88_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *hw_params)
{ … }
static int snd_cx88_hw_free(struct snd_pcm_substream *substream)
{ … }
static int snd_cx88_prepare(struct snd_pcm_substream *substream)
{ … }
static int snd_cx88_card_trigger(struct snd_pcm_substream *substream, int cmd)
{ … }
static snd_pcm_uframes_t snd_cx88_pointer(struct snd_pcm_substream *substream)
{ … }
static struct page *snd_cx88_page(struct snd_pcm_substream *substream,
unsigned long offset)
{ … }
static const struct snd_pcm_ops snd_cx88_pcm_ops = …;
static int snd_cx88_pcm(struct cx88_audio_dev *chip, int device,
const char *name)
{ … }
static int snd_cx88_volume_info(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *info)
{ … }
static int snd_cx88_volume_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *value)
{ … }
static void snd_cx88_wm8775_volume_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *value)
{ … }
static int snd_cx88_volume_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *value)
{ … }
static const DECLARE_TLV_DB_SCALE(snd_cx88_db_scale, -6300, 100, 0);
static const struct snd_kcontrol_new snd_cx88_volume = …;
static int snd_cx88_switch_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *value)
{ … }
static int snd_cx88_switch_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *value)
{ … }
static const struct snd_kcontrol_new snd_cx88_dac_switch = …;
static const struct snd_kcontrol_new snd_cx88_source_switch = …;
static int snd_cx88_alc_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *value)
{ … }
static int snd_cx88_alc_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *value)
{ … }
static const struct snd_kcontrol_new snd_cx88_alc_switch = …;
static const struct pci_device_id cx88_audio_pci_tbl[] = …;
MODULE_DEVICE_TABLE(pci, cx88_audio_pci_tbl);
static int snd_cx88_free(struct cx88_audio_dev *chip)
{ … }
static void snd_cx88_dev_free(struct snd_card *card)
{ … }
static int devno;
static int snd_cx88_create(struct snd_card *card, struct pci_dev *pci,
struct cx88_audio_dev **rchip,
struct cx88_core **core_ptr)
{ … }
static int cx88_audio_initdev(struct pci_dev *pci,
const struct pci_device_id *pci_id)
{ … }
static void cx88_audio_finidev(struct pci_dev *pci)
{ … }
static struct pci_driver cx88_audio_pci_driver = …;
module_pci_driver(…) …;