18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-or-later */ 28c2ecf20Sopenharmony_ci#ifndef __SOUND_YMFPCI_H 38c2ecf20Sopenharmony_ci#define __SOUND_YMFPCI_H 48c2ecf20Sopenharmony_ci 58c2ecf20Sopenharmony_ci/* 68c2ecf20Sopenharmony_ci * Copyright (c) by Jaroslav Kysela <perex@perex.cz> 78c2ecf20Sopenharmony_ci * Definitions for Yahama YMF724/740/744/754 chips 88c2ecf20Sopenharmony_ci */ 98c2ecf20Sopenharmony_ci 108c2ecf20Sopenharmony_ci#include <sound/pcm.h> 118c2ecf20Sopenharmony_ci#include <sound/rawmidi.h> 128c2ecf20Sopenharmony_ci#include <sound/ac97_codec.h> 138c2ecf20Sopenharmony_ci#include <sound/timer.h> 148c2ecf20Sopenharmony_ci#include <linux/gameport.h> 158c2ecf20Sopenharmony_ci 168c2ecf20Sopenharmony_ci/* 178c2ecf20Sopenharmony_ci * Direct registers 188c2ecf20Sopenharmony_ci */ 198c2ecf20Sopenharmony_ci 208c2ecf20Sopenharmony_ci#define YMFREG(chip, reg) (chip->port + YDSXGR_##reg) 218c2ecf20Sopenharmony_ci 228c2ecf20Sopenharmony_ci#define YDSXGR_INTFLAG 0x0004 238c2ecf20Sopenharmony_ci#define YDSXGR_ACTIVITY 0x0006 248c2ecf20Sopenharmony_ci#define YDSXGR_GLOBALCTRL 0x0008 258c2ecf20Sopenharmony_ci#define YDSXGR_ZVCTRL 0x000A 268c2ecf20Sopenharmony_ci#define YDSXGR_TIMERCTRL 0x0010 278c2ecf20Sopenharmony_ci#define YDSXGR_TIMERCOUNT 0x0012 288c2ecf20Sopenharmony_ci#define YDSXGR_SPDIFOUTCTRL 0x0018 298c2ecf20Sopenharmony_ci#define YDSXGR_SPDIFOUTSTATUS 0x001C 308c2ecf20Sopenharmony_ci#define YDSXGR_EEPROMCTRL 0x0020 318c2ecf20Sopenharmony_ci#define YDSXGR_SPDIFINCTRL 0x0034 328c2ecf20Sopenharmony_ci#define YDSXGR_SPDIFINSTATUS 0x0038 338c2ecf20Sopenharmony_ci#define YDSXGR_DSPPROGRAMDL 0x0048 348c2ecf20Sopenharmony_ci#define YDSXGR_DLCNTRL 0x004C 358c2ecf20Sopenharmony_ci#define YDSXGR_GPIOININTFLAG 0x0050 368c2ecf20Sopenharmony_ci#define YDSXGR_GPIOININTENABLE 0x0052 378c2ecf20Sopenharmony_ci#define YDSXGR_GPIOINSTATUS 0x0054 388c2ecf20Sopenharmony_ci#define YDSXGR_GPIOOUTCTRL 0x0056 398c2ecf20Sopenharmony_ci#define YDSXGR_GPIOFUNCENABLE 0x0058 408c2ecf20Sopenharmony_ci#define YDSXGR_GPIOTYPECONFIG 0x005A 418c2ecf20Sopenharmony_ci#define YDSXGR_AC97CMDDATA 0x0060 428c2ecf20Sopenharmony_ci#define YDSXGR_AC97CMDADR 0x0062 438c2ecf20Sopenharmony_ci#define YDSXGR_PRISTATUSDATA 0x0064 448c2ecf20Sopenharmony_ci#define YDSXGR_PRISTATUSADR 0x0066 458c2ecf20Sopenharmony_ci#define YDSXGR_SECSTATUSDATA 0x0068 468c2ecf20Sopenharmony_ci#define YDSXGR_SECSTATUSADR 0x006A 478c2ecf20Sopenharmony_ci#define YDSXGR_SECCONFIG 0x0070 488c2ecf20Sopenharmony_ci#define YDSXGR_LEGACYOUTVOL 0x0080 498c2ecf20Sopenharmony_ci#define YDSXGR_LEGACYOUTVOLL 0x0080 508c2ecf20Sopenharmony_ci#define YDSXGR_LEGACYOUTVOLR 0x0082 518c2ecf20Sopenharmony_ci#define YDSXGR_NATIVEDACOUTVOL 0x0084 528c2ecf20Sopenharmony_ci#define YDSXGR_NATIVEDACOUTVOLL 0x0084 538c2ecf20Sopenharmony_ci#define YDSXGR_NATIVEDACOUTVOLR 0x0086 548c2ecf20Sopenharmony_ci#define YDSXGR_ZVOUTVOL 0x0088 558c2ecf20Sopenharmony_ci#define YDSXGR_ZVOUTVOLL 0x0088 568c2ecf20Sopenharmony_ci#define YDSXGR_ZVOUTVOLR 0x008A 578c2ecf20Sopenharmony_ci#define YDSXGR_SECADCOUTVOL 0x008C 588c2ecf20Sopenharmony_ci#define YDSXGR_SECADCOUTVOLL 0x008C 598c2ecf20Sopenharmony_ci#define YDSXGR_SECADCOUTVOLR 0x008E 608c2ecf20Sopenharmony_ci#define YDSXGR_PRIADCOUTVOL 0x0090 618c2ecf20Sopenharmony_ci#define YDSXGR_PRIADCOUTVOLL 0x0090 628c2ecf20Sopenharmony_ci#define YDSXGR_PRIADCOUTVOLR 0x0092 638c2ecf20Sopenharmony_ci#define YDSXGR_LEGACYLOOPVOL 0x0094 648c2ecf20Sopenharmony_ci#define YDSXGR_LEGACYLOOPVOLL 0x0094 658c2ecf20Sopenharmony_ci#define YDSXGR_LEGACYLOOPVOLR 0x0096 668c2ecf20Sopenharmony_ci#define YDSXGR_NATIVEDACLOOPVOL 0x0098 678c2ecf20Sopenharmony_ci#define YDSXGR_NATIVEDACLOOPVOLL 0x0098 688c2ecf20Sopenharmony_ci#define YDSXGR_NATIVEDACLOOPVOLR 0x009A 698c2ecf20Sopenharmony_ci#define YDSXGR_ZVLOOPVOL 0x009C 708c2ecf20Sopenharmony_ci#define YDSXGR_ZVLOOPVOLL 0x009E 718c2ecf20Sopenharmony_ci#define YDSXGR_ZVLOOPVOLR 0x009E 728c2ecf20Sopenharmony_ci#define YDSXGR_SECADCLOOPVOL 0x00A0 738c2ecf20Sopenharmony_ci#define YDSXGR_SECADCLOOPVOLL 0x00A0 748c2ecf20Sopenharmony_ci#define YDSXGR_SECADCLOOPVOLR 0x00A2 758c2ecf20Sopenharmony_ci#define YDSXGR_PRIADCLOOPVOL 0x00A4 768c2ecf20Sopenharmony_ci#define YDSXGR_PRIADCLOOPVOLL 0x00A4 778c2ecf20Sopenharmony_ci#define YDSXGR_PRIADCLOOPVOLR 0x00A6 788c2ecf20Sopenharmony_ci#define YDSXGR_NATIVEADCINVOL 0x00A8 798c2ecf20Sopenharmony_ci#define YDSXGR_NATIVEADCINVOLL 0x00A8 808c2ecf20Sopenharmony_ci#define YDSXGR_NATIVEADCINVOLR 0x00AA 818c2ecf20Sopenharmony_ci#define YDSXGR_NATIVEDACINVOL 0x00AC 828c2ecf20Sopenharmony_ci#define YDSXGR_NATIVEDACINVOLL 0x00AC 838c2ecf20Sopenharmony_ci#define YDSXGR_NATIVEDACINVOLR 0x00AE 848c2ecf20Sopenharmony_ci#define YDSXGR_BUF441OUTVOL 0x00B0 858c2ecf20Sopenharmony_ci#define YDSXGR_BUF441OUTVOLL 0x00B0 868c2ecf20Sopenharmony_ci#define YDSXGR_BUF441OUTVOLR 0x00B2 878c2ecf20Sopenharmony_ci#define YDSXGR_BUF441LOOPVOL 0x00B4 888c2ecf20Sopenharmony_ci#define YDSXGR_BUF441LOOPVOLL 0x00B4 898c2ecf20Sopenharmony_ci#define YDSXGR_BUF441LOOPVOLR 0x00B6 908c2ecf20Sopenharmony_ci#define YDSXGR_SPDIFOUTVOL 0x00B8 918c2ecf20Sopenharmony_ci#define YDSXGR_SPDIFOUTVOLL 0x00B8 928c2ecf20Sopenharmony_ci#define YDSXGR_SPDIFOUTVOLR 0x00BA 938c2ecf20Sopenharmony_ci#define YDSXGR_SPDIFLOOPVOL 0x00BC 948c2ecf20Sopenharmony_ci#define YDSXGR_SPDIFLOOPVOLL 0x00BC 958c2ecf20Sopenharmony_ci#define YDSXGR_SPDIFLOOPVOLR 0x00BE 968c2ecf20Sopenharmony_ci#define YDSXGR_ADCSLOTSR 0x00C0 978c2ecf20Sopenharmony_ci#define YDSXGR_RECSLOTSR 0x00C4 988c2ecf20Sopenharmony_ci#define YDSXGR_ADCFORMAT 0x00C8 998c2ecf20Sopenharmony_ci#define YDSXGR_RECFORMAT 0x00CC 1008c2ecf20Sopenharmony_ci#define YDSXGR_P44SLOTSR 0x00D0 1018c2ecf20Sopenharmony_ci#define YDSXGR_STATUS 0x0100 1028c2ecf20Sopenharmony_ci#define YDSXGR_CTRLSELECT 0x0104 1038c2ecf20Sopenharmony_ci#define YDSXGR_MODE 0x0108 1048c2ecf20Sopenharmony_ci#define YDSXGR_SAMPLECOUNT 0x010C 1058c2ecf20Sopenharmony_ci#define YDSXGR_NUMOFSAMPLES 0x0110 1068c2ecf20Sopenharmony_ci#define YDSXGR_CONFIG 0x0114 1078c2ecf20Sopenharmony_ci#define YDSXGR_PLAYCTRLSIZE 0x0140 1088c2ecf20Sopenharmony_ci#define YDSXGR_RECCTRLSIZE 0x0144 1098c2ecf20Sopenharmony_ci#define YDSXGR_EFFCTRLSIZE 0x0148 1108c2ecf20Sopenharmony_ci#define YDSXGR_WORKSIZE 0x014C 1118c2ecf20Sopenharmony_ci#define YDSXGR_MAPOFREC 0x0150 1128c2ecf20Sopenharmony_ci#define YDSXGR_MAPOFEFFECT 0x0154 1138c2ecf20Sopenharmony_ci#define YDSXGR_PLAYCTRLBASE 0x0158 1148c2ecf20Sopenharmony_ci#define YDSXGR_RECCTRLBASE 0x015C 1158c2ecf20Sopenharmony_ci#define YDSXGR_EFFCTRLBASE 0x0160 1168c2ecf20Sopenharmony_ci#define YDSXGR_WORKBASE 0x0164 1178c2ecf20Sopenharmony_ci#define YDSXGR_DSPINSTRAM 0x1000 1188c2ecf20Sopenharmony_ci#define YDSXGR_CTRLINSTRAM 0x4000 1198c2ecf20Sopenharmony_ci 1208c2ecf20Sopenharmony_ci#define YDSXG_AC97READCMD 0x8000 1218c2ecf20Sopenharmony_ci#define YDSXG_AC97WRITECMD 0x0000 1228c2ecf20Sopenharmony_ci 1238c2ecf20Sopenharmony_ci#define PCIR_DSXG_LEGACY 0x40 1248c2ecf20Sopenharmony_ci#define PCIR_DSXG_ELEGACY 0x42 1258c2ecf20Sopenharmony_ci#define PCIR_DSXG_CTRL 0x48 1268c2ecf20Sopenharmony_ci#define PCIR_DSXG_PWRCTRL1 0x4a 1278c2ecf20Sopenharmony_ci#define PCIR_DSXG_PWRCTRL2 0x4e 1288c2ecf20Sopenharmony_ci#define PCIR_DSXG_FMBASE 0x60 1298c2ecf20Sopenharmony_ci#define PCIR_DSXG_SBBASE 0x62 1308c2ecf20Sopenharmony_ci#define PCIR_DSXG_MPU401BASE 0x64 1318c2ecf20Sopenharmony_ci#define PCIR_DSXG_JOYBASE 0x66 1328c2ecf20Sopenharmony_ci 1338c2ecf20Sopenharmony_ci#define YDSXG_DSPLENGTH 0x0080 1348c2ecf20Sopenharmony_ci#define YDSXG_CTRLLENGTH 0x3000 1358c2ecf20Sopenharmony_ci 1368c2ecf20Sopenharmony_ci#define YDSXG_DEFAULT_WORK_SIZE 0x0400 1378c2ecf20Sopenharmony_ci 1388c2ecf20Sopenharmony_ci#define YDSXG_PLAYBACK_VOICES 64 1398c2ecf20Sopenharmony_ci#define YDSXG_CAPTURE_VOICES 2 1408c2ecf20Sopenharmony_ci#define YDSXG_EFFECT_VOICES 5 1418c2ecf20Sopenharmony_ci 1428c2ecf20Sopenharmony_ci#define YMFPCI_LEGACY_SBEN (1 << 0) /* soundblaster enable */ 1438c2ecf20Sopenharmony_ci#define YMFPCI_LEGACY_FMEN (1 << 1) /* OPL3 enable */ 1448c2ecf20Sopenharmony_ci#define YMFPCI_LEGACY_JPEN (1 << 2) /* joystick enable */ 1458c2ecf20Sopenharmony_ci#define YMFPCI_LEGACY_MEN (1 << 3) /* MPU401 enable */ 1468c2ecf20Sopenharmony_ci#define YMFPCI_LEGACY_MIEN (1 << 4) /* MPU RX irq enable */ 1478c2ecf20Sopenharmony_ci#define YMFPCI_LEGACY_IOBITS (1 << 5) /* i/o bits range, 0 = 16bit, 1 =10bit */ 1488c2ecf20Sopenharmony_ci#define YMFPCI_LEGACY_SDMA (3 << 6) /* SB DMA select */ 1498c2ecf20Sopenharmony_ci#define YMFPCI_LEGACY_SBIRQ (7 << 8) /* SB IRQ select */ 1508c2ecf20Sopenharmony_ci#define YMFPCI_LEGACY_MPUIRQ (7 << 11) /* MPU IRQ select */ 1518c2ecf20Sopenharmony_ci#define YMFPCI_LEGACY_SIEN (1 << 14) /* serialized IRQ */ 1528c2ecf20Sopenharmony_ci#define YMFPCI_LEGACY_LAD (1 << 15) /* legacy audio disable */ 1538c2ecf20Sopenharmony_ci 1548c2ecf20Sopenharmony_ci#define YMFPCI_LEGACY2_FMIO (3 << 0) /* OPL3 i/o address (724/740) */ 1558c2ecf20Sopenharmony_ci#define YMFPCI_LEGACY2_SBIO (3 << 2) /* SB i/o address (724/740) */ 1568c2ecf20Sopenharmony_ci#define YMFPCI_LEGACY2_MPUIO (3 << 4) /* MPU401 i/o address (724/740) */ 1578c2ecf20Sopenharmony_ci#define YMFPCI_LEGACY2_JSIO (3 << 6) /* joystick i/o address (724/740) */ 1588c2ecf20Sopenharmony_ci#define YMFPCI_LEGACY2_MAIM (1 << 8) /* MPU401 ack intr mask */ 1598c2ecf20Sopenharmony_ci#define YMFPCI_LEGACY2_SMOD (3 << 11) /* SB DMA mode */ 1608c2ecf20Sopenharmony_ci#define YMFPCI_LEGACY2_SBVER (3 << 13) /* SB version select */ 1618c2ecf20Sopenharmony_ci#define YMFPCI_LEGACY2_IMOD (1 << 15) /* legacy IRQ mode */ 1628c2ecf20Sopenharmony_ci/* SIEN:IMOD 0:0 = legacy irq, 0:1 = INTA, 1:0 = serialized IRQ */ 1638c2ecf20Sopenharmony_ci 1648c2ecf20Sopenharmony_ci#if IS_REACHABLE(CONFIG_GAMEPORT) 1658c2ecf20Sopenharmony_ci#define SUPPORT_JOYSTICK 1668c2ecf20Sopenharmony_ci#endif 1678c2ecf20Sopenharmony_ci 1688c2ecf20Sopenharmony_ci/* 1698c2ecf20Sopenharmony_ci * 1708c2ecf20Sopenharmony_ci */ 1718c2ecf20Sopenharmony_ci 1728c2ecf20Sopenharmony_cistruct snd_ymfpci_playback_bank { 1738c2ecf20Sopenharmony_ci __le32 format; 1748c2ecf20Sopenharmony_ci __le32 loop_default; 1758c2ecf20Sopenharmony_ci __le32 base; /* 32-bit address */ 1768c2ecf20Sopenharmony_ci __le32 loop_start; /* 32-bit offset */ 1778c2ecf20Sopenharmony_ci __le32 loop_end; /* 32-bit offset */ 1788c2ecf20Sopenharmony_ci __le32 loop_frac; /* 8-bit fraction - loop_start */ 1798c2ecf20Sopenharmony_ci __le32 delta_end; /* pitch delta end */ 1808c2ecf20Sopenharmony_ci __le32 lpfK_end; 1818c2ecf20Sopenharmony_ci __le32 eg_gain_end; 1828c2ecf20Sopenharmony_ci __le32 left_gain_end; 1838c2ecf20Sopenharmony_ci __le32 right_gain_end; 1848c2ecf20Sopenharmony_ci __le32 eff1_gain_end; 1858c2ecf20Sopenharmony_ci __le32 eff2_gain_end; 1868c2ecf20Sopenharmony_ci __le32 eff3_gain_end; 1878c2ecf20Sopenharmony_ci __le32 lpfQ; 1888c2ecf20Sopenharmony_ci __le32 status; 1898c2ecf20Sopenharmony_ci __le32 num_of_frames; 1908c2ecf20Sopenharmony_ci __le32 loop_count; 1918c2ecf20Sopenharmony_ci __le32 start; 1928c2ecf20Sopenharmony_ci __le32 start_frac; 1938c2ecf20Sopenharmony_ci __le32 delta; 1948c2ecf20Sopenharmony_ci __le32 lpfK; 1958c2ecf20Sopenharmony_ci __le32 eg_gain; 1968c2ecf20Sopenharmony_ci __le32 left_gain; 1978c2ecf20Sopenharmony_ci __le32 right_gain; 1988c2ecf20Sopenharmony_ci __le32 eff1_gain; 1998c2ecf20Sopenharmony_ci __le32 eff2_gain; 2008c2ecf20Sopenharmony_ci __le32 eff3_gain; 2018c2ecf20Sopenharmony_ci __le32 lpfD1; 2028c2ecf20Sopenharmony_ci __le32 lpfD2; 2038c2ecf20Sopenharmony_ci }; 2048c2ecf20Sopenharmony_ci 2058c2ecf20Sopenharmony_cistruct snd_ymfpci_capture_bank { 2068c2ecf20Sopenharmony_ci __le32 base; /* 32-bit address */ 2078c2ecf20Sopenharmony_ci __le32 loop_end; /* 32-bit offset */ 2088c2ecf20Sopenharmony_ci __le32 start; /* 32-bit offset */ 2098c2ecf20Sopenharmony_ci __le32 num_of_loops; /* counter */ 2108c2ecf20Sopenharmony_ci}; 2118c2ecf20Sopenharmony_ci 2128c2ecf20Sopenharmony_cistruct snd_ymfpci_effect_bank { 2138c2ecf20Sopenharmony_ci __le32 base; /* 32-bit address */ 2148c2ecf20Sopenharmony_ci __le32 loop_end; /* 32-bit offset */ 2158c2ecf20Sopenharmony_ci __le32 start; /* 32-bit offset */ 2168c2ecf20Sopenharmony_ci __le32 temp; 2178c2ecf20Sopenharmony_ci}; 2188c2ecf20Sopenharmony_ci 2198c2ecf20Sopenharmony_cistruct snd_ymfpci_pcm; 2208c2ecf20Sopenharmony_cistruct snd_ymfpci; 2218c2ecf20Sopenharmony_ci 2228c2ecf20Sopenharmony_cienum snd_ymfpci_voice_type { 2238c2ecf20Sopenharmony_ci YMFPCI_PCM, 2248c2ecf20Sopenharmony_ci YMFPCI_SYNTH, 2258c2ecf20Sopenharmony_ci YMFPCI_MIDI 2268c2ecf20Sopenharmony_ci}; 2278c2ecf20Sopenharmony_ci 2288c2ecf20Sopenharmony_cistruct snd_ymfpci_voice { 2298c2ecf20Sopenharmony_ci struct snd_ymfpci *chip; 2308c2ecf20Sopenharmony_ci int number; 2318c2ecf20Sopenharmony_ci unsigned int use: 1, 2328c2ecf20Sopenharmony_ci pcm: 1, 2338c2ecf20Sopenharmony_ci synth: 1, 2348c2ecf20Sopenharmony_ci midi: 1; 2358c2ecf20Sopenharmony_ci struct snd_ymfpci_playback_bank *bank; 2368c2ecf20Sopenharmony_ci dma_addr_t bank_addr; 2378c2ecf20Sopenharmony_ci void (*interrupt)(struct snd_ymfpci *chip, struct snd_ymfpci_voice *voice); 2388c2ecf20Sopenharmony_ci struct snd_ymfpci_pcm *ypcm; 2398c2ecf20Sopenharmony_ci}; 2408c2ecf20Sopenharmony_ci 2418c2ecf20Sopenharmony_cienum snd_ymfpci_pcm_type { 2428c2ecf20Sopenharmony_ci PLAYBACK_VOICE, 2438c2ecf20Sopenharmony_ci CAPTURE_REC, 2448c2ecf20Sopenharmony_ci CAPTURE_AC97, 2458c2ecf20Sopenharmony_ci EFFECT_DRY_LEFT, 2468c2ecf20Sopenharmony_ci EFFECT_DRY_RIGHT, 2478c2ecf20Sopenharmony_ci EFFECT_EFF1, 2488c2ecf20Sopenharmony_ci EFFECT_EFF2, 2498c2ecf20Sopenharmony_ci EFFECT_EFF3 2508c2ecf20Sopenharmony_ci}; 2518c2ecf20Sopenharmony_ci 2528c2ecf20Sopenharmony_cistruct snd_ymfpci_pcm { 2538c2ecf20Sopenharmony_ci struct snd_ymfpci *chip; 2548c2ecf20Sopenharmony_ci enum snd_ymfpci_pcm_type type; 2558c2ecf20Sopenharmony_ci struct snd_pcm_substream *substream; 2568c2ecf20Sopenharmony_ci struct snd_ymfpci_voice *voices[2]; /* playback only */ 2578c2ecf20Sopenharmony_ci unsigned int running: 1, 2588c2ecf20Sopenharmony_ci use_441_slot: 1, 2598c2ecf20Sopenharmony_ci output_front: 1, 2608c2ecf20Sopenharmony_ci output_rear: 1, 2618c2ecf20Sopenharmony_ci swap_rear: 1; 2628c2ecf20Sopenharmony_ci unsigned int update_pcm_vol; 2638c2ecf20Sopenharmony_ci u32 period_size; /* cached from runtime->period_size */ 2648c2ecf20Sopenharmony_ci u32 buffer_size; /* cached from runtime->buffer_size */ 2658c2ecf20Sopenharmony_ci u32 period_pos; 2668c2ecf20Sopenharmony_ci u32 last_pos; 2678c2ecf20Sopenharmony_ci u32 capture_bank_number; 2688c2ecf20Sopenharmony_ci u32 shift; 2698c2ecf20Sopenharmony_ci}; 2708c2ecf20Sopenharmony_ci 2718c2ecf20Sopenharmony_cistruct snd_ymfpci { 2728c2ecf20Sopenharmony_ci int irq; 2738c2ecf20Sopenharmony_ci 2748c2ecf20Sopenharmony_ci unsigned int device_id; /* PCI device ID */ 2758c2ecf20Sopenharmony_ci unsigned char rev; /* PCI revision */ 2768c2ecf20Sopenharmony_ci unsigned long reg_area_phys; 2778c2ecf20Sopenharmony_ci void __iomem *reg_area_virt; 2788c2ecf20Sopenharmony_ci struct resource *res_reg_area; 2798c2ecf20Sopenharmony_ci struct resource *fm_res; 2808c2ecf20Sopenharmony_ci struct resource *mpu_res; 2818c2ecf20Sopenharmony_ci 2828c2ecf20Sopenharmony_ci unsigned short old_legacy_ctrl; 2838c2ecf20Sopenharmony_ci#ifdef SUPPORT_JOYSTICK 2848c2ecf20Sopenharmony_ci struct gameport *gameport; 2858c2ecf20Sopenharmony_ci#endif 2868c2ecf20Sopenharmony_ci 2878c2ecf20Sopenharmony_ci struct snd_dma_buffer work_ptr; 2888c2ecf20Sopenharmony_ci 2898c2ecf20Sopenharmony_ci unsigned int bank_size_playback; 2908c2ecf20Sopenharmony_ci unsigned int bank_size_capture; 2918c2ecf20Sopenharmony_ci unsigned int bank_size_effect; 2928c2ecf20Sopenharmony_ci unsigned int work_size; 2938c2ecf20Sopenharmony_ci 2948c2ecf20Sopenharmony_ci void *bank_base_playback; 2958c2ecf20Sopenharmony_ci void *bank_base_capture; 2968c2ecf20Sopenharmony_ci void *bank_base_effect; 2978c2ecf20Sopenharmony_ci void *work_base; 2988c2ecf20Sopenharmony_ci dma_addr_t bank_base_playback_addr; 2998c2ecf20Sopenharmony_ci dma_addr_t bank_base_capture_addr; 3008c2ecf20Sopenharmony_ci dma_addr_t bank_base_effect_addr; 3018c2ecf20Sopenharmony_ci dma_addr_t work_base_addr; 3028c2ecf20Sopenharmony_ci struct snd_dma_buffer ac3_tmp_base; 3038c2ecf20Sopenharmony_ci 3048c2ecf20Sopenharmony_ci __le32 *ctrl_playback; 3058c2ecf20Sopenharmony_ci struct snd_ymfpci_playback_bank *bank_playback[YDSXG_PLAYBACK_VOICES][2]; 3068c2ecf20Sopenharmony_ci struct snd_ymfpci_capture_bank *bank_capture[YDSXG_CAPTURE_VOICES][2]; 3078c2ecf20Sopenharmony_ci struct snd_ymfpci_effect_bank *bank_effect[YDSXG_EFFECT_VOICES][2]; 3088c2ecf20Sopenharmony_ci 3098c2ecf20Sopenharmony_ci int start_count; 3108c2ecf20Sopenharmony_ci 3118c2ecf20Sopenharmony_ci u32 active_bank; 3128c2ecf20Sopenharmony_ci struct snd_ymfpci_voice voices[64]; 3138c2ecf20Sopenharmony_ci int src441_used; 3148c2ecf20Sopenharmony_ci 3158c2ecf20Sopenharmony_ci struct snd_ac97_bus *ac97_bus; 3168c2ecf20Sopenharmony_ci struct snd_ac97 *ac97; 3178c2ecf20Sopenharmony_ci struct snd_rawmidi *rawmidi; 3188c2ecf20Sopenharmony_ci struct snd_timer *timer; 3198c2ecf20Sopenharmony_ci unsigned int timer_ticks; 3208c2ecf20Sopenharmony_ci 3218c2ecf20Sopenharmony_ci struct pci_dev *pci; 3228c2ecf20Sopenharmony_ci struct snd_card *card; 3238c2ecf20Sopenharmony_ci struct snd_pcm *pcm; 3248c2ecf20Sopenharmony_ci struct snd_pcm *pcm2; 3258c2ecf20Sopenharmony_ci struct snd_pcm *pcm_spdif; 3268c2ecf20Sopenharmony_ci struct snd_pcm *pcm_4ch; 3278c2ecf20Sopenharmony_ci struct snd_pcm_substream *capture_substream[YDSXG_CAPTURE_VOICES]; 3288c2ecf20Sopenharmony_ci struct snd_pcm_substream *effect_substream[YDSXG_EFFECT_VOICES]; 3298c2ecf20Sopenharmony_ci struct snd_kcontrol *ctl_vol_recsrc; 3308c2ecf20Sopenharmony_ci struct snd_kcontrol *ctl_vol_adcrec; 3318c2ecf20Sopenharmony_ci struct snd_kcontrol *ctl_vol_spdifrec; 3328c2ecf20Sopenharmony_ci unsigned short spdif_bits, spdif_pcm_bits; 3338c2ecf20Sopenharmony_ci struct snd_kcontrol *spdif_pcm_ctl; 3348c2ecf20Sopenharmony_ci int mode_dup4ch; 3358c2ecf20Sopenharmony_ci int rear_opened; 3368c2ecf20Sopenharmony_ci int spdif_opened; 3378c2ecf20Sopenharmony_ci struct snd_ymfpci_pcm_mixer { 3388c2ecf20Sopenharmony_ci u16 left; 3398c2ecf20Sopenharmony_ci u16 right; 3408c2ecf20Sopenharmony_ci struct snd_kcontrol *ctl; 3418c2ecf20Sopenharmony_ci } pcm_mixer[32]; 3428c2ecf20Sopenharmony_ci 3438c2ecf20Sopenharmony_ci spinlock_t reg_lock; 3448c2ecf20Sopenharmony_ci spinlock_t voice_lock; 3458c2ecf20Sopenharmony_ci wait_queue_head_t interrupt_sleep; 3468c2ecf20Sopenharmony_ci atomic_t interrupt_sleep_count; 3478c2ecf20Sopenharmony_ci struct snd_info_entry *proc_entry; 3488c2ecf20Sopenharmony_ci const struct firmware *dsp_microcode; 3498c2ecf20Sopenharmony_ci const struct firmware *controller_microcode; 3508c2ecf20Sopenharmony_ci 3518c2ecf20Sopenharmony_ci#ifdef CONFIG_PM_SLEEP 3528c2ecf20Sopenharmony_ci u32 *saved_regs; 3538c2ecf20Sopenharmony_ci u32 saved_ydsxgr_mode; 3548c2ecf20Sopenharmony_ci u16 saved_dsxg_legacy; 3558c2ecf20Sopenharmony_ci u16 saved_dsxg_elegacy; 3568c2ecf20Sopenharmony_ci#endif 3578c2ecf20Sopenharmony_ci}; 3588c2ecf20Sopenharmony_ci 3598c2ecf20Sopenharmony_ciint snd_ymfpci_create(struct snd_card *card, 3608c2ecf20Sopenharmony_ci struct pci_dev *pci, 3618c2ecf20Sopenharmony_ci unsigned short old_legacy_ctrl, 3628c2ecf20Sopenharmony_ci struct snd_ymfpci ** rcodec); 3638c2ecf20Sopenharmony_civoid snd_ymfpci_free_gameport(struct snd_ymfpci *chip); 3648c2ecf20Sopenharmony_ci 3658c2ecf20Sopenharmony_ciextern const struct dev_pm_ops snd_ymfpci_pm; 3668c2ecf20Sopenharmony_ci 3678c2ecf20Sopenharmony_ciint snd_ymfpci_pcm(struct snd_ymfpci *chip, int device); 3688c2ecf20Sopenharmony_ciint snd_ymfpci_pcm2(struct snd_ymfpci *chip, int device); 3698c2ecf20Sopenharmony_ciint snd_ymfpci_pcm_spdif(struct snd_ymfpci *chip, int device); 3708c2ecf20Sopenharmony_ciint snd_ymfpci_pcm_4ch(struct snd_ymfpci *chip, int device); 3718c2ecf20Sopenharmony_ciint snd_ymfpci_mixer(struct snd_ymfpci *chip, int rear_switch); 3728c2ecf20Sopenharmony_ciint snd_ymfpci_timer(struct snd_ymfpci *chip, int device); 3738c2ecf20Sopenharmony_ci 3748c2ecf20Sopenharmony_ci#endif /* __SOUND_YMFPCI_H */ 375