Blame include/sound/uapi/emu10k1.h

Packit Service db8eaa
/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
Packit Service db8eaa
/*
Packit Service db8eaa
 *  Copyright (c) by Jaroslav Kysela <perex@perex.cz>,
Packit Service db8eaa
 *		     Creative Labs, Inc.
Packit Service db8eaa
 *  Definitions for EMU10K1 (SB Live!) chips
Packit Service db8eaa
 *
Packit Service db8eaa
 *
Packit Service db8eaa
 *   This program is free software; you can redistribute it and/or modify
Packit Service db8eaa
 *   it under the terms of the GNU General Public License as published by
Packit Service db8eaa
 *   the Free Software Foundation; either version 2 of the License, or
Packit Service db8eaa
 *   (at your option) any later version.
Packit Service db8eaa
 *
Packit Service db8eaa
 *   This program is distributed in the hope that it will be useful,
Packit Service db8eaa
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit Service db8eaa
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Packit Service db8eaa
 *   GNU General Public License for more details.
Packit Service db8eaa
 *
Packit Service db8eaa
 *   You should have received a copy of the GNU General Public License
Packit Service db8eaa
 *   along with this program; if not, write to the Free Software
Packit Service db8eaa
 *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
Packit Service db8eaa
 *
Packit Service db8eaa
 */
Packit Service db8eaa
#ifndef __SOUND_EMU10K1_H
Packit Service db8eaa
#define __SOUND_EMU10K1_H
Packit Service db8eaa
Packit Service db8eaa
#ifdef __linux__
Packit Service db8eaa
#include <linux/types.h>
Packit Service db8eaa
#endif
Packit Service db8eaa
Packit Service db8eaa
/*
Packit Service db8eaa
 * ---- FX8010 ----
Packit Service db8eaa
 */
Packit Service db8eaa
Packit Service db8eaa
#define EMU10K1_CARD_CREATIVE			0x00000000
Packit Service db8eaa
#define EMU10K1_CARD_EMUAPS			0x00000001
Packit Service db8eaa
Packit Service db8eaa
#define EMU10K1_FX8010_PCM_COUNT		8
Packit Service db8eaa
Packit Service db8eaa
/*
Packit Service db8eaa
 * Following definition is copied from linux/types.h to support compiling
Packit Service db8eaa
 * this header file in userspace since they are not generally available for
Packit Service db8eaa
 * uapi headers.
Packit Service db8eaa
 */
Packit Service db8eaa
#define __EMU10K1_DECLARE_BITMAP(name,bits) \
Packit Service db8eaa
	unsigned long name[(bits) / (sizeof(unsigned long) * 8)]
Packit Service db8eaa
Packit Service db8eaa
/* instruction set */
Packit Service db8eaa
#define iMAC0	 0x00	/* R = A + (X * Y >> 31)   ; saturation */
Packit Service db8eaa
#define iMAC1	 0x01	/* R = A + (-X * Y >> 31)  ; saturation */
Packit Service db8eaa
#define iMAC2	 0x02	/* R = A + (X * Y >> 31)   ; wraparound */
Packit Service db8eaa
#define iMAC3	 0x03	/* R = A + (-X * Y >> 31)  ; wraparound */
Packit Service db8eaa
#define iMACINT0 0x04	/* R = A + X * Y	   ; saturation */
Packit Service db8eaa
#define iMACINT1 0x05	/* R = A + X * Y	   ; wraparound (31-bit) */
Packit Service db8eaa
#define iACC3	 0x06	/* R = A + X + Y	   ; saturation */
Packit Service db8eaa
#define iMACMV   0x07	/* R = A, acc += X * Y >> 31 */
Packit Service db8eaa
#define iANDXOR  0x08	/* R = (A & X) ^ Y */
Packit Service db8eaa
#define iTSTNEG  0x09	/* R = (A >= Y) ? X : ~X */
Packit Service db8eaa
#define iLIMITGE 0x0a	/* R = (A >= Y) ? X : Y */
Packit Service db8eaa
#define iLIMITLT 0x0b	/* R = (A < Y) ? X : Y */
Packit Service db8eaa
#define iLOG	 0x0c	/* R = linear_data, A (log_data), X (max_exp), Y (format_word) */
Packit Service db8eaa
#define iEXP	 0x0d	/* R = log_data, A (linear_data), X (max_exp), Y (format_word) */
Packit Service db8eaa
#define iINTERP  0x0e	/* R = A + (X * (Y - A) >> 31)  ; saturation */
Packit Service db8eaa
#define iSKIP    0x0f	/* R = A (cc_reg), X (count), Y (cc_test) */
Packit Service db8eaa
Packit Service db8eaa
/* GPRs */
Packit Service db8eaa
#define FXBUS(x)	(0x00 + (x))	/* x = 0x00 - 0x0f */
Packit Service db8eaa
#define EXTIN(x)	(0x10 + (x))	/* x = 0x00 - 0x0f */
Packit Service db8eaa
#define EXTOUT(x)	(0x20 + (x))	/* x = 0x00 - 0x0f physical outs -> FXWC low 16 bits */
Packit Service db8eaa
#define FXBUS2(x)	(0x30 + (x))	/* x = 0x00 - 0x0f copies of fx buses for capture -> FXWC high 16 bits */
Packit Service db8eaa
					/* NB: 0x31 and 0x32 are shared with Center/LFE on SB live 5.1 */
