linux/sound/isa/opl3sa2.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 *  Driver for Yamaha OPL3-SA[2,3] soundcards
 *  Copyright (c) by Jaroslav Kysela <[email protected]>
 */

#include <linux/init.h>
#include <linux/err.h>
#include <linux/isa.h>
#include <linux/interrupt.h>
#include <linux/pm.h>
#include <linux/pnp.h>
#include <linux/module.h>
#include <linux/io.h>
#include <sound/core.h>
#include <sound/wss.h>
#include <sound/mpu401.h>
#include <sound/opl3.h>
#include <sound/initval.h>
#include <sound/tlv.h>

MODULE_AUTHOR();
MODULE_DESCRIPTION();
MODULE_LICENSE();

static int index[SNDRV_CARDS] =;	/* Index 0-MAX */
static char *id[SNDRV_CARDS] =;	/* ID for this card */
static bool enable[SNDRV_CARDS] =; /* Enable this card */
#ifdef CONFIG_PNP
static bool isapnp[SNDRV_CARDS] =;
#endif
static long port[SNDRV_CARDS] =;	/* 0xf86,0x370,0x100 */
static long sb_port[SNDRV_CARDS] =;	/* 0x220,0x240,0x260 */
static long wss_port[SNDRV_CARDS] =;/* 0x530,0xe80,0xf40,0x604 */
static long fm_port[SNDRV_CARDS] =;	/* 0x388 */
static long midi_port[SNDRV_CARDS] =;/* 0x330,0x300 */
static int irq[SNDRV_CARDS] =;	/* 0,1,3,5,9,11,12,15 */
static int dma1[SNDRV_CARDS] =;	/* 1,3,5,6,7 */
static int dma2[SNDRV_CARDS] =;	/* 1,3,5,6,7 */
static int opl3sa3_ymode[SNDRV_CARDS];   /* 0,1,2,3 */ /*SL Added*/

module_param_array();
MODULE_PARM_DESC();
module_param_array();
MODULE_PARM_DESC();
module_param_array();
MODULE_PARM_DESC();
#ifdef CONFIG_PNP
module_param_array();
MODULE_PARM_DESC();
#endif
module_param_hw_array(port, long, ioport, NULL, 0444);
MODULE_PARM_DESC();
module_param_hw_array(sb_port, long, ioport, NULL, 0444);
MODULE_PARM_DESC();
module_param_hw_array(wss_port, long, ioport, NULL, 0444);
MODULE_PARM_DESC();
module_param_hw_array(fm_port, long, ioport, NULL, 0444);
MODULE_PARM_DESC();
module_param_hw_array(midi_port, long, ioport, NULL, 0444);
MODULE_PARM_DESC();
module_param_hw_array(irq, int, irq, NULL, 0444);
MODULE_PARM_DESC();
module_param_hw_array(dma1, int, dma, NULL, 0444);
MODULE_PARM_DESC();
module_param_hw_array(dma2, int, dma, NULL, 0444);
MODULE_PARM_DESC();
module_param_array();
MODULE_PARM_DESC();

#ifdef CONFIG_PNP
static int isa_registered;
static int pnp_registered;
static int pnpc_registered;
#endif

/* control ports */
#define OPL3SA2_PM_CTRL
#define OPL3SA2_SYS_CTRL
#define OPL3SA2_IRQ_CONFIG
#define OPL3SA2_IRQ_STATUS
#define OPL3SA2_DMA_CONFIG
#define OPL3SA2_MASTER_LEFT
#define OPL3SA2_MASTER_RIGHT
#define OPL3SA2_MIC
#define OPL3SA2_MISC

/* opl3sa3 only */
#define OPL3SA3_DGTL_DOWN
#define OPL3SA3_ANLG_DOWN
#define OPL3SA3_WIDE
#define OPL3SA3_BASS
#define OPL3SA3_TREBLE

/* power management bits */
#define OPL3SA2_PM_ADOWN
#define OPL3SA2_PM_PSV		
#define OPL3SA2_PM_PDN
#define OPL3SA2_PM_PDX

#define OPL3SA2_PM_D0
#define OPL3SA2_PM_D3

struct snd_opl3sa2 {};

#define PFX

#ifdef CONFIG_PNP

static const struct pnp_device_id snd_opl3sa2_pnpbiosids[] =;

MODULE_DEVICE_TABLE(pnp, snd_opl3sa2_pnpbiosids);

static const struct pnp_card_device_id snd_opl3sa2_pnpids[] =;

