linux/sound/pci/trident/trident.h

/* SPDX-License-Identifier: GPL-2.0-or-later */
#ifndef __SOUND_TRIDENT_H
#define __SOUND_TRIDENT_H

/*
 *  [email protected]
 *  Fri Feb 19 15:55:28 MST 1999
 *  Definitions for Trident 4DWave DX/NX chips
 */

#include <sound/pcm.h>
#include <sound/mpu401.h>
#include <sound/ac97_codec.h>
#include <sound/util_mem.h>

#define TRIDENT_DEVICE_ID_DX
#define TRIDENT_DEVICE_ID_NX
#define TRIDENT_DEVICE_ID_SI7018

#define SNDRV_TRIDENT_VOICE_TYPE_PCM
#define SNDRV_TRIDENT_VOICE_TYPE_SYNTH
#define SNDRV_TRIDENT_VOICE_TYPE_MIDI

#define SNDRV_TRIDENT_VFLG_RUNNING

/* TLB code constants */
#define SNDRV_TRIDENT_PAGE_SIZE
#define SNDRV_TRIDENT_PAGE_SHIFT
#define SNDRV_TRIDENT_PAGE_MASK
#define SNDRV_TRIDENT_MAX_PAGES

/*
 * Direct registers
 */

#define TRID_REG(trident, x)

#define ID_4DWAVE_DX
#define ID_4DWAVE_NX

/* Bank definitions */

#define T4D_BANK_A
#define T4D_BANK_B
#define T4D_NUM_BANKS

/* Register definitions */

/* Global registers */

enum global_control_bits {};

enum miscint_bits {};

/* T2 legacy dma control registers. */
#define LEGACY_DMAR0
#define LEGACY_DMAR4
#define LEGACY_DMAR6
#define LEGACY_DMAR11
#define LEGACY_DMAR15

#define T4D_START_A
#define T4D_STOP_A
#define T4D_DLY_A
#define T4D_SIGN_CSO_A
#define T4D_CSPF_A
#define T4D_CSPF_B
#define T4D_CEBC_A
#define T4D_AINT_A
#define T4D_AINTEN_A
#define T4D_LFO_GC_CIR
#define T4D_MUSICVOL_WAVEVOL
#define T4D_SBDELTA_DELTA_R
#define T4D_MISCINT
#define T4D_START_B
#define T4D_STOP_B
#define T4D_SBBL_SBCL
#define T4D_SBCTRL_SBE2R_SBDD
#define T4D_STIMER
#define T4D_AINT_B
#define T4D_AINTEN_B
#define T4D_RCI

/* MPU-401 UART */
#define T4D_MPU401_BASE
#define T4D_MPUR0
#define T4D_MPUR1
#define T4D_MPUR2
#define T4D_MPUR3

/* S/PDIF Registers */
#define NX_SPCTRL_SPCSO
#define NX_SPLBA
#define NX_SPESO
#define NX_SPCSTATUS

/* Joystick */
#define GAMEPORT_GCR
#define GAMEPORT_MODE_ADC
#define GAMEPORT_LEGACY
#define GAMEPORT_AXES

/* NX Specific Registers */
#define NX_TLBC

/* Channel Registers */

#define CH_START

#define CH_DX_CSO_ALPHA_FMS
#define CH_DX_ESO_DELTA
#define CH_DX_FMC_RVOL_CVOL

#define CH_NX_DELTA_CSO
#define CH_NX_DELTA_ESO
#define CH_NX_ALPHA_FMS_FMC_RVOL_CVOL

#define CH_LBA
#define CH_GVSEL_PAN_VOL_CTRL_EC
#define CH_EBUF1
#define CH_EBUF2

/* AC-97 Registers */

#define DX_ACR0_AC97_W
#define DX_ACR1_AC97_R
#define DX_ACR2_AC97_COM_STAT

#define NX_ACR0_AC97_COM_STAT
#define NX_ACR1_AC97_W
#define NX_ACR2_AC97_R_PRIMARY
#define NX_ACR3_AC97_R_SECONDARY

#define SI_AC97_WRITE
#define SI_AC97_READ
#define SI_SERIAL_INTF_CTRL
#define SI_AC97_GPIO
#define SI_ASR0
#define SI_SPDIF_CS
#define SI_GPIO

enum trident_nx_ac97_bits {};

enum trident_dx_ac97_bits {};

enum sis7018_ac97_bits {};

enum serial_intf_ctrl_bits {};
                                                                                                                                   
/* PCM defaults */

#define T4D_DEFAULT_PCM_VOL
#define T4D_DEFAULT_PCM_PAN
#define T4D_DEFAULT_PCM_RVOL
#define T4D_DEFAULT_PCM_CVOL

struct snd_trident;
struct snd_trident_voice;
struct snd_trident_pcm_mixer;

struct snd_trident_port {};

struct snd_trident_memblk_arg {};

struct snd_trident_tlb {};

struct snd_trident_voice {};

struct snd_4dwave {};

struct snd_trident_pcm_mixer {};

struct snd_trident {};

int snd_trident_create(struct snd_card *card,
		       struct pci_dev *pci,
		       int pcm_streams,
		       int pcm_spdif_device,
		       int max_wavetable_size);
int snd_trident_create_gameport(struct snd_trident *trident);

int snd_trident_pcm(struct snd_trident *trident, int device);
int snd_trident_foldback_pcm(struct snd_trident *trident, int device);
int snd_trident_spdif_pcm(struct snd_trident *trident, int device);
struct snd_trident_voice *snd_trident_alloc_voice(struct snd_trident * trident, int type,
					     int client, int port);
void snd_trident_free_voice(struct snd_trident * trident, struct snd_trident_voice *voice);
void snd_trident_start_voice(struct snd_trident * trident, unsigned int voice);
void snd_trident_stop_voice(struct snd_trident * trident, unsigned int voice);
void snd_trident_write_voice_regs(struct snd_trident * trident, struct snd_trident_voice *voice);
extern const struct dev_pm_ops snd_trident_pm;

/* TLB memory allocation */
struct snd_util_memblk *snd_trident_alloc_pages(struct snd_trident *trident,
						struct snd_pcm_substream *substream);
int snd_trident_free_pages(struct snd_trident *trident, struct snd_util_memblk *blk);

#endif /* __SOUND_TRIDENT_H */