#include <linux/init.h>
#include <linux/pci.h>
#include <linux/dma-mapping.h>
#include <linux/slab.h>
#include <linux/interrupt.h>
#include <linux/delay.h>
#include <linux/io.h>
#include <linux/module.h>
#include <sound/core.h>
#include <sound/initval.h>
#include <sound/pcm.h>
#include <sound/pcm_params.h>
#include <sound/control.h>
#include "saa7146.h"
#include "aw2-saa7146.h"
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;
#define CTL_ROUTE_ANALOG …
#define CTL_ROUTE_DIGITAL …
static const struct snd_pcm_hardware snd_aw2_playback_hw = …;
static const struct snd_pcm_hardware snd_aw2_capture_hw = …;
struct aw2_pcm_device { … };
struct aw2 { … };
static int snd_aw2_create(struct snd_card *card, struct pci_dev *pci);
static int snd_aw2_probe(struct pci_dev *pci,
const struct pci_device_id *pci_id);
static int snd_aw2_pcm_playback_open(struct snd_pcm_substream *substream);
static int snd_aw2_pcm_playback_close(struct snd_pcm_substream *substream);
static int snd_aw2_pcm_capture_open(struct snd_pcm_substream *substream);
static int snd_aw2_pcm_capture_close(struct snd_pcm_substream *substream);
static int snd_aw2_pcm_prepare_playback(struct snd_pcm_substream *substream);
static int snd_aw2_pcm_prepare_capture(struct snd_pcm_substream *substream);
static int snd_aw2_pcm_trigger_playback(struct snd_pcm_substream *substream,
int cmd);
static int snd_aw2_pcm_trigger_capture(struct snd_pcm_substream *substream,
int cmd);
static snd_pcm_uframes_t snd_aw2_pcm_pointer_playback(struct snd_pcm_substream
*substream);
static snd_pcm_uframes_t snd_aw2_pcm_pointer_capture(struct snd_pcm_substream
*substream);
static int snd_aw2_new_pcm(struct aw2 *chip);
static int snd_aw2_control_switch_capture_info(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo);
static int snd_aw2_control_switch_capture_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value
*ucontrol);
static int snd_aw2_control_switch_capture_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value
*ucontrol);
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(…) …;
static const struct pci_device_id snd_aw2_ids[] = …;
MODULE_DEVICE_TABLE(pci, snd_aw2_ids);
static struct pci_driver aw2_driver = …;
module_pci_driver(…) …;
static const struct snd_pcm_ops snd_aw2_playback_ops = …;
static const struct snd_pcm_ops snd_aw2_capture_ops = …;
static const struct snd_kcontrol_new aw2_control = …;
static void snd_aw2_free(struct snd_card *card)
{ … }
static int snd_aw2_create(struct snd_card *card,
struct pci_dev *pci)
{ … }
static int snd_aw2_probe(struct pci_dev *pci,
const struct pci_device_id *pci_id)
{ … }
static int snd_aw2_pcm_playback_open(struct snd_pcm_substream *substream)
{ … }
static int snd_aw2_pcm_playback_close(struct snd_pcm_substream *substream)
{ … }
static int snd_aw2_pcm_capture_open(struct snd_pcm_substream *substream)
{ … }
static int snd_aw2_pcm_capture_close(struct snd_pcm_substream *substream)
{ … }
static int snd_aw2_pcm_prepare_playback(struct snd_pcm_substream *substream)
{ … }
static int snd_aw2_pcm_prepare_capture(struct snd_pcm_substream *substream)
{ … }
static int snd_aw2_pcm_trigger_playback(struct snd_pcm_substream *substream,
int cmd)
{ … }
static int snd_aw2_pcm_trigger_capture(struct snd_pcm_substream *substream,
int cmd)
{ … }
static snd_pcm_uframes_t snd_aw2_pcm_pointer_playback(struct snd_pcm_substream
*substream)
{ … }
static snd_pcm_uframes_t snd_aw2_pcm_pointer_capture(struct snd_pcm_substream
*substream)
{ … }
static int snd_aw2_new_pcm(struct aw2 *chip)
{ … }
static int snd_aw2_control_switch_capture_info(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo)
{ … }
static int snd_aw2_control_switch_capture_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value
*ucontrol)
{ … }
static int snd_aw2_control_switch_capture_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value
*ucontrol)
{ … }