#define pr_fmt(fmt) …
#include <linux/module.h>
#include <linux/init.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 <linux/delay.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 "cx25821.h"
#include "cx25821-reg.h"
#define AUDIO_SRAM_CHANNEL …
#define dprintk(level, fmt, arg...) …
#define dprintk_core(level, fmt, arg...) …
static int devno;
struct cx25821_audio_buffer { … };
struct cx25821_audio_dev { … };
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_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;
static unsigned int debug;
module_param(debug, int, 0644);
MODULE_PARM_DESC(…) …;
#define AUD_INT_DN_RISCI1 …
#define AUD_INT_UP_RISCI1 …
#define AUD_INT_RDS_DN_RISCI1 …
#define AUD_INT_DN_RISCI2 …
#define AUD_INT_UP_RISCI2 …
#define AUD_INT_RDS_DN_RISCI2 …
#define AUD_INT_DN_SYNC …
#define AUD_INT_UP_SYNC …
#define AUD_INT_RDS_DN_SYNC …
#define AUD_INT_OPC_ERR …
#define AUD_INT_BER_IRQ …
#define AUD_INT_MCHG_IRQ …
#define GP_COUNT_CONTROL_RESET …
#define PCI_MSK_AUD_EXT …
#define PCI_MSK_AUD_INT …
static int cx25821_alsa_dma_init(struct cx25821_audio_dev *chip,
unsigned long nr_pages)
{ … }
static int cx25821_alsa_dma_map(struct cx25821_audio_dev *dev)
{ … }
static int cx25821_alsa_dma_unmap(struct cx25821_audio_dev *dev)
{ … }
static int cx25821_alsa_dma_free(struct cx25821_audio_buffer *buf)
{ … }
static int _cx25821_start_audio_dma(struct cx25821_audio_dev *chip)
{ … }
static int _cx25821_stop_audio_dma(struct cx25821_audio_dev *chip)
{ … }
#define MAX_IRQ_LOOP …
static char *cx25821_aud_irqs[32] = …;
static void cx25821_aud_irq(struct cx25821_audio_dev *chip, u32 status,
u32 mask)
{ … }
static irqreturn_t cx25821_irq(int irq, void *dev_id)
{ … }
static int dsp_buffer_free(struct cx25821_audio_dev *chip)
{ … }
#define DEFAULT_FIFO_SIZE …
static const struct snd_pcm_hardware snd_cx25821_digital_hw = …;
static int snd_cx25821_pcm_open(struct snd_pcm_substream *substream)
{ … }
static int snd_cx25821_close(struct snd_pcm_substream *substream)
{ … }
static int snd_cx25821_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *hw_params)
{ … }
static int snd_cx25821_hw_free(struct snd_pcm_substream *substream)
{ … }
static int snd_cx25821_prepare(struct snd_pcm_substream *substream)
{ … }
static int snd_cx25821_card_trigger(struct snd_pcm_substream *substream,
int cmd)
{ … }
static snd_pcm_uframes_t snd_cx25821_pointer(struct snd_pcm_substream
*substream)
{ … }
static struct page *snd_cx25821_page(struct snd_pcm_substream *substream,
unsigned long offset)
{ … }
static const struct snd_pcm_ops snd_cx25821_pcm_ops = …;
static int snd_cx25821_pcm(struct cx25821_audio_dev *chip, int device,
char *name)
{ … }
static const struct pci_device_id __maybe_unused cx25821_audio_pci_tbl[] = …;
MODULE_DEVICE_TABLE(pci, cx25821_audio_pci_tbl);
static int cx25821_audio_initdev(struct cx25821_dev *dev)
{ … }
static int cx25821_alsa_exit_callback(struct device *dev, void *data)
{ … }
static void cx25821_audio_fini(void)
{ … }
static int cx25821_alsa_init_callback(struct device *dev, void *data)
{ … }
static int cx25821_alsa_init(void)
{ … }
late_initcall(cx25821_alsa_init);
module_exit(cx25821_audio_fini);