Packit Service db8eaa
Packit Service db8eaa
#define C_00000000	0x40
Packit Service db8eaa
#define C_00000001	0x41
Packit Service db8eaa
#define C_00000002	0x42
Packit Service db8eaa
#define C_00000003	0x43
Packit Service db8eaa
#define C_00000004	0x44
Packit Service db8eaa
#define C_00000008	0x45
Packit Service db8eaa
#define C_00000010	0x46
Packit Service db8eaa
#define C_00000020	0x47
Packit Service db8eaa
#define C_00000100	0x48
Packit Service db8eaa
#define C_00010000	0x49
Packit Service db8eaa
#define C_00080000	0x4a
Packit Service db8eaa
#define C_10000000	0x4b
Packit Service db8eaa
#define C_20000000	0x4c
Packit Service db8eaa
#define C_40000000	0x4d
Packit Service db8eaa
#define C_80000000	0x4e
Packit Service db8eaa
#define C_7fffffff	0x4f
Packit Service db8eaa
#define C_ffffffff	0x50
Packit Service db8eaa
#define C_fffffffe	0x51
Packit Service db8eaa
#define C_c0000000	0x52
Packit Service db8eaa
#define C_4f1bbcdc	0x53
Packit Service db8eaa
#define C_5a7ef9db	0x54
Packit Service db8eaa
#define C_00100000	0x55		/* ?? */
Packit Service db8eaa
#define GPR_ACCU	0x56		/* ACCUM, accumulator */
Packit Service db8eaa
#define GPR_COND	0x57		/* CCR, condition register */
Packit Service db8eaa
#define GPR_NOISE0	0x58		/* noise source */
Packit Service db8eaa
#define GPR_NOISE1	0x59		/* noise source */
Packit Service db8eaa
#define GPR_IRQ		0x5a		/* IRQ register */
Packit Service db8eaa
#define GPR_DBAC	0x5b		/* TRAM Delay Base Address Counter */
Packit Service db8eaa
#define GPR(x)		(FXGPREGBASE + (x)) /* free GPRs: x = 0x00 - 0xff */
Packit Service db8eaa
#define ITRAM_DATA(x)	(TANKMEMDATAREGBASE + 0x00 + (x)) /* x = 0x00 - 0x7f */
Packit Service db8eaa
#define ETRAM_DATA(x)	(TANKMEMDATAREGBASE + 0x80 + (x)) /* x = 0x00 - 0x1f */
Packit Service db8eaa
#define ITRAM_ADDR(x)	(TANKMEMADDRREGBASE + 0x00 + (x)) /* x = 0x00 - 0x7f */
Packit Service db8eaa
#define ETRAM_ADDR(x)	(TANKMEMADDRREGBASE + 0x80 + (x)) /* x = 0x00 - 0x1f */
Packit Service db8eaa
Packit Service db8eaa
#define A_ITRAM_DATA(x)	(TANKMEMDATAREGBASE + 0x00 + (x)) /* x = 0x00 - 0xbf */
Packit Service db8eaa
#define A_ETRAM_DATA(x)	(TANKMEMDATAREGBASE + 0xc0 + (x)) /* x = 0x00 - 0x3f */
Packit Service db8eaa
#define A_ITRAM_ADDR(x)	(TANKMEMADDRREGBASE + 0x00 + (x)) /* x = 0x00 - 0xbf */
Packit Service db8eaa
#define A_ETRAM_ADDR(x)	(TANKMEMADDRREGBASE + 0xc0 + (x)) /* x = 0x00 - 0x3f */
Packit Service db8eaa
#define A_ITRAM_CTL(x)	(A_TANKMEMCTLREGBASE + 0x00 + (x)) /* x = 0x00 - 0xbf */
Packit Service db8eaa
#define A_ETRAM_CTL(x)	(A_TANKMEMCTLREGBASE + 0xc0 + (x)) /* x = 0x00 - 0x3f */
Packit Service db8eaa
Packit Service db8eaa
#define A_FXBUS(x)	(0x00 + (x))	/* x = 0x00 - 0x3f FX buses */
Packit Service db8eaa
#define A_EXTIN(x)	(0x40 + (x))	/* x = 0x00 - 0x0f physical ins */
Packit Service db8eaa
#define A_P16VIN(x)	(0x50 + (x))	/* x = 0x00 - 0x0f p16v ins (A2 only) "EMU32 inputs" */
Packit Service db8eaa
#define A_EXTOUT(x)	(0x60 + (x))	/* x = 0x00 - 0x1f physical outs -> A_FXWC1 0x79-7f unknown   */
Packit Service db8eaa
#define A_FXBUS2(x)	(0x80 + (x))	/* x = 0x00 - 0x1f extra outs used for EFX capture -> A_FXWC2 */
Packit Service db8eaa
#define A_EMU32OUTH(x)	(0xa0 + (x))	/* x = 0x00 - 0x0f "EMU32_OUT_10 - _1F" - ??? */
Packit Service db8eaa
#define A_EMU32OUTL(x)	(0xb0 + (x))	/* x = 0x00 - 0x0f "EMU32_OUT_1 - _F" - ??? */
Packit Service db8eaa
#define A3_EMU32IN(x)	(0x160 + (x))	/* x = 0x00 - 0x3f "EMU32_IN_00 - _3F" - Only when .device = 0x0008 */
Packit Service db8eaa
#define A3_EMU32OUT(x)	(0x1E0 + (x))	/* x = 0x00 - 0x0f "EMU32_OUT_00 - _3F" - Only when .device = 0x0008 */
Packit Service db8eaa
#define A_GPR(x)	(A_FXGPREGBASE + (x))
Packit Service db8eaa
Packit Service db8eaa
/* cc_reg constants */
Packit Service db8eaa
#define CC_REG_NORMALIZED C_00000001
Packit Service db8eaa
#define CC_REG_BORROW	C_00000002
Packit Service db8eaa
#define CC_REG_MINUS	C_00000004
Packit Service db8eaa
#define CC_REG_ZERO	C_00000008
Packit Service db8eaa
#define CC_REG_SATURATE	C_00000010
Packit Service db8eaa
#define CC_REG_NONZERO	C_00000100
Packit Service db8eaa
Packit Service db8eaa
/* FX buses */
Packit Service db8eaa
#define FXBUS_PCM_LEFT		0x00
Packit Service db8eaa
#define FXBUS_PCM_RIGHT		0x01
Packit Service db8eaa
#define FXBUS_PCM_LEFT_REAR	0x02
Packit Service db8eaa
#define FXBUS_PCM_RIGHT_REAR	0x03
Packit Service db8eaa
#define FXBUS_MIDI_LEFT		0x04
Packit Service db8eaa
#define FXBUS_MIDI_RIGHT	0x05
Packit Service db8eaa
#define FXBUS_PCM_CENTER	0x06
Packit Service db8eaa
#define FXBUS_PCM_LFE		0x07
Packit Service db8eaa
#define FXBUS_PCM_LEFT_FRONT	0x08
Packit Service db8eaa
#define FXBUS_PCM_RIGHT_FRONT	0x09
Packit Service db8eaa
#define FXBUS_MIDI_REVERB	0x0c
Packit Service db8eaa
#define FXBUS_MIDI_CHORUS	0x0d
Packit Service db8eaa
#define FXBUS_PCM_LEFT_SIDE	0x0e
Packit Service db8eaa
#define FXBUS_PCM_RIGHT_SIDE	0x0f
Packit Service db8eaa
#define FXBUS_PT_LEFT		0x14
Packit Service db8eaa
#define FXBUS_PT_RIGHT		0x15
Packit Service db8eaa
Packit Service db8eaa
/* Inputs */
Packit Service db8eaa
#define EXTIN_AC97_L	   0x00	/* AC'97 capture channel - left */
Packit Service db8eaa
#define EXTIN_AC97_R	   0x01	/* AC'97 capture channel - right */
Packit Service db8eaa
#define EXTIN_SPDIF_CD_L   0x02	/* internal S/PDIF CD - onboard - left */
Packit Service db8eaa
#define EXTIN_SPDIF_CD_R   0x03	/* internal S/PDIF CD - onboard - right */
Packit Service db8eaa
#define EXTIN_ZOOM_L	   0x04	/* Zoom Video I2S - left */
Packit Service db8eaa
#define EXTIN_ZOOM_R	   0x05	/* Zoom Video I2S - right */
Packit Service db8eaa
#define EXTIN_TOSLINK_L	   0x06	/* LiveDrive - TOSLink Optical - left */
Packit Service db8eaa
#define EXTIN_TOSLINK_R    0x07	/* LiveDrive - TOSLink Optical - right */
Packit Service db8eaa
#define EXTIN_LINE1_L	   0x08	/* LiveDrive - Line/Mic 1 - left */
Packit Service db8eaa
#define EXTIN_LINE1_R	   0x09	/* LiveDrive - Line/Mic 1 - right */
Packit Service db8eaa
#define EXTIN_COAX_SPDIF_L 0x0a	/* LiveDrive - Coaxial S/PDIF - left */
Packit Service db8eaa
#define EXTIN_COAX_SPDIF_R 0x0b /* LiveDrive - Coaxial S/PDIF - right */
Packit Service db8eaa
#define EXTIN_LINE2_L	   0x0c	/* LiveDrive - Line/Mic 2 - left */
Packit Service db8eaa
#define EXTIN_LINE2_R	   0x0d	/* LiveDrive - Line/Mic 2 - right */
Packit Service db8eaa
Packit Service db8eaa
/* Outputs */
Packit Service db8eaa
#define EXTOUT_AC97_L	   0x00	/* AC'97 playback channel - left */
Packit Service db8eaa
#define EXTOUT_AC97_R	   0x01	/* AC'97 playback channel - right */
Packit Service db8eaa
#define EXTOUT_TOSLINK_L   0x02	/* LiveDrive - TOSLink Optical - left */
Packit Service db8eaa
#define EXTOUT_TOSLINK_R   0x03	/* LiveDrive - TOSLink Optical - right */
Packit Service db8eaa
#define EXTOUT_AC97_CENTER 0x04	/* SB Live 5.1 - center */
Packit Service db8eaa
#define EXTOUT_AC97_LFE	   0x05 /* SB Live 5.1 - LFE */
Packit Service db8eaa
#define EXTOUT_HEADPHONE_L 0x06	/* LiveDrive - Headphone - left */
Packit Service db8eaa
#define EXTOUT_HEADPHONE_R 0x07	/* LiveDrive - Headphone - right */
Packit Service db8eaa
#define EXTOUT_REAR_L	   0x08	/* Rear channel - left */
Packit Service db8eaa
#define EXTOUT_REAR_R	   0x09	/* Rear channel - right */
Packit Service db8eaa
#define EXTOUT_ADC_CAP_L   0x0a	/* ADC Capture buffer - left */
Packit Service db8eaa
#define EXTOUT_ADC_CAP_R   0x0b	/* ADC Capture buffer - right */
Packit Service db8eaa
#define EXTOUT_MIC_CAP	   0x0c	/* MIC Capture buffer */
Packit Service db8eaa
#define EXTOUT_AC97_REAR_L 0x0d	/* SB Live 5.1 (c) 2003 - Rear Left */
Packit Service db8eaa
#define EXTOUT_AC97_REAR_R 0x0e	/* SB Live 5.1 (c) 2003 - Rear Right */
Packit Service db8eaa
#define EXTOUT_ACENTER	   0x11 /* Analog Center */
Packit Service db8eaa
#define EXTOUT_ALFE	   0x12 /* Analog LFE */
Packit Service db8eaa
Packit Service db8eaa
/* Audigy Inputs */
Packit Service db8eaa
#define A_EXTIN_AC97_L		0x00	/* AC'97 capture channel - left */
Packit Service db8eaa
#define A_EXTIN_AC97_R		0x01	/* AC'97 capture channel - right */
Packit Service db8eaa
#define A_EXTIN_SPDIF_CD_L	0x02	/* digital CD left */
Packit Service db8eaa
#define A_EXTIN_SPDIF_CD_R	0x03	/* digital CD left */
Packit Service db8eaa
#define A_EXTIN_OPT_SPDIF_L     0x04    /* audigy drive Optical SPDIF - left */
Packit Service db8eaa
#define A_EXTIN_OPT_SPDIF_R     0x05    /*                              right */ 
Packit Service db8eaa
#define A_EXTIN_LINE2_L		0x08	/* audigy drive line2/mic2 - left */
Packit Service db8eaa
#define A_EXTIN_LINE2_R		0x09	/*                           right */
Packit Service db8eaa
#define A_EXTIN_ADC_L		0x0a    /* Philips ADC - left */
Packit Service db8eaa
#define A_EXTIN_ADC_R		0x0b    /*               right */
Packit Service db8eaa
#define A_EXTIN_AUX2_L		0x0c	/* audigy drive aux2 - left */
Packit Service db8eaa
#define A_EXTIN_AUX2_R		0x0d	/*                   - right */
Packit Service db8eaa
Packit Service db8eaa
/* Audigiy Outputs */
Packit Service db8eaa
#define A_EXTOUT_FRONT_L	0x00	/* digital front left */
Packit Service db8eaa
#define A_EXTOUT_FRONT_R	0x01	/*               right */
Packit Service db8eaa
#define A_EXTOUT_CENTER		0x02	/* digital front center */
Packit Service db8eaa
#define A_EXTOUT_LFE		0x03	/* digital front lfe */
Packit Service db8eaa
#define A_EXTOUT_HEADPHONE_L	0x04	/* headphone audigy drive left */
Packit Service db8eaa
#define A_EXTOUT_HEADPHONE_R	0x05	/*                        right */
Packit Service db8eaa
#define A_EXTOUT_REAR_L		0x06	/* digital rear left */
Packit Service db8eaa
#define A_EXTOUT_REAR_R		0x07	/*              right */
Packit Service db8eaa
#define A_EXTOUT_AFRONT_L	0x08	/* analog front left */
Packit Service db8eaa
#define A_EXTOUT_AFRONT_R	0x09	/*              right */
Packit Service db8eaa
#define A_EXTOUT_ACENTER	0x0a	/* analog center */
Packit Service db8eaa
#define A_EXTOUT_ALFE		0x0b	/* analog LFE */
Packit Service db8eaa
#define A_EXTOUT_ASIDE_L	0x0c	/* analog side left  - Audigy 2 ZS */
Packit Service db8eaa
#define A_EXTOUT_ASIDE_R	0x0d	/*             right - Audigy 2 ZS */
Packit Service db8eaa
#define A_EXTOUT_AREAR_L	0x0e	/* analog rear left */
Packit Service db8eaa
#define A_EXTOUT_AREAR_R	0x0f	/*             right */
Packit Service db8eaa
#define A_EXTOUT_AC97_L		0x10	/* AC97 left (front) */
Packit Service db8eaa
#define A_EXTOUT_AC97_R		0x11	/*      right */
Packit Service db8eaa
#define A_EXTOUT_ADC_CAP_L	0x16	/* ADC capture buffer left */
Packit Service db8eaa
#define A_EXTOUT_ADC_CAP_R	0x17	/*                    right */
Packit Service db8eaa
#define A_EXTOUT_MIC_CAP	0x18	/* Mic capture buffer */
Packit Service db8eaa
Packit Service db8eaa
/* Audigy constants */
Packit Service db8eaa
#define A_C_00000000	0xc0
Packit Service db8eaa
#define A_C_00000001	0xc1
Packit Service db8eaa
#define A_C_00000002	0xc2
Packit Service db8eaa
#define A_C_00000003	0xc3
Packit Service db8eaa
#define A_C_00000004	0xc4
Packit Service db8eaa
#define A_C_00000008	0xc5
Packit Service db8eaa
#define A_C_00000010	0xc6
Packit Service db8eaa
#define A_C_00000020	0xc7
Packit Service db8eaa
#define A_C_00000100	0xc8
Packit Service db8eaa
#define A_C_00010000	0xc9
Packit Service db8eaa
#define A_C_00000800	0xca
Packit Service db8eaa
#define A_C_10000000	0xcb
Packit Service db8eaa
#define A_C_20000000	0xcc
Packit Service db8eaa
#define A_C_40000000	0xcd
Packit Service db8eaa
#define A_C_80000000	0xce
Packit Service db8eaa
#define A_C_7fffffff	0xcf
Packit Service db8eaa
#define A_C_ffffffff	0xd0
Packit Service db8eaa
#define A_C_fffffffe	0xd1
Packit Service db8eaa
#define A_C_c0000000	0xd2
Packit Service db8eaa
#define A_C_4f1bbcdc	0xd3
Packit Service db8eaa
#define A_C_5a7ef9db	0xd4
Packit Service db8eaa
#define A_C_00100000	0xd5
Packit Service db8eaa
#define A_GPR_ACCU	0xd6		/* ACCUM, accumulator */
Packit Service db8eaa
#define A_GPR_COND	0xd7		/* CCR, condition register */
Packit Service db8eaa
#define A_GPR_NOISE0	0xd8		/* noise source */
Packit Service db8eaa
#define A_GPR_NOISE1	0xd9		/* noise source */
Packit Service db8eaa
#define A_GPR_IRQ	0xda		/* IRQ register */
Packit Service db8eaa
#define A_GPR_DBAC	0xdb		/* TRAM Delay Base Address Counter - internal */
Packit Service db8eaa
#define A_GPR_DBACE	0xde		/* TRAM Delay Base Address Counter - external */
Packit Service db8eaa
Packit Service db8eaa
/* definitions for debug register */
Packit Service db8eaa
#define EMU10K1_DBG_ZC			0x80000000	/* zero tram counter */
Packit Service db8eaa
#define EMU10K1_DBG_SATURATION_OCCURED	0x02000000	/* saturation control */
Packit Service db8eaa
#define EMU10K1_DBG_SATURATION_ADDR	0x01ff0000	/* saturation address */
Packit Service db8eaa
#define EMU10K1_DBG_SINGLE_STEP		0x00008000	/* single step mode */
Packit Service db8eaa
#define EMU10K1_DBG_STEP		0x00004000	/* start single step */
Packit Service db8eaa
#define EMU10K1_DBG_CONDITION_CODE	0x00003e00	/* condition code */
Packit Service db8eaa
#define EMU10K1_DBG_SINGLE_STEP_ADDR	0x000001ff	/* single step address */
Packit Service db8eaa
Packit Service db8eaa
/* tank memory address line */
Packit Service db8eaa
#define TANKMEMADDRREG_ADDR_MASK 0x000fffff	/* 20 bit tank address field			*/
Packit Service db8eaa
#define TANKMEMADDRREG_CLEAR	 0x00800000	/* Clear tank memory				*/
Packit Service db8eaa
#define TANKMEMADDRREG_ALIGN	 0x00400000	/* Align read or write relative to tank access	*/
Packit Service db8eaa
#define TANKMEMADDRREG_WRITE	 0x00200000	/* Write to tank memory				*/
Packit Service db8eaa
#define TANKMEMADDRREG_READ	 0x00100000	/* Read from tank memory			*/
Packit Service db8eaa
Packit Service db8eaa
struct snd_emu10k1_fx8010_info {
Packit Service db8eaa
	unsigned int internal_tram_size;	/* in samples */
Packit Service db8eaa
	unsigned int external_tram_size;	/* in samples */
Packit Service db8eaa
	char fxbus_names[16][32];		/* names of FXBUSes */
Packit Service db8eaa
	char extin_names[16][32];		/* names of external inputs */
Packit Service db8eaa
	char extout_names[32][32];		/* names of external outputs */
Packit Service db8eaa
	unsigned int gpr_controls;		/* count of GPR controls */
Packit Service db8eaa
};
Packit Service db8eaa
Packit Service db8eaa
#define EMU10K1_GPR_TRANSLATION_NONE		0
Packit Service db8eaa
#define EMU10K1_GPR_TRANSLATION_TABLE100	1
Packit Service db8eaa
#define EMU10K1_GPR_TRANSLATION_BASS		2
Packit Service db8eaa
#define EMU10K1_GPR_TRANSLATION_TREBLE		3
Packit Service db8eaa
#define EMU10K1_GPR_TRANSLATION_ONOFF		4
Packit Service db8eaa
Packit Service db8eaa
enum emu10k1_ctl_elem_iface {
Packit Service db8eaa
	EMU10K1_CTL_ELEM_IFACE_MIXER = 2,	/* virtual mixer device */
Packit Service db8eaa
	EMU10K1_CTL_ELEM_IFACE_PCM = 3,		/* PCM device */
Packit Service db8eaa
};
Packit Service db8eaa
Packit Service db8eaa
struct emu10k1_ctl_elem_id {
Packit Service db8eaa
	unsigned int pad;		/* don't use */
Packit Service db8eaa
	int iface;			/* interface identifier */
Packit Service db8eaa
	unsigned int device;		/* device/client number */
Packit Service db8eaa
	unsigned int subdevice;		/* subdevice (substream) number */
Packit Service db8eaa
	unsigned char name[44];		/* ASCII name of item */
Packit Service db8eaa
	unsigned int index;		/* index of item */
Packit Service db8eaa
};
Packit Service db8eaa
Packit Service db8eaa
struct snd_emu10k1_fx8010_control_gpr {
Packit Service db8eaa
	struct emu10k1_ctl_elem_id id;	/* full control ID definition */
Packit Service db8eaa
	unsigned int vcount;		/* visible count */
Packit Service db8eaa
	unsigned int count;		/* count of GPR (1..16) */
Packit Service db8eaa
	unsigned short gpr[32];		/* GPR number(s) */
Packit Service db8eaa
	unsigned int value[32];		/* initial values */
Packit Service db8eaa
	unsigned int min;		/* minimum range */
Packit Service db8eaa
	unsigned int max;		/* maximum range */
Packit Service db8eaa
	unsigned int translation;	/* translation type (EMU10K1_GPR_TRANSLATION*) */
Packit Service db8eaa
	const unsigned int *tlv;
Packit Service db8eaa
};
Packit Service db8eaa
Packit Service db8eaa
/* old ABI without TLV support */
Packit Service db8eaa
struct snd_emu10k1_fx8010_control_old_gpr {
Packit Service db8eaa
	struct emu10k1_ctl_elem_id id;
Packit Service db8eaa
	unsigned int vcount;
Packit Service db8eaa
	unsigned int count;
Packit Service db8eaa
	unsigned short gpr[32];
Packit Service db8eaa
	unsigned int value[32];
Packit Service db8eaa
	unsigned int min;
Packit Service db8eaa
	unsigned int max;
Packit Service db8eaa
	unsigned int translation;
Packit Service db8eaa
};
Packit Service db8eaa
Packit Service db8eaa
struct snd_emu10k1_fx8010_code {
Packit Service db8eaa
	char name[128];
Packit Service db8eaa
Packit Service db8eaa
	__EMU10K1_DECLARE_BITMAP(gpr_valid, 0x200); /* bitmask of valid initializers */
Packit Service db8eaa
	__u32 *gpr_map;			/* initializers */
Packit Service db8eaa
Packit Service db8eaa
	unsigned int gpr_add_control_count; /* count of GPR controls to add/replace */
Packit Service db8eaa
	struct snd_emu10k1_fx8010_control_gpr *gpr_add_controls; /* GPR controls to add/replace */
Packit Service db8eaa
Packit Service db8eaa
	unsigned int gpr_del_control_count; /* count of GPR controls to remove */
Packit Service db8eaa
	struct emu10k1_ctl_elem_id *gpr_del_controls; /* IDs of GPR controls to remove */
Packit Service db8eaa
Packit Service db8eaa
	unsigned int gpr_list_control_count; /* count of GPR controls to list */
Packit Service db8eaa
	unsigned int gpr_list_control_total; /* total count of GPR controls */
Packit Service db8eaa
	struct snd_emu10k1_fx8010_control_gpr *gpr_list_controls; /* listed GPR controls */
Packit Service db8eaa
Packit Service db8eaa
	__EMU10K1_DECLARE_BITMAP(tram_valid, 0x100); /* bitmask of valid initializers */
Packit Service db8eaa
	__u32 *tram_data_map;		  /* data initializers */
Packit Service db8eaa
	__u32 *tram_addr_map;		  /* map initializers */
Packit Service db8eaa
Packit Service db8eaa
	__EMU10K1_DECLARE_BITMAP(code_valid, 1024); /* bitmask of valid instructions */
Packit Service db8eaa
	__u32 *code;			  /* one instruction - 64 bits */
Packit Service db8eaa
};
Packit Service db8eaa
Packit Service db8eaa
struct snd_emu10k1_fx8010_tram {
Packit Service db8eaa
	unsigned int address;		/* 31.bit == 1 -> external TRAM */
Packit Service db8eaa
	unsigned int size;		/* size in samples (4 bytes) */
Packit Service db8eaa
	unsigned int *samples;		/* pointer to samples (20-bit) */
Packit Service db8eaa
					/* NULL->clear memory */
Packit Service db8eaa
};
Packit Service db8eaa
Packit Service db8eaa
struct snd_emu10k1_fx8010_pcm_rec {
Packit Service db8eaa
	unsigned int substream;		/* substream number */
Packit Service db8eaa
	unsigned int res1;		/* reserved */
Packit Service db8eaa
	unsigned int channels;		/* 16-bit channels count, zero = remove this substream */
Packit Service db8eaa
	unsigned int tram_start;	/* ring buffer position in TRAM (in samples) */
Packit Service db8eaa
	unsigned int buffer_size;	/* count of buffered samples */
Packit Service db8eaa
	unsigned short gpr_size;		/* GPR containing size of ringbuffer in samples (host) */
Packit Service db8eaa
	unsigned short gpr_ptr;		/* GPR containing current pointer in the ring buffer (host = reset, FX8010) */
Packit Service db8eaa
	unsigned short gpr_count;	/* GPR containing count of samples between two interrupts (host) */
Packit Service db8eaa
	unsigned short gpr_tmpcount;	/* GPR containing current count of samples to interrupt (host = set, FX8010) */
Packit Service db8eaa
	unsigned short gpr_trigger;	/* GPR containing trigger (activate) information (host) */
Packit Service db8eaa
	unsigned short gpr_running;	/* GPR containing info if PCM is running (FX8010) */
Packit Service db8eaa
	unsigned char pad;		/* reserved */
Packit Service db8eaa
	unsigned char etram[32];	/* external TRAM address & data (one per channel) */
Packit Service db8eaa
	unsigned int res2;		/* reserved */
Packit Service db8eaa
};
Packit Service db8eaa
Packit Service db8eaa
#define SNDRV_EMU10K1_VERSION		SNDRV_PROTOCOL_VERSION(1, 0, 1)
Packit Service db8eaa
Packit Service db8eaa
#define SNDRV_EMU10K1_IOCTL_INFO	_IOR ('H', 0x10, struct snd_emu10k1_fx8010_info)
Packit Service db8eaa
#define SNDRV_EMU10K1_IOCTL_CODE_POKE	_IOW ('H', 0x11, struct snd_emu10k1_fx8010_code)
Packit Service db8eaa
#define SNDRV_EMU10K1_IOCTL_CODE_PEEK	_IOWR('H', 0x12, struct snd_emu10k1_fx8010_code)
Packit Service db8eaa
#define SNDRV_EMU10K1_IOCTL_TRAM_SETUP	_IOW ('H', 0x20, int)
Packit Service db8eaa
#define SNDRV_EMU10K1_IOCTL_TRAM_POKE	_IOW ('H', 0x21, struct snd_emu10k1_fx8010_tram)
Packit Service db8eaa
#define SNDRV_EMU10K1_IOCTL_TRAM_PEEK	_IOWR('H', 0x22, struct snd_emu10k1_fx8010_tram)
Packit Service db8eaa
#define SNDRV_EMU10K1_IOCTL_PCM_POKE	_IOW ('H', 0x30, struct snd_emu10k1_fx8010_pcm_rec)
Packit Service db8eaa
#define SNDRV_EMU10K1_IOCTL_PCM_PEEK	_IOWR('H', 0x31, struct snd_emu10k1_fx8010_pcm_rec)
Packit Service db8eaa
#define SNDRV_EMU10K1_IOCTL_PVERSION	_IOR ('H', 0x40, int)
Packit Service db8eaa
#define SNDRV_EMU10K1_IOCTL_STOP	_IO  ('H', 0x80)
Packit Service db8eaa
#define SNDRV_EMU10K1_IOCTL_CONTINUE	_IO  ('H', 0x81)
Packit Service db8eaa
#define SNDRV_EMU10K1_IOCTL_ZERO_TRAM_COUNTER _IO ('H', 0x82)
Packit Service db8eaa
#define SNDRV_EMU10K1_IOCTL_SINGLE_STEP	_IOW ('H', 0x83, int)
Packit Service db8eaa
#define SNDRV_EMU10K1_IOCTL_DBG_READ	_IOR ('H', 0x84, int)
Packit Service db8eaa
Packit Service db8eaa
#endif /* __SOUND_EMU10K1_H */