#include <linux/delay.h>
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/pci.h>
#include <linux/slab.h>
#include <linux/module.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/tlv.h>
#include <sound/ac97_codec.h>
#include <sound/mpu401.h>
#include <sound/opl3.h>
#include <sound/initval.h>
#ifdef CONFIG_SND_FM801_TEA575X_BOOL
#include <media/drv-intf/tea575x.h>
#endif
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;
static int index[SNDRV_CARDS] = …;
static char *id[SNDRV_CARDS] = …;
static bool enable[SNDRV_CARDS] = …;
static int tea575x_tuner[SNDRV_CARDS];
static int radio_nr[SNDRV_CARDS] = …;
module_param_array(…);
MODULE_PARM_DESC(…) …;
module_param_array(…);
MODULE_PARM_DESC(…) …;
module_param_array(…);
MODULE_PARM_DESC(…) …;
module_param_array(…);
MODULE_PARM_DESC(…) …;
module_param_array(…);
MODULE_PARM_DESC(…) …;
#define TUNER_DISABLED …
#define TUNER_ONLY …
#define TUNER_TYPE_MASK …
#define fm801_writew(chip,reg,value) …
#define fm801_readw(chip,reg) …
#define fm801_writel(chip,reg,value) …
#define FM801_PCM_VOL …
#define FM801_FM_VOL …
#define FM801_I2S_VOL …
#define FM801_REC_SRC …
#define FM801_PLY_CTRL …
#define FM801_PLY_COUNT …
#define FM801_PLY_BUF1 …
#define FM801_PLY_BUF2 …
#define FM801_CAP_CTRL …
#define FM801_CAP_COUNT …
#define FM801_CAP_BUF1 …
#define FM801_CAP_BUF2 …
#define FM801_CODEC_CTRL …
#define FM801_I2S_MODE …
#define FM801_VOLUME …
#define FM801_I2C_CTRL …
#define FM801_AC97_CMD …
#define FM801_AC97_DATA …
#define FM801_MPU401_DATA …
#define FM801_MPU401_CMD …
#define FM801_GPIO_CTRL …
#define FM801_GEN_CTRL …
#define FM801_IRQ_MASK …
#define FM801_IRQ_STATUS …
#define FM801_OPL3_BANK0 …
#define FM801_OPL3_DATA0 …
#define FM801_OPL3_BANK1 …
#define FM801_OPL3_DATA1 …
#define FM801_POWERDOWN …
#define FM801_AC97_READ …
#define FM801_AC97_VALID …
#define FM801_AC97_BUSY …
#define FM801_AC97_ADDR_SHIFT …
#define FM801_BUF1_LAST …
#define FM801_BUF2_LAST …
#define FM801_START …
#define FM801_PAUSE …
#define FM801_IMMED_STOP …
#define FM801_RATE_SHIFT …
#define FM801_RATE_MASK …
#define FM801_CHANNELS_4 …
#define FM801_CHANNELS_6 …
#define FM801_CHANNELS_6MS …
#define FM801_CHANNELS_MASK …
#define FM801_16BIT …
#define FM801_STEREO …
#define FM801_IRQ_PLAYBACK …
#define FM801_IRQ_CAPTURE …
#define FM801_IRQ_VOLUME …
#define FM801_IRQ_MPU …
#define FM801_GPIO_GP0 …
#define FM801_GPIO_GP1 …
#define FM801_GPIO_GP2 …
#define FM801_GPIO_GP3 …
#define FM801_GPIO_GP(x) …
#define FM801_GPIO_GD0 …
#define FM801_GPIO_GD1 …
#define FM801_GPIO_GD2 …
#define FM801_GPIO_GD3 …
#define FM801_GPIO_GD(x) …
#define FM801_GPIO_GS0 …
#define FM801_GPIO_GS1 …
#define FM801_GPIO_GS2 …
#define FM801_GPIO_GS3 …
#define FM801_GPIO_GS(x) …
struct fm801 { … };
static inline void fm801_iowrite16(struct fm801 *chip, unsigned short offset, u16 value)
{ … }
static inline u16 fm801_ioread16(struct fm801 *chip, unsigned short offset)
{ … }
static const struct pci_device_id snd_fm801_ids[] = …;
MODULE_DEVICE_TABLE(pci, snd_fm801_ids);
static bool fm801_ac97_is_ready(struct fm801 *chip, unsigned int iterations)
{ … }
static bool fm801_ac97_is_valid(struct fm801 *chip, unsigned int iterations)
{ … }
static int snd_fm801_update_bits(struct fm801 *chip, unsigned short reg,
unsigned short mask, unsigned short value)
{ … }
static void snd_fm801_codec_write(struct snd_ac97 *ac97,
unsigned short reg,
unsigned short val)
{ … }
static unsigned short snd_fm801_codec_read(struct snd_ac97 *ac97, unsigned short reg)
{ … }
static const unsigned int rates[] = …;
static const struct snd_pcm_hw_constraint_list hw_constraints_rates = …;
static const unsigned int channels[] = …;
static const struct snd_pcm_hw_constraint_list hw_constraints_channels = …;
static unsigned short snd_fm801_rate_bits(unsigned int rate)
{ … }
static int snd_fm801_playback_trigger(struct snd_pcm_substream *substream,
int cmd)
{ … }
static int snd_fm801_capture_trigger(struct snd_pcm_substream *substream,
int cmd)
{ … }
static int snd_fm801_playback_prepare(struct snd_pcm_substream *substream)
{ … }
static int snd_fm801_capture_prepare(struct snd_pcm_substream *substream)
{ … }
static snd_pcm_uframes_t snd_fm801_playback_pointer(struct snd_pcm_substream *substream)
{ … }
static snd_pcm_uframes_t snd_fm801_capture_pointer(struct snd_pcm_substream *substream)
{ … }
static irqreturn_t snd_fm801_interrupt(int irq, void *dev_id)
{ … }
static const struct snd_pcm_hardware snd_fm801_playback = …;
static const struct snd_pcm_hardware snd_fm801_capture = …;
static int snd_fm801_playback_open(struct snd_pcm_substream *substream)
{ … }
static int snd_fm801_capture_open(struct snd_pcm_substream *substream)
{ … }
static int snd_fm801_playback_close(struct snd_pcm_substream *substream)
{ … }
static int snd_fm801_capture_close(struct snd_pcm_substream *substream)
{ … }
static const struct snd_pcm_ops snd_fm801_playback_ops = …;
static const struct snd_pcm_ops snd_fm801_capture_ops = …;
static int snd_fm801_pcm(struct fm801 *chip, int device)
{ … }
#ifdef CONFIG_SND_FM801_TEA575X_BOOL
struct snd_fm801_tea575x_gpio { … };
static const struct snd_fm801_tea575x_gpio snd_fm801_tea575x_gpios[] = …;
#define get_tea575x_gpio(chip) …
static void snd_fm801_tea575x_set_pins(struct snd_tea575x *tea, u8 pins)
{ … }
static u8 snd_fm801_tea575x_get_pins(struct snd_tea575x *tea)
{ … }
static void snd_fm801_tea575x_set_direction(struct snd_tea575x *tea, bool output)
{ … }
static const struct snd_tea575x_ops snd_fm801_tea_ops = …;
#endif
#define FM801_SINGLE(xname, reg, shift, mask, invert) …
static int snd_fm801_info_single(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo)
{ … }
static int snd_fm801_get_single(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int snd_fm801_put_single(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
#define FM801_DOUBLE(xname, reg, shift_left, shift_right, mask, invert) …
#define FM801_DOUBLE_TLV(xname, reg, shift_left, shift_right, mask, invert, xtlv) …
static int snd_fm801_info_double(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo)
{ … }
static int snd_fm801_get_double(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int snd_fm801_put_double(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int snd_fm801_info_mux(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo)
{ … }
static int snd_fm801_get_mux(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static int snd_fm801_put_mux(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{ … }
static const DECLARE_TLV_DB_SCALE(db_scale_dsp, -3450, 150, 0);
#define FM801_CONTROLS …
static const struct snd_kcontrol_new snd_fm801_controls[] = …;
#define FM801_CONTROLS_MULTI …
static const struct snd_kcontrol_new snd_fm801_controls_multi[] = …;
static int snd_fm801_mixer(struct fm801 *chip)
{ … }
static int wait_for_codec(struct fm801 *chip, unsigned int codec_id,
unsigned short reg, unsigned long waits)
{ … }
static int reset_codec(struct fm801 *chip)
{ … }
static void snd_fm801_chip_multichannel_init(struct fm801 *chip)
{ … }
static void snd_fm801_chip_init(struct fm801 *chip)
{ … }
static void snd_fm801_free(struct snd_card *card)
{ … }
static int snd_fm801_create(struct snd_card *card,
struct pci_dev *pci,
int tea575x_tuner,
int radio_nr)
{ … }
static int __snd_card_fm801_probe(struct pci_dev *pci,
const struct pci_device_id *pci_id)
{ … }
static int snd_card_fm801_probe(struct pci_dev *pci,
const struct pci_device_id *pci_id)
{ … }
static const unsigned char saved_regs[] = …;
static int snd_fm801_suspend(struct device *dev)
{ … }
static int snd_fm801_resume(struct device *dev)
{ … }
static DEFINE_SIMPLE_DEV_PM_OPS(snd_fm801_pm, snd_fm801_suspend, snd_fm801_resume);
static struct pci_driver fm801_driver = …;
module_pci_driver(…) …;