#include <linux/init.h>
#include <linux/isa.h>
#include <linux/module.h>
#include <linux/gameport.h>
#include <asm/dma.h>
#include <sound/core.h>
#include <sound/wss.h>
#include <sound/opl3.h>
#include <sound/mpu401.h>
#define SNDRV_LEGACY_FIND_FREE_IOPORT
#define SNDRV_LEGACY_FIND_FREE_IRQ
#define SNDRV_LEGACY_FIND_FREE_DMA
#include <sound/initval.h>
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;
#if IS_ENABLED(CONFIG_GAMEPORT)
#define SUPPORT_JOYSTICK …
#endif
static const int cmi8328_ports[] = …;
#define CMI8328_MAX …
static int index[CMI8328_MAX] = …;
static char *id[CMI8328_MAX] = …;
static long port[CMI8328_MAX] = …;
static int irq[CMI8328_MAX] = …;
static int dma1[CMI8328_MAX] = …;
static int dma2[CMI8328_MAX] = …;
static long mpuport[CMI8328_MAX] = …;
static int mpuirq[CMI8328_MAX] = …;
#ifdef SUPPORT_JOYSTICK
static bool gameport[CMI8328_MAX] = …;
#endif
module_param_array(…);
MODULE_PARM_DESC(…) …;
module_param_array(…);
MODULE_PARM_DESC(…) …;
module_param_hw_array(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_hw_array(mpuport, long, ioport, NULL, 0444);
MODULE_PARM_DESC(…) …;
module_param_hw_array(mpuirq, int, irq, NULL, 0444);
MODULE_PARM_DESC(…) …;
#ifdef SUPPORT_JOYSTICK
module_param_array(…);
MODULE_PARM_DESC(…) …;
#endif
struct snd_cmi8328 { … };
#define CFG1 …
#define CFG1_SB_DISABLE …
#define CFG1_GAMEPORT …
#define CFG2 …
#define CFG2_MPU_ENABLE …
#define CFG3 …
static u8 snd_cmi8328_cfg_read(u16 port, u8 reg)
{ … }
static void snd_cmi8328_cfg_write(u16 port, u8 reg, u8 val)
{ … }
#ifdef CONFIG_PM
static void snd_cmi8328_cfg_save(u16 port, u8 cfg[])
{ … }
static void snd_cmi8328_cfg_restore(u16 port, u8 cfg[])
{ … }
#endif
static int snd_cmi8328_mixer(struct snd_wss *chip)
{ … }
static int array_find(const int array[], int item)
{ … }
static int array_find_l(const long array[], long item)
{ … }
static int snd_cmi8328_probe(struct device *pdev, unsigned int ndev)
{ … }
static void snd_cmi8328_remove(struct device *pdev, unsigned int dev)
{ … }
#ifdef CONFIG_PM
static int snd_cmi8328_suspend(struct device *pdev, unsigned int n,
pm_message_t state)
{ … }
static int snd_cmi8328_resume(struct device *pdev, unsigned int n)
{ … }
#endif
static struct isa_driver snd_cmi8328_driver = …;
module_isa_driver(snd_cmi8328_driver, CMI8328_MAX);