1e2be04c7SGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */ 2674e95caSDavid Howells /* 3674e95caSDavid Howells * Copyright (c) by Jaroslav Kysela <perex@perex.cz>, 4674e95caSDavid Howells * Creative Labs, Inc. 5674e95caSDavid Howells * Definitions for EMU10K1 (SB Live!) chips 6674e95caSDavid Howells * 7674e95caSDavid Howells * 8674e95caSDavid Howells * This program is free software; you can redistribute it and/or modify 9674e95caSDavid Howells * it under the terms of the GNU General Public License as published by 10674e95caSDavid Howells * the Free Software Foundation; either version 2 of the License, or 11674e95caSDavid Howells * (at your option) any later version. 12674e95caSDavid Howells * 13674e95caSDavid Howells * This program is distributed in the hope that it will be useful, 14674e95caSDavid Howells * but WITHOUT ANY WARRANTY; without even the implied warranty of 15674e95caSDavid Howells * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16674e95caSDavid Howells * GNU General Public License for more details. 17674e95caSDavid Howells * 18674e95caSDavid Howells * You should have received a copy of the GNU General Public License 19674e95caSDavid Howells * along with this program; if not, write to the Free Software 20674e95caSDavid Howells * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 21674e95caSDavid Howells * 22674e95caSDavid Howells */ 23674e95caSDavid Howells #ifndef _UAPI__SOUND_EMU10K1_H 24674e95caSDavid Howells #define _UAPI__SOUND_EMU10K1_H 25674e95caSDavid Howells 26*d06ed0c2STakashi Iwai #ifdef __linux__ 27*d06ed0c2STakashi Iwai #include <linux/types.h> 28*d06ed0c2STakashi Iwai #endif 29*d06ed0c2STakashi Iwai 30674e95caSDavid Howells /* 31674e95caSDavid Howells * ---- FX8010 ---- 32674e95caSDavid Howells */ 33674e95caSDavid Howells 34674e95caSDavid Howells #define EMU10K1_CARD_CREATIVE 0x00000000 35674e95caSDavid Howells #define EMU10K1_CARD_EMUAPS 0x00000001 36674e95caSDavid Howells 37674e95caSDavid Howells #define EMU10K1_FX8010_PCM_COUNT 8 38674e95caSDavid Howells 39a82d24f8SMikko Rapeli /* 40a82d24f8SMikko Rapeli * Following definition is copied from linux/types.h to support compiling 41a82d24f8SMikko Rapeli * this header file in userspace since they are not generally available for 42a82d24f8SMikko Rapeli * uapi headers. 43a82d24f8SMikko Rapeli */ 44a82d24f8SMikko Rapeli #define __EMU10K1_DECLARE_BITMAP(name,bits) \ 45a82d24f8SMikko Rapeli unsigned long name[(bits) / (sizeof(unsigned long) * 8)] 46a82d24f8SMikko Rapeli 47674e95caSDavid Howells /* instruction set */ 48674e95caSDavid Howells #define iMAC0 0x00 /* R = A + (X * Y >> 31) ; saturation */ 49674e95caSDavid Howells #define iMAC1 0x01 /* R = A + (-X * Y >> 31) ; saturation */ 50674e95caSDavid Howells #define iMAC2 0x02 /* R = A + (X * Y >> 31) ; wraparound */ 51674e95caSDavid Howells #define iMAC3 0x03 /* R = A + (-X * Y >> 31) ; wraparound */ 52674e95caSDavid Howells #define iMACINT0 0x04 /* R = A + X * Y ; saturation */ 53674e95caSDavid Howells #define iMACINT1 0x05 /* R = A + X * Y ; wraparound (31-bit) */ 54674e95caSDavid Howells #define iACC3 0x06 /* R = A + X + Y ; saturation */ 55674e95caSDavid Howells #define iMACMV 0x07 /* R = A, acc += X * Y >> 31 */ 56674e95caSDavid Howells #define iANDXOR 0x08 /* R = (A & X) ^ Y */ 57674e95caSDavid Howells #define iTSTNEG 0x09 /* R = (A >= Y) ? X : ~X */ 58674e95caSDavid Howells #define iLIMITGE 0x0a /* R = (A >= Y) ? X : Y */ 59674e95caSDavid Howells #define iLIMITLT 0x0b /* R = (A < Y) ? X : Y */ 60674e95caSDavid Howells #define iLOG 0x0c /* R = linear_data, A (log_data), X (max_exp), Y (format_word) */ 61674e95caSDavid Howells #define iEXP 0x0d /* R = log_data, A (linear_data), X (max_exp), Y (format_word) */ 62674e95caSDavid Howells #define iINTERP 0x0e /* R = A + (X * (Y - A) >> 31) ; saturation */ 63674e95caSDavid Howells #define iSKIP 0x0f /* R = A (cc_reg), X (count), Y (cc_test) */ 64674e95caSDavid Howells 65674e95caSDavid Howells /* GPRs */ 66674e95caSDavid Howells #define FXBUS(x) (0x00 + (x)) /* x = 0x00 - 0x0f */ 67674e95caSDavid Howells #define EXTIN(x) (0x10 + (x)) /* x = 0x00 - 0x0f */ 68674e95caSDavid Howells #define EXTOUT(x) (0x20 + (x)) /* x = 0x00 - 0x0f physical outs -> FXWC low 16 bits */ 69674e95caSDavid Howells #define FXBUS2(x) (0x30 + (x)) /* x = 0x00 - 0x0f copies of fx buses for capture -> FXWC high 16 bits */ 70674e95caSDavid Howells /* NB: 0x31 and 0x32 are shared with Center/LFE on SB live 5.1 */ 71674e95caSDavid Howells 72674e95caSDavid Howells #define C_00000000 0x40 73674e95caSDavid Howells #define C_00000001 0x41 74674e95caSDavid Howells #define C_00000002 0x42 75674e95caSDavid Howells #define C_00000003 0x43 76674e95caSDavid Howells #define C_00000004 0x44 77674e95caSDavid Howells #define C_00000008 0x45 78674e95caSDavid Howells #define C_00000010 0x46 79674e95caSDavid Howells #define C_00000020 0x47 80674e95caSDavid Howells #define C_00000100 0x48 81674e95caSDavid Howells #define C_00010000 0x49 82674e95caSDavid Howells #define C_00080000 0x4a 83674e95caSDavid Howells #define C_10000000 0x4b 84674e95caSDavid Howells #define C_20000000 0x4c 85674e95caSDavid Howells #define C_40000000 0x4d 86674e95caSDavid Howells #define C_80000000 0x4e 87674e95caSDavid Howells #define C_7fffffff 0x4f 88674e95caSDavid Howells #define C_ffffffff 0x50 89674e95caSDavid Howells #define C_fffffffe 0x51 90674e95caSDavid Howells #define C_c0000000 0x52 91674e95caSDavid Howells #define C_4f1bbcdc 0x53 92674e95caSDavid Howells #define C_5a7ef9db 0x54 93674e95caSDavid Howells #define C_00100000 0x55 /* ?? */ 94674e95caSDavid Howells #define GPR_ACCU 0x56 /* ACCUM, accumulator */ 95674e95caSDavid Howells #define GPR_COND 0x57 /* CCR, condition register */ 96674e95caSDavid Howells #define GPR_NOISE0 0x58 /* noise source */ 97674e95caSDavid Howells #define GPR_NOISE1 0x59 /* noise source */ 98674e95caSDavid Howells #define GPR_IRQ 0x5a /* IRQ register */ 99674e95caSDavid Howells #define GPR_DBAC 0x5b /* TRAM Delay Base Address Counter */ 100674e95caSDavid Howells #define GPR(x) (FXGPREGBASE + (x)) /* free GPRs: x = 0x00 - 0xff */ 101674e95caSDavid Howells #define ITRAM_DATA(x) (TANKMEMDATAREGBASE + 0x00 + (x)) /* x = 0x00 - 0x7f */ 102674e95caSDavid Howells #define ETRAM_DATA(x) (TANKMEMDATAREGBASE + 0x80 + (x)) /* x = 0x00 - 0x1f */ 103674e95caSDavid Howells #define ITRAM_ADDR(x) (TANKMEMADDRREGBASE + 0x00 + (x)) /* x = 0x00 - 0x7f */ 104674e95caSDavid Howells #define ETRAM_ADDR(x) (TANKMEMADDRREGBASE + 0x80 + (x)) /* x = 0x00 - 0x1f */ 105674e95caSDavid Howells 106674e95caSDavid Howells #define A_ITRAM_DATA(x) (TANKMEMDATAREGBASE + 0x00 + (x)) /* x = 0x00 - 0xbf */ 107674e95caSDavid Howells #define A_ETRAM_DATA(x) (TANKMEMDATAREGBASE + 0xc0 + (x)) /* x = 0x00 - 0x3f */ 108674e95caSDavid Howells #define A_ITRAM_ADDR(x) (TANKMEMADDRREGBASE + 0x00 + (x)) /* x = 0x00 - 0xbf */ 109674e95caSDavid Howells #define A_ETRAM_ADDR(x) (TANKMEMADDRREGBASE + 0xc0 + (x)) /* x = 0x00 - 0x3f */ 110674e95caSDavid Howells #define A_ITRAM_CTL(x) (A_TANKMEMCTLREGBASE + 0x00 + (x)) /* x = 0x00 - 0xbf */ 111674e95caSDavid Howells #define A_ETRAM_CTL(x) (A_TANKMEMCTLREGBASE + 0xc0 + (x)) /* x = 0x00 - 0x3f */ 112674e95caSDavid Howells 113674e95caSDavid Howells #define A_FXBUS(x) (0x00 + (x)) /* x = 0x00 - 0x3f FX buses */ 114674e95caSDavid Howells #define A_EXTIN(x) (0x40 + (x)) /* x = 0x00 - 0x0f physical ins */ 115674e95caSDavid Howells #define A_P16VIN(x) (0x50 + (x)) /* x = 0x00 - 0x0f p16v ins (A2 only) "EMU32 inputs" */ 116674e95caSDavid Howells #define A_EXTOUT(x) (0x60 + (x)) /* x = 0x00 - 0x1f physical outs -> A_FXWC1 0x79-7f unknown */ 117674e95caSDavid Howells #define A_FXBUS2(x) (0x80 + (x)) /* x = 0x00 - 0x1f extra outs used for EFX capture -> A_FXWC2 */ 118674e95caSDavid Howells #define A_EMU32OUTH(x) (0xa0 + (x)) /* x = 0x00 - 0x0f "EMU32_OUT_10 - _1F" - ??? */ 119674e95caSDavid Howells #define A_EMU32OUTL(x) (0xb0 + (x)) /* x = 0x00 - 0x0f "EMU32_OUT_1 - _F" - ??? */ 120674e95caSDavid Howells #define A3_EMU32IN(x) (0x160 + (x)) /* x = 0x00 - 0x3f "EMU32_IN_00 - _3F" - Only when .device = 0x0008 */ 121674e95caSDavid Howells #define A3_EMU32OUT(x) (0x1E0 + (x)) /* x = 0x00 - 0x0f "EMU32_OUT_00 - _3F" - Only when .device = 0x0008 */ 122674e95caSDavid Howells #define A_GPR(x) (A_FXGPREGBASE + (x)) 123674e95caSDavid Howells 124674e95caSDavid Howells /* cc_reg constants */ 125674e95caSDavid Howells #define CC_REG_NORMALIZED C_00000001 126674e95caSDavid Howells #define CC_REG_BORROW C_00000002 127674e95caSDavid Howells #define CC_REG_MINUS C_00000004 128674e95caSDavid Howells #define CC_REG_ZERO C_00000008 129674e95caSDavid Howells #define CC_REG_SATURATE C_00000010 130674e95caSDavid Howells #define CC_REG_NONZERO C_00000100 131674e95caSDavid Howells 132674e95caSDavid Howells /* FX buses */ 133674e95caSDavid Howells #define FXBUS_PCM_LEFT 0x00 134674e95caSDavid Howells #define FXBUS_PCM_RIGHT 0x01 135674e95caSDavid Howells #define FXBUS_PCM_LEFT_REAR 0x02 136674e95caSDavid Howells #define FXBUS_PCM_RIGHT_REAR 0x03 137674e95caSDavid Howells #define FXBUS_MIDI_LEFT 0x04 138674e95caSDavid Howells #define FXBUS_MIDI_RIGHT 0x05 139674e95caSDavid Howells #define FXBUS_PCM_CENTER 0x06 140674e95caSDavid Howells #define FXBUS_PCM_LFE 0x07 141674e95caSDavid Howells #define FXBUS_PCM_LEFT_FRONT 0x08 142674e95caSDavid Howells #define FXBUS_PCM_RIGHT_FRONT 0x09 143674e95caSDavid Howells #define FXBUS_MIDI_REVERB 0x0c 144674e95caSDavid Howells #define FXBUS_MIDI_CHORUS 0x0d 145674e95caSDavid Howells #define FXBUS_PCM_LEFT_SIDE 0x0e 146674e95caSDavid Howells #define FXBUS_PCM_RIGHT_SIDE 0x0f 147674e95caSDavid Howells #define FXBUS_PT_LEFT 0x14 148674e95caSDavid Howells #define FXBUS_PT_RIGHT 0x15 149674e95caSDavid Howells 150674e95caSDavid Howells /* Inputs */ 151674e95caSDavid Howells #define EXTIN_AC97_L 0x00 /* AC'97 capture channel - left */ 152674e95caSDavid Howells #define EXTIN_AC97_R 0x01 /* AC'97 capture channel - right */ 153674e95caSDavid Howells #define EXTIN_SPDIF_CD_L 0x02 /* internal S/PDIF CD - onboard - left */ 154674e95caSDavid Howells #define EXTIN_SPDIF_CD_R 0x03 /* internal S/PDIF CD - onboard - right */ 155674e95caSDavid Howells #define EXTIN_ZOOM_L 0x04 /* Zoom Video I2S - left */ 156674e95caSDavid Howells #define EXTIN_ZOOM_R 0x05 /* Zoom Video I2S - right */ 157674e95caSDavid Howells #define EXTIN_TOSLINK_L 0x06 /* LiveDrive - TOSLink Optical - left */ 158674e95caSDavid Howells #define EXTIN_TOSLINK_R 0x07 /* LiveDrive - TOSLink Optical - right */ 159674e95caSDavid Howells #define EXTIN_LINE1_L 0x08 /* LiveDrive - Line/Mic 1 - left */ 160674e95caSDavid Howells #define EXTIN_LINE1_R 0x09 /* LiveDrive - Line/Mic 1 - right */ 161674e95caSDavid Howells #define EXTIN_COAX_SPDIF_L 0x0a /* LiveDrive - Coaxial S/PDIF - left */ 162674e95caSDavid Howells #define EXTIN_COAX_SPDIF_R 0x0b /* LiveDrive - Coaxial S/PDIF - right */ 163674e95caSDavid Howells #define EXTIN_LINE2_L 0x0c /* LiveDrive - Line/Mic 2 - left */ 164674e95caSDavid Howells #define EXTIN_LINE2_R 0x0d /* LiveDrive - Line/Mic 2 - right */ 165674e95caSDavid Howells 166674e95caSDavid Howells /* Outputs */ 167674e95caSDavid Howells #define EXTOUT_AC97_L 0x00 /* AC'97 playback channel - left */ 168674e95caSDavid Howells #define EXTOUT_AC97_R 0x01 /* AC'97 playback channel - right */ 169674e95caSDavid Howells #define EXTOUT_TOSLINK_L 0x02 /* LiveDrive - TOSLink Optical - left */ 170674e95caSDavid Howells #define EXTOUT_TOSLINK_R 0x03 /* LiveDrive - TOSLink Optical - right */ 171674e95caSDavid Howells #define EXTOUT_AC97_CENTER 0x04 /* SB Live 5.1 - center */ 172674e95caSDavid Howells #define EXTOUT_AC97_LFE 0x05 /* SB Live 5.1 - LFE */ 173674e95caSDavid Howells #define EXTOUT_HEADPHONE_L 0x06 /* LiveDrive - Headphone - left */ 174674e95caSDavid Howells #define EXTOUT_HEADPHONE_R 0x07 /* LiveDrive - Headphone - right */ 175674e95caSDavid Howells #define EXTOUT_REAR_L 0x08 /* Rear channel - left */ 176674e95caSDavid Howells #define EXTOUT_REAR_R 0x09 /* Rear channel - right */ 177674e95caSDavid Howells #define EXTOUT_ADC_CAP_L 0x0a /* ADC Capture buffer - left */ 178674e95caSDavid Howells #define EXTOUT_ADC_CAP_R 0x0b /* ADC Capture buffer - right */ 179674e95caSDavid Howells #define EXTOUT_MIC_CAP 0x0c /* MIC Capture buffer */ 180674e95caSDavid Howells #define EXTOUT_AC97_REAR_L 0x0d /* SB Live 5.1 (c) 2003 - Rear Left */ 181674e95caSDavid Howells #define EXTOUT_AC97_REAR_R 0x0e /* SB Live 5.1 (c) 2003 - Rear Right */ 182674e95caSDavid Howells #define EXTOUT_ACENTER 0x11 /* Analog Center */ 183674e95caSDavid Howells #define EXTOUT_ALFE 0x12 /* Analog LFE */ 184674e95caSDavid Howells 185674e95caSDavid Howells /* Audigy Inputs */ 186674e95caSDavid Howells #define A_EXTIN_AC97_L 0x00 /* AC'97 capture channel - left */ 187674e95caSDavid Howells #define A_EXTIN_AC97_R 0x01 /* AC'97 capture channel - right */ 188674e95caSDavid Howells #define A_EXTIN_SPDIF_CD_L 0x02 /* digital CD left */ 189674e95caSDavid Howells #define A_EXTIN_SPDIF_CD_R 0x03 /* digital CD left */ 190674e95caSDavid Howells #define A_EXTIN_OPT_SPDIF_L 0x04 /* audigy drive Optical SPDIF - left */ 191674e95caSDavid Howells #define A_EXTIN_OPT_SPDIF_R 0x05 /* right */ 192674e95caSDavid Howells #define A_EXTIN_LINE2_L 0x08 /* audigy drive line2/mic2 - left */ 193674e95caSDavid Howells #define A_EXTIN_LINE2_R 0x09 /* right */ 194674e95caSDavid Howells #define A_EXTIN_ADC_L 0x0a /* Philips ADC - left */ 195674e95caSDavid Howells #define A_EXTIN_ADC_R 0x0b /* right */ 196674e95caSDavid Howells #define A_EXTIN_AUX2_L 0x0c /* audigy drive aux2 - left */ 197674e95caSDavid Howells #define A_EXTIN_AUX2_R 0x0d /* - right */ 198674e95caSDavid Howells 199674e95caSDavid Howells /* Audigiy Outputs */ 200674e95caSDavid Howells #define A_EXTOUT_FRONT_L 0x00 /* digital front left */ 201674e95caSDavid Howells #define A_EXTOUT_FRONT_R 0x01 /* right */ 202674e95caSDavid Howells #define A_EXTOUT_CENTER 0x02 /* digital front center */ 203674e95caSDavid Howells #define A_EXTOUT_LFE 0x03 /* digital front lfe */ 204674e95caSDavid Howells #define A_EXTOUT_HEADPHONE_L 0x04 /* headphone audigy drive left */ 205674e95caSDavid Howells #define A_EXTOUT_HEADPHONE_R 0x05 /* right */ 206674e95caSDavid Howells #define A_EXTOUT_REAR_L 0x06 /* digital rear left */ 207674e95caSDavid Howells #define A_EXTOUT_REAR_R 0x07 /* right */ 208674e95caSDavid Howells #define A_EXTOUT_AFRONT_L 0x08 /* analog front left */ 209674e95caSDavid Howells #define A_EXTOUT_AFRONT_R 0x09 /* right */ 210674e95caSDavid Howells #define A_EXTOUT_ACENTER 0x0a /* analog center */ 211674e95caSDavid Howells #define A_EXTOUT_ALFE 0x0b /* analog LFE */ 212674e95caSDavid Howells #define A_EXTOUT_ASIDE_L 0x0c /* analog side left - Audigy 2 ZS */ 213674e95caSDavid Howells #define A_EXTOUT_ASIDE_R 0x0d /* right - Audigy 2 ZS */ 214674e95caSDavid Howells #define A_EXTOUT_AREAR_L 0x0e /* analog rear left */ 215674e95caSDavid Howells #define A_EXTOUT_AREAR_R 0x0f /* right */ 216674e95caSDavid Howells #define A_EXTOUT_AC97_L 0x10 /* AC97 left (front) */ 217674e95caSDavid Howells #define A_EXTOUT_AC97_R 0x11 /* right */ 218674e95caSDavid Howells #define A_EXTOUT_ADC_CAP_L 0x16 /* ADC capture buffer left */ 219674e95caSDavid Howells #define A_EXTOUT_ADC_CAP_R 0x17 /* right */ 220674e95caSDavid Howells #define A_EXTOUT_MIC_CAP 0x18 /* Mic capture buffer */ 221674e95caSDavid Howells 222674e95caSDavid Howells /* Audigy constants */ 223674e95caSDavid Howells #define A_C_00000000 0xc0 224674e95caSDavid Howells #define A_C_00000001 0xc1 225674e95caSDavid Howells #define A_C_00000002 0xc2 226674e95caSDavid Howells #define A_C_00000003 0xc3 227674e95caSDavid Howells #define A_C_00000004 0xc4 228674e95caSDavid Howells #define A_C_00000008 0xc5 229674e95caSDavid Howells #define A_C_00000010 0xc6 230674e95caSDavid Howells #define A_C_00000020 0xc7 231674e95caSDavid Howells #define A_C_00000100 0xc8 232674e95caSDavid Howells #define A_C_00010000 0xc9 233674e95caSDavid Howells #define A_C_00000800 0xca 234674e95caSDavid Howells #define A_C_10000000 0xcb 235674e95caSDavid Howells #define A_C_20000000 0xcc 236674e95caSDavid Howells #define A_C_40000000 0xcd 237674e95caSDavid Howells #define A_C_80000000 0xce 238674e95caSDavid Howells #define A_C_7fffffff 0xcf 239674e95caSDavid Howells #define A_C_ffffffff 0xd0 240674e95caSDavid Howells #define A_C_fffffffe 0xd1 241674e95caSDavid Howells #define A_C_c0000000 0xd2 242674e95caSDavid Howells #define A_C_4f1bbcdc 0xd3 243674e95caSDavid Howells #define A_C_5a7ef9db 0xd4 244674e95caSDavid Howells #define A_C_00100000 0xd5 245674e95caSDavid Howells #define A_GPR_ACCU 0xd6 /* ACCUM, accumulator */ 246674e95caSDavid Howells #define A_GPR_COND 0xd7 /* CCR, condition register */ 247674e95caSDavid Howells #define A_GPR_NOISE0 0xd8 /* noise source */ 248674e95caSDavid Howells #define A_GPR_NOISE1 0xd9 /* noise source */ 249674e95caSDavid Howells #define A_GPR_IRQ 0xda /* IRQ register */ 250674e95caSDavid Howells #define A_GPR_DBAC 0xdb /* TRAM Delay Base Address Counter - internal */ 251674e95caSDavid Howells #define A_GPR_DBACE 0xde /* TRAM Delay Base Address Counter - external */ 252674e95caSDavid Howells 253674e95caSDavid Howells /* definitions for debug register */ 254674e95caSDavid Howells #define EMU10K1_DBG_ZC 0x80000000 /* zero tram counter */ 255674e95caSDavid Howells #define EMU10K1_DBG_SATURATION_OCCURED 0x02000000 /* saturation control */ 256674e95caSDavid Howells #define EMU10K1_DBG_SATURATION_ADDR 0x01ff0000 /* saturation address */ 257674e95caSDavid Howells #define EMU10K1_DBG_SINGLE_STEP 0x00008000 /* single step mode */ 258674e95caSDavid Howells #define EMU10K1_DBG_STEP 0x00004000 /* start single step */ 259674e95caSDavid Howells #define EMU10K1_DBG_CONDITION_CODE 0x00003e00 /* condition code */ 260674e95caSDavid Howells #define EMU10K1_DBG_SINGLE_STEP_ADDR 0x000001ff /* single step address */ 261674e95caSDavid Howells 262674e95caSDavid Howells /* tank memory address line */ 263674e95caSDavid Howells #ifndef __KERNEL__ 264674e95caSDavid Howells #define TANKMEMADDRREG_ADDR_MASK 0x000fffff /* 20 bit tank address field */ 265674e95caSDavid Howells #define TANKMEMADDRREG_CLEAR 0x00800000 /* Clear tank memory */ 266674e95caSDavid Howells #define TANKMEMADDRREG_ALIGN 0x00400000 /* Align read or write relative to tank access */ 267674e95caSDavid Howells #define TANKMEMADDRREG_WRITE 0x00200000 /* Write to tank memory */ 268674e95caSDavid Howells #define TANKMEMADDRREG_READ 0x00100000 /* Read from tank memory */ 269674e95caSDavid Howells #endif 270674e95caSDavid Howells 271674e95caSDavid Howells struct snd_emu10k1_fx8010_info { 272674e95caSDavid Howells unsigned int internal_tram_size; /* in samples */ 273674e95caSDavid Howells unsigned int external_tram_size; /* in samples */ 274674e95caSDavid Howells char fxbus_names[16][32]; /* names of FXBUSes */ 275674e95caSDavid Howells char extin_names[16][32]; /* names of external inputs */ 276674e95caSDavid Howells char extout_names[32][32]; /* names of external outputs */ 277674e95caSDavid Howells unsigned int gpr_controls; /* count of GPR controls */ 278674e95caSDavid Howells }; 279674e95caSDavid Howells 280674e95caSDavid Howells #define EMU10K1_GPR_TRANSLATION_NONE 0 281674e95caSDavid Howells #define EMU10K1_GPR_TRANSLATION_TABLE100 1 282674e95caSDavid Howells #define EMU10K1_GPR_TRANSLATION_BASS 2 283674e95caSDavid Howells #define EMU10K1_GPR_TRANSLATION_TREBLE 3 284674e95caSDavid Howells #define EMU10K1_GPR_TRANSLATION_ONOFF 4 285674e95caSDavid Howells 2862e468867STakashi Iwai enum emu10k1_ctl_elem_iface { 2872e468867STakashi Iwai EMU10K1_CTL_ELEM_IFACE_MIXER = 2, /* virtual mixer device */ 2882e468867STakashi Iwai EMU10K1_CTL_ELEM_IFACE_PCM = 3, /* PCM device */ 2892e468867STakashi Iwai }; 2902e468867STakashi Iwai 2912e468867STakashi Iwai struct emu10k1_ctl_elem_id { 2922e468867STakashi Iwai unsigned int pad; /* don't use */ 2932e468867STakashi Iwai int iface; /* interface identifier */ 2942e468867STakashi Iwai unsigned int device; /* device/client number */ 2952e468867STakashi Iwai unsigned int subdevice; /* subdevice (substream) number */ 2962e468867STakashi Iwai unsigned char name[44]; /* ASCII name of item */ 2972e468867STakashi Iwai unsigned int index; /* index of item */ 2982e468867STakashi Iwai }; 2992e468867STakashi Iwai 300674e95caSDavid Howells struct snd_emu10k1_fx8010_control_gpr { 3012e468867STakashi Iwai struct emu10k1_ctl_elem_id id; /* full control ID definition */ 302674e95caSDavid Howells unsigned int vcount; /* visible count */ 303674e95caSDavid Howells unsigned int count; /* count of GPR (1..16) */ 304674e95caSDavid Howells unsigned short gpr[32]; /* GPR number(s) */ 305674e95caSDavid Howells unsigned int value[32]; /* initial values */ 306674e95caSDavid Howells unsigned int min; /* minimum range */ 307674e95caSDavid Howells unsigned int max; /* maximum range */ 308674e95caSDavid Howells unsigned int translation; /* translation type (EMU10K1_GPR_TRANSLATION*) */ 309674e95caSDavid Howells const unsigned int *tlv; 310674e95caSDavid Howells }; 311674e95caSDavid Howells 312674e95caSDavid Howells /* old ABI without TLV support */ 313674e95caSDavid Howells struct snd_emu10k1_fx8010_control_old_gpr { 3142e468867STakashi Iwai struct emu10k1_ctl_elem_id id; 315674e95caSDavid Howells unsigned int vcount; 316674e95caSDavid Howells unsigned int count; 317674e95caSDavid Howells unsigned short gpr[32]; 318674e95caSDavid Howells unsigned int value[32]; 319674e95caSDavid Howells unsigned int min; 320674e95caSDavid Howells unsigned int max; 321674e95caSDavid Howells unsigned int translation; 322674e95caSDavid Howells }; 323674e95caSDavid Howells 324674e95caSDavid Howells struct snd_emu10k1_fx8010_code { 325674e95caSDavid Howells char name[128]; 326674e95caSDavid Howells 327a82d24f8SMikko Rapeli __EMU10K1_DECLARE_BITMAP(gpr_valid, 0x200); /* bitmask of valid initializers */ 3282e468867STakashi Iwai __u32 *gpr_map; /* initializers */ 329674e95caSDavid Howells 330674e95caSDavid Howells unsigned int gpr_add_control_count; /* count of GPR controls to add/replace */ 3312e468867STakashi Iwai struct snd_emu10k1_fx8010_control_gpr *gpr_add_controls; /* GPR controls to add/replace */ 332674e95caSDavid Howells 333674e95caSDavid Howells unsigned int gpr_del_control_count; /* count of GPR controls to remove */ 3342e468867STakashi Iwai struct emu10k1_ctl_elem_id *gpr_del_controls; /* IDs of GPR controls to remove */ 335674e95caSDavid Howells 336674e95caSDavid Howells unsigned int gpr_list_control_count; /* count of GPR controls to list */ 337674e95caSDavid Howells unsigned int gpr_list_control_total; /* total count of GPR controls */ 3382e468867STakashi Iwai struct snd_emu10k1_fx8010_control_gpr *gpr_list_controls; /* listed GPR controls */ 339674e95caSDavid Howells 340a82d24f8SMikko Rapeli __EMU10K1_DECLARE_BITMAP(tram_valid, 0x100); /* bitmask of valid initializers */ 3412e468867STakashi Iwai __u32 *tram_data_map; /* data initializers */ 3422e468867STakashi Iwai __u32 *tram_addr_map; /* map initializers */ 343674e95caSDavid Howells 344a82d24f8SMikko Rapeli __EMU10K1_DECLARE_BITMAP(code_valid, 1024); /* bitmask of valid instructions */ 3452e468867STakashi Iwai __u32 *code; /* one instruction - 64 bits */ 346674e95caSDavid Howells }; 347674e95caSDavid Howells 348674e95caSDavid Howells struct snd_emu10k1_fx8010_tram { 349674e95caSDavid Howells unsigned int address; /* 31.bit == 1 -> external TRAM */ 350674e95caSDavid Howells unsigned int size; /* size in samples (4 bytes) */ 351674e95caSDavid Howells unsigned int *samples; /* pointer to samples (20-bit) */ 352674e95caSDavid Howells /* NULL->clear memory */ 353674e95caSDavid Howells }; 354674e95caSDavid Howells 355674e95caSDavid Howells struct snd_emu10k1_fx8010_pcm_rec { 356674e95caSDavid Howells unsigned int substream; /* substream number */ 357674e95caSDavid Howells unsigned int res1; /* reserved */ 358674e95caSDavid Howells unsigned int channels; /* 16-bit channels count, zero = remove this substream */ 359674e95caSDavid Howells unsigned int tram_start; /* ring buffer position in TRAM (in samples) */ 360674e95caSDavid Howells unsigned int buffer_size; /* count of buffered samples */ 361674e95caSDavid Howells unsigned short gpr_size; /* GPR containing size of ringbuffer in samples (host) */ 362674e95caSDavid Howells unsigned short gpr_ptr; /* GPR containing current pointer in the ring buffer (host = reset, FX8010) */ 363674e95caSDavid Howells unsigned short gpr_count; /* GPR containing count of samples between two interrupts (host) */ 364674e95caSDavid Howells unsigned short gpr_tmpcount; /* GPR containing current count of samples to interrupt (host = set, FX8010) */ 365674e95caSDavid Howells unsigned short gpr_trigger; /* GPR containing trigger (activate) information (host) */ 366674e95caSDavid Howells unsigned short gpr_running; /* GPR containing info if PCM is running (FX8010) */ 367674e95caSDavid Howells unsigned char pad; /* reserved */ 368674e95caSDavid Howells unsigned char etram[32]; /* external TRAM address & data (one per channel) */ 369674e95caSDavid Howells unsigned int res2; /* reserved */ 370674e95caSDavid Howells }; 371674e95caSDavid Howells 372674e95caSDavid Howells #define SNDRV_EMU10K1_VERSION SNDRV_PROTOCOL_VERSION(1, 0, 1) 373674e95caSDavid Howells 374674e95caSDavid Howells #define SNDRV_EMU10K1_IOCTL_INFO _IOR ('H', 0x10, struct snd_emu10k1_fx8010_info) 375674e95caSDavid Howells #define SNDRV_EMU10K1_IOCTL_CODE_POKE _IOW ('H', 0x11, struct snd_emu10k1_fx8010_code) 376674e95caSDavid Howells #define SNDRV_EMU10K1_IOCTL_CODE_PEEK _IOWR('H', 0x12, struct snd_emu10k1_fx8010_code) 377674e95caSDavid Howells #define SNDRV_EMU10K1_IOCTL_TRAM_SETUP _IOW ('H', 0x20, int) 378674e95caSDavid Howells #define SNDRV_EMU10K1_IOCTL_TRAM_POKE _IOW ('H', 0x21, struct snd_emu10k1_fx8010_tram) 379674e95caSDavid Howells #define SNDRV_EMU10K1_IOCTL_TRAM_PEEK _IOWR('H', 0x22, struct snd_emu10k1_fx8010_tram) 380674e95caSDavid Howells #define SNDRV_EMU10K1_IOCTL_PCM_POKE _IOW ('H', 0x30, struct snd_emu10k1_fx8010_pcm_rec) 381674e95caSDavid Howells #define SNDRV_EMU10K1_IOCTL_PCM_PEEK _IOWR('H', 0x31, struct snd_emu10k1_fx8010_pcm_rec) 382674e95caSDavid Howells #define SNDRV_EMU10K1_IOCTL_PVERSION _IOR ('H', 0x40, int) 383674e95caSDavid Howells #define SNDRV_EMU10K1_IOCTL_STOP _IO ('H', 0x80) 384674e95caSDavid Howells #define SNDRV_EMU10K1_IOCTL_CONTINUE _IO ('H', 0x81) 385674e95caSDavid Howells #define SNDRV_EMU10K1_IOCTL_ZERO_TRAM_COUNTER _IO ('H', 0x82) 386674e95caSDavid Howells #define SNDRV_EMU10K1_IOCTL_SINGLE_STEP _IOW ('H', 0x83, int) 387674e95caSDavid Howells #define SNDRV_EMU10K1_IOCTL_DBG_READ _IOR ('H', 0x84, int) 388674e95caSDavid Howells 389674e95caSDavid Howells #endif /* _UAPI__SOUND_EMU10K1_H */ 390