MODULE_DEVICE_TABLE(pnp_card, snd_opl3sa2_pnpids);

#endif /* CONFIG_PNP */


/* read control port (w/o spinlock) */
static unsigned char __snd_opl3sa2_read(struct snd_opl3sa2 *chip, unsigned char reg)
{}

/* read control port (with spinlock) */
static unsigned char snd_opl3sa2_read(struct snd_opl3sa2 *chip, unsigned char reg)
{}

/* write control port (w/o spinlock) */
static void __snd_opl3sa2_write(struct snd_opl3sa2 *chip, unsigned char reg, unsigned char value)
{}

/* write control port (with spinlock) */
static void snd_opl3sa2_write(struct snd_opl3sa2 *chip, unsigned char reg, unsigned char value)
{}

static int snd_opl3sa2_detect(struct snd_card *card)
{}

static irqreturn_t snd_opl3sa2_interrupt(int irq, void *dev_id)
{}

#define OPL3SA2_SINGLE(xname, xindex, reg, shift, mask, invert)
#define OPL3SA2_SINGLE_TLV(xname, xindex, reg, shift, mask, invert, xtlv)

static int snd_opl3sa2_get_single(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{}

static int snd_opl3sa2_put_single(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{}

#define OPL3SA2_DOUBLE(xname, xindex, left_reg, right_reg, shift_left, shift_right, mask, invert)
#define OPL3SA2_DOUBLE_TLV(xname, xindex, left_reg, right_reg, shift_left, shift_right, mask, invert, xtlv)

static int snd_opl3sa2_get_double(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{}

static int snd_opl3sa2_put_double(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{}

static const DECLARE_TLV_DB_SCALE(db_scale_master, -3000, 200, 0);
static const DECLARE_TLV_DB_SCALE(db_scale_5bit_12db_max, -3450, 150, 0);

static const struct snd_kcontrol_new snd_opl3sa2_controls[] =;

static const struct snd_kcontrol_new snd_opl3sa2_tone_controls[] =;

static void snd_opl3sa2_master_free(struct snd_kcontrol *kcontrol)
{}

static int snd_opl3sa2_mixer(struct snd_card *card)
{}

/* Power Management support functions */
#ifdef CONFIG_PM
static int snd_opl3sa2_suspend(struct snd_card *card, pm_message_t state)
{}

static int snd_opl3sa2_resume(struct snd_card *card)
{}
#endif /* CONFIG_PM */

#ifdef CONFIG_PNP
static int snd_opl3sa2_pnp(int dev, struct snd_opl3sa2 *chip,
			   struct pnp_dev *pdev)
{}
#endif /* CONFIG_PNP */

static int snd_opl3sa2_card_new(struct device *pdev, int dev,
				struct snd_card **cardp)
{}

static int snd_opl3sa2_probe(struct snd_card *card, int dev)
{}

#ifdef CONFIG_PNP
static int snd_opl3sa2_pnp_detect(struct pnp_dev *pdev,
				  const struct pnp_device_id *id)
{}

#ifdef CONFIG_PM
static int snd_opl3sa2_pnp_suspend(struct pnp_dev *pdev, pm_message_t state)
{}
static int snd_opl3sa2_pnp_resume(struct pnp_dev *pdev)
{}
#endif

static struct pnp_driver opl3sa2_pnp_driver =;

static int snd_opl3sa2_pnp_cdetect(struct pnp_card_link *pcard,
				   const struct pnp_card_device_id *id)
{}

#ifdef CONFIG_PM
static int snd_opl3sa2_pnp_csuspend(struct pnp_card_link *pcard, pm_message_t state)
{}
static int snd_opl3sa2_pnp_cresume(struct pnp_card_link *pcard)
{}
#endif

static struct pnp_card_driver opl3sa2_pnpc_driver =;
#endif /* CONFIG_PNP */

static int snd_opl3sa2_isa_match(struct device *pdev,
				 unsigned int dev)
{}

static int snd_opl3sa2_isa_probe(struct device *pdev,
				 unsigned int dev)
{}

#ifdef CONFIG_PM
static int snd_opl3sa2_isa_suspend(struct device *dev, unsigned int n,
				   pm_message_t state)
{}

static int snd_opl3sa2_isa_resume(struct device *dev, unsigned int n)
{}
#endif

#define DEV_NAME

static struct isa_driver snd_opl3sa2_isa_driver =;

static int __init alsa_card_opl3sa2_init(void)
{}

static void __exit alsa_card_opl3sa2_exit(void)
{}

module_init()
module_exit()