#include <linux/delay.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/pci.h>
#include <linux/dma-mapping.h>
#include <linux/interrupt.h>
#include <linux/slab.h>
#include <linux/io.h>
#include <sound/core.h>
#include <sound/control.h>
#include <sound/initval.h>
#include <sound/pcm.h>
#include <sound/pcm_params.h>
#include <sound/ac97_codec.h>
#include <sound/opl3.h>
#define IRQ_DISABLE …
#define IRQ_ENABLE …
#define AC97_ACCESS …
#define AC97_READ …
#define AC97_STATUS …
#define AC97_DATA_AVAIL …
#define AC97_BUSY …
#define ALS300_IRQ_STATUS …
#define IRQ_PLAYBACK …
#define IRQ_CAPTURE …
#define GCR_DATA …
#define GCR_INDEX …
#define ALS300P_DRAM_IRQ_STATUS …
#define MPU_IRQ_STATUS …
#define ALS300P_IRQ_STATUS …
#define PLAYBACK_START …
#define PLAYBACK_END …
#define PLAYBACK_CONTROL …
#define TRANSFER_START …
#define FIFO_PAUSE …
#define RECORD_START …
#define RECORD_END …
#define RECORD_CONTROL …
#define DRAM_WRITE_CONTROL …
#define WRITE_TRANS_START …
#define DRAM_MODE_2 …
#define MISC_CONTROL …
#define IRQ_SET_BIT …
#define VMUTE_NORMAL …
#define MMUTE_NORMAL …
#define MUS_VOC_VOL …
#define PLAYBACK_BLOCK_COUNTER …
#define RECORD_BLOCK_COUNTER …
#define DEBUG_PLAY_REC …
#if DEBUG_PLAY_REC
#define snd_als300_dbgplay …
#else
#define snd_als300_dbgplay(format, args...) …
#endif
enum { … };
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_als300 { … };
struct snd_als300_substream_data { … };
static const struct pci_device_id snd_als300_ids[] = …;
MODULE_DEVICE_TABLE(pci, snd_als300_ids);
static inline u32 snd_als300_gcr_read(unsigned long port, unsigned short reg)
{ … }
static inline void snd_als300_gcr_write(unsigned long port,
unsigned short reg, u32 val)
{ … }
static void snd_als300_set_irq_flag(struct snd_als300 *chip, int cmd)
{ … }
static void snd_als300_free(struct snd_card *card)
{ … }
static irqreturn_t snd_als300_interrupt(int irq, void *dev_id)
{ … }
static irqreturn_t snd_als300plus_interrupt(int irq, void *dev_id)
{ … }
static unsigned short snd_als300_ac97_read(struct snd_ac97 *ac97,
unsigned short reg)
{ … }
static void snd_als300_ac97_write(struct snd_ac97 *ac97,
unsigned short reg, unsigned short val)
{ … }
static int snd_als300_ac97(struct snd_als300 *chip)
{ … }
static const struct snd_pcm_hardware snd_als300_playback_hw = …;
static const struct snd_pcm_hardware snd_als300_capture_hw = …;
static int snd_als300_playback_open(struct snd_pcm_substream *substream)
{ … }
static int snd_als300_playback_close(struct snd_pcm_substream *substream)
{ … }
static int snd_als300_capture_open(struct snd_pcm_substream *substream)
{ … }
static int snd_als300_capture_close(struct snd_pcm_substream *substream)
{ … }
static int snd_als300_playback_prepare(struct snd_pcm_substream *substream)
{ … }
static int snd_als300_capture_prepare(struct snd_pcm_substream *substream)
{ … }
static int snd_als300_trigger(struct snd_pcm_substream *substream, int cmd)
{ … }
static snd_pcm_uframes_t snd_als300_pointer(struct snd_pcm_substream *substream)
{ … }
static const struct snd_pcm_ops snd_als300_playback_ops = …;
static const struct snd_pcm_ops snd_als300_capture_ops = …;
static int snd_als300_new_pcm(struct snd_als300 *chip)
{ … }
static void snd_als300_init(struct snd_als300 *chip)
{ … }
static int snd_als300_create(struct snd_card *card,
struct pci_dev *pci, int chip_type)
{ … }
static int snd_als300_suspend(struct device *dev)
{ … }
static int snd_als300_resume(struct device *dev)
{ … }
static DEFINE_SIMPLE_DEV_PM_OPS(snd_als300_pm, snd_als300_suspend, snd_als300_resume);
static int snd_als300_probe(struct pci_dev *pci,
const struct pci_device_id *pci_id)
{ … }
static struct pci_driver als300_driver = …;
module_pci_driver(…) …;