linux/include/uapi/sound/emu10k1.h

/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
/*
 *  Copyright (c) by Jaroslav Kysela <[email protected]>,
 *		     Creative Labs, Inc.
 *  Definitions for EMU10K1 (SB Live!) chips
 */
#ifndef _UAPI__SOUND_EMU10K1_H
#define _UAPI__SOUND_EMU10K1_H

#ifdef __linux__
#include <linux/types.h>
#endif

/*
 * ---- FX8010 ----
 */

#define EMU10K1_FX8010_PCM_COUNT

/*
 * Following definition is copied from linux/types.h to support compiling
 * this header file in userspace since they are not generally available for
 * uapi headers.
 */
#define __EMU10K1_DECLARE_BITMAP(name,bits)

/* instruction set */
#define iMAC0
#define iMAC1
#define iMAC2
#define iMAC3
#define iMACINT0
#define iMACINT1
#define iACC3
#define iMACMV
#define iANDXOR
#define iTSTNEG
#define iLIMITGE
#define iLIMITLT
#define iLOG
#define iEXP
#define iINTERP
#define iSKIP

#define LOWORD_OPX_MASK
#define LOWORD_OPY_MASK
#define HIWORD_OPCODE_MASK
#define HIWORD_RESULT_MASK
#define HIWORD_OPA_MASK

/* Audigy Soundcards have a different instruction format */
#define A_LOWORD_OPX_MASK
#define A_LOWORD_OPY_MASK
#define A_HIWORD_OPCODE_MASK
#define A_HIWORD_RESULT_MASK
#define A_HIWORD_OPA_MASK

/* GPRs */
#define FXBUS(x)
#define EXTIN(x)
#define EXTOUT(x)
#define FXBUS2(x)
					/* NB: 0x31 and 0x32 are shared with Center/LFE on SB live 5.1 */

#define A_FXBUS(x)
#define A_EXTIN(x)
#define A_P16VIN(x)
#define A_EXTOUT(x)
#define A_FXBUS2(x)
#define A_EMU32OUTH(x)
#define A_EMU32OUTL(x)
#define A3_EMU32IN(x)
#define A3_EMU32OUT(x)

#define C_00000000
#define C_00000001
#define C_00000002
#define C_00000003
#define C_00000004
#define C_00000008
#define C_00000010
#define C_00000020
#define C_00000100
#define C_00010000
#define C_00080000
#define C_10000000
#define C_20000000
#define C_40000000
#define C_80000000
#define C_7fffffff
#define C_ffffffff
#define C_fffffffe
#define C_c0000000
#define C_4f1bbcdc
#define C_5a7ef9db
#define C_00100000
#define GPR_ACCU
#define GPR_COND
#define GPR_NOISE0
#define GPR_NOISE1
#define GPR_IRQ
#define GPR_DBAC

/* Audigy constants */
#define A_C_00000000
#define A_C_00000001
#define A_C_00000002
#define A_C_00000003
#define A_C_00000004
#define A_C_00000008
#define A_C_00000010
#define A_C_00000020
#define A_C_00000100
#define A_C_00010000
#define A_C_00000800
#define A_C_10000000
#define A_C_20000000
#define A_C_40000000
#define A_C_80000000
#define A_C_7fffffff
#define A_C_ffffffff
#define A_C_fffffffe
#define A_C_c0000000
#define A_C_4f1bbcdc
#define A_C_5a7ef9db
#define A_C_00100000
#define A_GPR_ACCU
#define A_GPR_COND
#define A_GPR_NOISE0
#define A_GPR_NOISE1
#define A_GPR_IRQ
#define A_GPR_DBAC
#define A_GPR_DBACE

/* Each FX general purpose register is 32 bits in length, all bits are used			*/
#define FXGPREGBASE
#define A_FXGPREGBASE

#define A_TANKMEMCTLREGBASE
#define A_TANKMEMCTLREG_MASK

/* Tank audio data is logarithmically compressed down to 16 bits before writing to TRAM and is	*/
/* decompressed back to 20 bits on a read.  There are a total of 160 locations, the last 32	*/
/* locations are for external TRAM. 								*/
#define TANKMEMDATAREGBASE
#define TANKMEMDATAREG_MASK

