linux/sound/pci/als300.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 *  als300.c - driver for Avance Logic ALS300/ALS300+ soundcards.
 *  Copyright (C) 2005 by Ash Willis <[email protected]>
 *
 *  TODO
 *  4 channel playback for ALS300+
 *  gameport
 *  mpu401
 *  opl3
 *
 *  NOTES
 *  The BLOCK_COUNTER registers for the ALS300(+) return a figure related to
 *  the position in the current period, NOT the whole buffer. It is important
 *  to know which period we are in so we can calculate the correct pointer.
 *  This is why we always use 2 periods. We can then use a flip-flop variable
 *  to keep track of what period we are in.
 */

#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>

/* snd_als300_set_irq_flag */
#define IRQ_DISABLE
#define IRQ_ENABLE

/* I/O port layout */
#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

/* General Control Registers */
#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)
{}

/* Enable/Disable Interrupts */
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)
{}

/* hardware definition
 *
 * In AC97 mode, we always use 48k/16bit/stereo.
 * Any request to change data type is ignored by
 * the card when it is running outside of legacy
 * mode.
 */
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();