/* Combined address field and memory opcode or flag field.  160 locations, last 32 are external	*/
#define TANKMEMADDRREGBASE
#define TANKMEMADDRREG_ADDR_MASK
#define TANKMEMADDRREG_CLEAR
#define TANKMEMADDRREG_ALIGN
#define TANKMEMADDRREG_WRITE
#define TANKMEMADDRREG_READ

#define GPR(x)
#define ITRAM_DATA(x)
#define ETRAM_DATA(x)
#define ITRAM_ADDR(x)
#define ETRAM_ADDR(x)

#define A_GPR(x)
#define A_ITRAM_DATA(x)
#define A_ETRAM_DATA(x)
#define A_ITRAM_ADDR(x)
#define A_ETRAM_ADDR(x)
#define A_ITRAM_CTL(x)
#define A_ETRAM_CTL(x)

/* cc_reg constants */
#define CC_REG_NORMALIZED
#define CC_REG_BORROW
#define CC_REG_MINUS
#define CC_REG_ZERO
#define CC_REG_SATURATE
#define CC_REG_NONZERO

#define A_CC_REG_NORMALIZED
#define A_CC_REG_BORROW
#define A_CC_REG_MINUS
#define A_CC_REG_ZERO
#define A_CC_REG_SATURATE
#define A_CC_REG_NONZERO

/* FX buses */
// These are arbitrary mappings; our DSP code simply expects
// the config files to route the channels this way.
// The numbers are documented in {audigy,sb-live}-mixer.rst.
#define FXBUS_PCM_LEFT
#define FXBUS_PCM_RIGHT
#define FXBUS_PCM_LEFT_REAR
#define FXBUS_PCM_RIGHT_REAR
#define FXBUS_MIDI_LEFT
#define FXBUS_MIDI_RIGHT
#define FXBUS_PCM_CENTER
#define FXBUS_PCM_LFE
#define FXBUS_PCM_LEFT_FRONT
#define FXBUS_PCM_RIGHT_FRONT
#define FXBUS_MIDI_REVERB
#define FXBUS_MIDI_CHORUS
#define FXBUS_PCM_LEFT_SIDE
#define FXBUS_PCM_RIGHT_SIDE
#define FXBUS_PT_LEFT
#define FXBUS_PT_RIGHT

/* Inputs */
#define EXTIN_AC97_L
#define EXTIN_AC97_R
#define EXTIN_SPDIF_CD_L
#define EXTIN_SPDIF_CD_R
#define EXTIN_ZOOM_L
#define EXTIN_ZOOM_R
#define EXTIN_TOSLINK_L
#define EXTIN_TOSLINK_R
#define EXTIN_LINE1_L
#define EXTIN_LINE1_R
#define EXTIN_COAX_SPDIF_L
#define EXTIN_COAX_SPDIF_R
#define EXTIN_LINE2_L
#define EXTIN_LINE2_R

/* Outputs */
#define EXTOUT_AC97_L
#define EXTOUT_AC97_R
#define EXTOUT_TOSLINK_L
#define EXTOUT_TOSLINK_R
#define EXTOUT_AC97_CENTER
#define EXTOUT_AC97_LFE
#define EXTOUT_HEADPHONE_L
#define EXTOUT_HEADPHONE_R
#define EXTOUT_REAR_L
#define EXTOUT_REAR_R
#define EXTOUT_ADC_CAP_L
#define EXTOUT_ADC_CAP_R
#define EXTOUT_MIC_CAP
#define EXTOUT_AC97_REAR_L
#define EXTOUT_AC97_REAR_R
#define EXTOUT_ACENTER
#define EXTOUT_ALFE

/* Audigy Inputs */
#define A_EXTIN_AC97_L
#define A_EXTIN_AC97_R
#define A_EXTIN_SPDIF_CD_L
#define A_EXTIN_SPDIF_CD_R
#define A_EXTIN_OPT_SPDIF_L
#define A_EXTIN_OPT_SPDIF_R 
#define A_EXTIN_LINE2_L
#define A_EXTIN_LINE2_R
#define A_EXTIN_ADC_L
#define A_EXTIN_ADC_R
#define A_EXTIN_AUX2_L
#define A_EXTIN_AUX2_R

/* Audigiy Outputs */
#define A_EXTOUT_FRONT_L
#define A_EXTOUT_FRONT_R
#define A_EXTOUT_CENTER
#define A_EXTOUT_LFE
#define A_EXTOUT_HEADPHONE_L
#define A_EXTOUT_HEADPHONE_R
#define A_EXTOUT_REAR_L
#define A_EXTOUT_REAR_R
#define A_EXTOUT_AFRONT_L
#define A_EXTOUT_AFRONT_R
#define A_EXTOUT_ACENTER
#define A_EXTOUT_ALFE
#define A_EXTOUT_ASIDE_L
#define A_EXTOUT_ASIDE_R
#define A_EXTOUT_AREAR_L
#define A_EXTOUT_AREAR_R
#define A_EXTOUT_AC97_L
#define A_EXTOUT_AC97_R
#define A_EXTOUT_ADC_CAP_L
#define A_EXTOUT_ADC_CAP_R
#define A_EXTOUT_MIC_CAP

/* Definitions for debug register. Note that these are for emu10k1 ONLY. */
#define EMU10K1_DBG_ZC
#define EMU10K1_DBG_SATURATION_OCCURED
#define EMU10K1_DBG_SATURATION_ADDR
#define EMU10K1_DBG_SINGLE_STEP
#define EMU10K1_DBG_STEP
#define EMU10K1_DBG_CONDITION_CODE
#define EMU10K1_DBG_SINGLE_STEP_ADDR

/* Definitions for emu10k2 debug register. */
#define A_DBG_ZC
#define A_DBG_SATURATION_OCCURED
#define A_DBG_SATURATION_ADDR
#define A_DBG_SINGLE_STEP
#define A_DBG_STEP
#define A_DBG_CONDITION_CODE
#define A_DBG_STEP_ADDR

struct snd_emu10k1_fx8010_info {};

#define EMU10K1_GPR_TRANSLATION_NONE
#define EMU10K1_GPR_TRANSLATION_TABLE100
#define EMU10K1_GPR_TRANSLATION_BASS
#define EMU10K1_GPR_TRANSLATION_TREBLE
#define EMU10K1_GPR_TRANSLATION_ONOFF
#define EMU10K1_GPR_TRANSLATION_NEGATE
#define EMU10K1_GPR_TRANSLATION_NEG_TABLE100

enum emu10k1_ctl_elem_iface {};

struct emu10k1_ctl_elem_id {};

struct snd_emu10k1_fx8010_control_gpr {};

/* old ABI without TLV support */
struct snd_emu10k1_fx8010_control_old_gpr {};

struct snd_emu10k1_fx8010_code {};

struct snd_emu10k1_fx8010_tram {};

struct snd_emu10k1_fx8010_pcm_rec {};

#define SNDRV_EMU10K1_VERSION

#define SNDRV_EMU10K1_IOCTL_INFO
#define SNDRV_EMU10K1_IOCTL_CODE_POKE
#define SNDRV_EMU10K1_IOCTL_CODE_PEEK
#define SNDRV_EMU10K1_IOCTL_TRAM_SETUP
#define SNDRV_EMU10K1_IOCTL_TRAM_POKE
#define SNDRV_EMU10K1_IOCTL_TRAM_PEEK
#define SNDRV_EMU10K1_IOCTL_PCM_POKE
#define SNDRV_EMU10K1_IOCTL_PCM_PEEK
#define SNDRV_EMU10K1_IOCTL_PVERSION
#define SNDRV_EMU10K1_IOCTL_STOP
#define SNDRV_EMU10K1_IOCTL_CONTINUE
#define SNDRV_EMU10K1_IOCTL_ZERO_TRAM_COUNTER
#define SNDRV_EMU10K1_IOCTL_SINGLE_STEP
#define SNDRV_EMU10K1_IOCTL_DBG_READ

#endif /* _UAPI__SOUND_EMU10K1_H */