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 #ifndef _UAPI__SOUND_EMU10K1_H 8674e95caSDavid Howells #define _UAPI__SOUND_EMU10K1_H 9674e95caSDavid Howells 10d06ed0c2STakashi Iwai #ifdef __linux__ 11d06ed0c2STakashi Iwai #include <linux/types.h> 12d06ed0c2STakashi Iwai #endif 13d06ed0c2STakashi Iwai 14674e95caSDavid Howells /* 15674e95caSDavid Howells * ---- FX8010 ---- 16674e95caSDavid Howells */ 17674e95caSDavid Howells 18674e95caSDavid Howells #define EMU10K1_FX8010_PCM_COUNT 8 19674e95caSDavid Howells 20a82d24f8SMikko Rapeli /* 21a82d24f8SMikko Rapeli * Following definition is copied from linux/types.h to support compiling 22a82d24f8SMikko Rapeli * this header file in userspace since they are not generally available for 23a82d24f8SMikko Rapeli * uapi headers. 24a82d24f8SMikko Rapeli */ 25a82d24f8SMikko Rapeli #define __EMU10K1_DECLARE_BITMAP(name,bits) \ 26a82d24f8SMikko Rapeli unsigned long name[(bits) / (sizeof(unsigned long) * 8)] 27a82d24f8SMikko Rapeli 28674e95caSDavid Howells /* instruction set */ 29674e95caSDavid Howells #define iMAC0 0x00 /* R = A + (X * Y >> 31) ; saturation */ 30674e95caSDavid Howells #define iMAC1 0x01 /* R = A + (-X * Y >> 31) ; saturation */ 31674e95caSDavid Howells #define iMAC2 0x02 /* R = A + (X * Y >> 31) ; wraparound */ 32674e95caSDavid Howells #define iMAC3 0x03 /* R = A + (-X * Y >> 31) ; wraparound */ 33674e95caSDavid Howells #define iMACINT0 0x04 /* R = A + X * Y ; saturation */ 34674e95caSDavid Howells #define iMACINT1 0x05 /* R = A + X * Y ; wraparound (31-bit) */ 35674e95caSDavid Howells #define iACC3 0x06 /* R = A + X + Y ; saturation */ 36674e95caSDavid Howells #define iMACMV 0x07 /* R = A, acc += X * Y >> 31 */ 37674e95caSDavid Howells #define iANDXOR 0x08 /* R = (A & X) ^ Y */ 38674e95caSDavid Howells #define iTSTNEG 0x09 /* R = (A >= Y) ? X : ~X */ 39674e95caSDavid Howells #define iLIMITGE 0x0a /* R = (A >= Y) ? X : Y */ 40674e95caSDavid Howells #define iLIMITLT 0x0b /* R = (A < Y) ? X : Y */ 41674e95caSDavid Howells #define iLOG 0x0c /* R = linear_data, A (log_data), X (max_exp), Y (format_word) */ 42674e95caSDavid Howells #define iEXP 0x0d /* R = log_data, A (linear_data), X (max_exp), Y (format_word) */ 43674e95caSDavid Howells #define iINTERP 0x0e /* R = A + (X * (Y - A) >> 31) ; saturation */ 44674e95caSDavid Howells #define iSKIP 0x0f /* R = A (cc_reg), X (count), Y (cc_test) */ 45674e95caSDavid Howells 46*2696d5a3SOswald Buddenhagen #define LOWORD_OPX_MASK 0x000ffc00 /* Instruction operand X */ 47*2696d5a3SOswald Buddenhagen #define LOWORD_OPY_MASK 0x000003ff /* Instruction operand Y */ 48*2696d5a3SOswald Buddenhagen #define HIWORD_OPCODE_MASK 0x00f00000 /* Instruction opcode */ 49*2696d5a3SOswald Buddenhagen #define HIWORD_RESULT_MASK 0x000ffc00 /* Instruction result */ 50*2696d5a3SOswald Buddenhagen #define HIWORD_OPA_MASK 0x000003ff /* Instruction operand A */ 51*2696d5a3SOswald Buddenhagen 52*2696d5a3SOswald Buddenhagen /* Audigy Soundcards have a different instruction format */ 53*2696d5a3SOswald Buddenhagen #define A_LOWORD_OPX_MASK 0x007ff000 54*2696d5a3SOswald Buddenhagen #define A_LOWORD_OPY_MASK 0x000007ff 55*2696d5a3SOswald Buddenhagen #define A_HIWORD_OPCODE_MASK 0x0f000000 56*2696d5a3SOswald Buddenhagen #define A_HIWORD_RESULT_MASK 0x007ff000 57*2696d5a3SOswald Buddenhagen #define A_HIWORD_OPA_MASK 0x000007ff 58*2696d5a3SOswald Buddenhagen 59674e95caSDavid Howells /* GPRs */ 60674e95caSDavid Howells #define FXBUS(x) (0x00 + (x)) /* x = 0x00 - 0x0f */ 61674e95caSDavid Howells #define EXTIN(x) (0x10 + (x)) /* x = 0x00 - 0x0f */ 62674e95caSDavid Howells #define EXTOUT(x) (0x20 + (x)) /* x = 0x00 - 0x0f physical outs -> FXWC low 16 bits */ 63674e95caSDavid Howells #define FXBUS2(x) (0x30 + (x)) /* x = 0x00 - 0x0f copies of fx buses for capture -> FXWC high 16 bits */ 64674e95caSDavid Howells /* NB: 0x31 and 0x32 are shared with Center/LFE on SB live 5.1 */ 65674e95caSDavid Howells 66*2696d5a3SOswald Buddenhagen #define A_FXBUS(x) (0x00 + (x)) /* x = 0x00 - 0x3f FX buses */ 67*2696d5a3SOswald Buddenhagen #define A_EXTIN(x) (0x40 + (x)) /* x = 0x00 - 0x0f physical ins */ 68*2696d5a3SOswald Buddenhagen #define A_P16VIN(x) (0x50 + (x)) /* x = 0x00 - 0x0f p16v ins (A2 only) "EMU32 inputs" */ 69*2696d5a3SOswald Buddenhagen #define A_EXTOUT(x) (0x60 + (x)) /* x = 0x00 - 0x1f physical outs -> A_FXWC1 0x79-7f unknown */ 70*2696d5a3SOswald Buddenhagen #define A_FXBUS2(x) (0x80 + (x)) /* x = 0x00 - 0x1f extra outs used for EFX capture -> A_FXWC2 */ 71*2696d5a3SOswald Buddenhagen #define A_EMU32OUTH(x) (0xa0 + (x)) /* x = 0x00 - 0x0f "EMU32_OUT_10 - _1F" */ 72*2696d5a3SOswald Buddenhagen #define A_EMU32OUTL(x) (0xb0 + (x)) /* x = 0x00 - 0x0f "EMU32_OUT_01 - _0F" */ 73*2696d5a3SOswald Buddenhagen #define A3_EMU32IN(x) (0x160 + (x)) /* x = 0x00 - 0x1f "EMU32_IN_00 - _1F" - Only when .device = 0x0008 */ 74*2696d5a3SOswald Buddenhagen #define A3_EMU32OUT(x) (0x1E0 + (x)) /* x = 0x00 - 0x1f "EMU32_OUT_00 - _1F" - Only when .device = 0x0008 */ 75*2696d5a3SOswald Buddenhagen 76674e95caSDavid Howells #define C_00000000 0x40 77674e95caSDavid Howells #define C_00000001 0x41 78674e95caSDavid Howells #define C_00000002 0x42 79674e95caSDavid Howells #define C_00000003 0x43 80674e95caSDavid Howells #define C_00000004 0x44 81674e95caSDavid Howells #define C_00000008 0x45 82674e95caSDavid Howells #define C_00000010 0x46 83674e95caSDavid Howells #define C_00000020 0x47 84674e95caSDavid Howells #define C_00000100 0x48 85674e95caSDavid Howells #define C_00010000 0x49 86674e95caSDavid Howells #define C_00080000 0x4a 87674e95caSDavid Howells #define C_10000000 0x4b 88674e95caSDavid Howells #define C_20000000 0x4c 89674e95caSDavid Howells #define C_40000000 0x4d 90674e95caSDavid Howells #define C_80000000 0x4e 91674e95caSDavid Howells #define C_7fffffff 0x4f 92674e95caSDavid Howells #define C_ffffffff 0x50 93674e95caSDavid Howells #define C_fffffffe 0x51 94674e95caSDavid Howells #define C_c0000000 0x52 95674e95caSDavid Howells #define C_4f1bbcdc 0x53 96674e95caSDavid Howells #define C_5a7ef9db 0x54 97674e95caSDavid Howells #define C_00100000 0x55 /* ?? */ 98674e95caSDavid Howells #define GPR_ACCU 0x56 /* ACCUM, accumulator */ 99674e95caSDavid Howells #define GPR_COND 0x57 /* CCR, condition register */ 100674e95caSDavid Howells #define GPR_NOISE0 0x58 /* noise source */ 101674e95caSDavid Howells #define GPR_NOISE1 0x59 /* noise source */ 102674e95caSDavid Howells #define GPR_IRQ 0x5a /* IRQ register */ 103674e95caSDavid Howells #define GPR_DBAC 0x5b /* TRAM Delay Base Address Counter */ 104*2696d5a3SOswald Buddenhagen 105*2696d5a3SOswald Buddenhagen /* Audigy constants */ 106*2696d5a3SOswald Buddenhagen #define A_C_00000000 0xc0 107*2696d5a3SOswald Buddenhagen #define A_C_00000001 0xc1 108*2696d5a3SOswald Buddenhagen #define A_C_00000002 0xc2 109*2696d5a3SOswald Buddenhagen #define A_C_00000003 0xc3 110*2696d5a3SOswald Buddenhagen #define A_C_00000004 0xc4 111*2696d5a3SOswald Buddenhagen #define A_C_00000008 0xc5 112*2696d5a3SOswald Buddenhagen #define A_C_00000010 0xc6 113*2696d5a3SOswald Buddenhagen #define A_C_00000020 0xc7 114*2696d5a3SOswald Buddenhagen #define A_C_00000100 0xc8 115*2696d5a3SOswald Buddenhagen #define A_C_00010000 0xc9 116*2696d5a3SOswald Buddenhagen #define A_C_00000800 0xca 117*2696d5a3SOswald Buddenhagen #define A_C_10000000 0xcb 118*2696d5a3SOswald Buddenhagen #define A_C_20000000 0xcc 119*2696d5a3SOswald Buddenhagen #define A_C_40000000 0xcd 120*2696d5a3SOswald Buddenhagen #define A_C_80000000 0xce 121*2696d5a3SOswald Buddenhagen #define A_C_7fffffff 0xcf 122*2696d5a3SOswald Buddenhagen #define A_C_ffffffff 0xd0 123*2696d5a3SOswald Buddenhagen #define A_C_fffffffe 0xd1 124*2696d5a3SOswald Buddenhagen #define A_C_c0000000 0xd2 125*2696d5a3SOswald Buddenhagen #define A_C_4f1bbcdc 0xd3 126*2696d5a3SOswald Buddenhagen #define A_C_5a7ef9db 0xd4 127*2696d5a3SOswald Buddenhagen #define A_C_00100000 0xd5 128*2696d5a3SOswald Buddenhagen #define A_GPR_ACCU 0xd6 /* ACCUM, accumulator */ 129*2696d5a3SOswald Buddenhagen #define A_GPR_COND 0xd7 /* CCR, condition register */ 130*2696d5a3SOswald Buddenhagen #define A_GPR_NOISE0 0xd8 /* noise source */ 131*2696d5a3SOswald Buddenhagen #define A_GPR_NOISE1 0xd9 /* noise source */ 132*2696d5a3SOswald Buddenhagen #define A_GPR_IRQ 0xda /* IRQ register */ 133*2696d5a3SOswald Buddenhagen #define A_GPR_DBAC 0xdb /* TRAM Delay Base Address Counter - internal */ 134*2696d5a3SOswald Buddenhagen #define A_GPR_DBACE 0xde /* TRAM Delay Base Address Counter - external */ 135*2696d5a3SOswald Buddenhagen 136*2696d5a3SOswald Buddenhagen /* Each FX general purpose register is 32 bits in length, all bits are used */ 137*2696d5a3SOswald Buddenhagen #define FXGPREGBASE 0x100 /* FX general purpose registers base */ 138*2696d5a3SOswald Buddenhagen #define A_FXGPREGBASE 0x400 /* Audigy GPRs, 0x400 to 0x5ff */ 139*2696d5a3SOswald Buddenhagen 140*2696d5a3SOswald Buddenhagen #define A_TANKMEMCTLREGBASE 0x100 /* Tank memory control registers base - only for Audigy */ 141*2696d5a3SOswald Buddenhagen #define A_TANKMEMCTLREG_MASK 0x1f /* only 5 bits used - only for Audigy */ 142*2696d5a3SOswald Buddenhagen 143*2696d5a3SOswald Buddenhagen /* Tank audio data is logarithmically compressed down to 16 bits before writing to TRAM and is */ 144*2696d5a3SOswald Buddenhagen /* decompressed back to 20 bits on a read. There are a total of 160 locations, the last 32 */ 145*2696d5a3SOswald Buddenhagen /* locations are for external TRAM. */ 146*2696d5a3SOswald Buddenhagen #define TANKMEMDATAREGBASE 0x200 /* Tank memory data registers base */ 147*2696d5a3SOswald Buddenhagen #define TANKMEMDATAREG_MASK 0x000fffff /* 20 bit tank audio data field */ 148*2696d5a3SOswald Buddenhagen 149*2696d5a3SOswald Buddenhagen /* Combined address field and memory opcode or flag field. 160 locations, last 32 are external */ 150*2696d5a3SOswald Buddenhagen #define TANKMEMADDRREGBASE 0x300 /* Tank memory address registers base */ 151*2696d5a3SOswald Buddenhagen #define TANKMEMADDRREG_ADDR_MASK 0x000fffff /* 20 bit tank address field */ 152*2696d5a3SOswald Buddenhagen #define TANKMEMADDRREG_CLEAR 0x00800000 /* Clear tank memory */ 153*2696d5a3SOswald Buddenhagen #define TANKMEMADDRREG_ALIGN 0x00400000 /* Align read or write relative to tank access */ 154*2696d5a3SOswald Buddenhagen #define TANKMEMADDRREG_WRITE 0x00200000 /* Write to tank memory */ 155*2696d5a3SOswald Buddenhagen #define TANKMEMADDRREG_READ 0x00100000 /* Read from tank memory */ 156*2696d5a3SOswald Buddenhagen 157674e95caSDavid Howells #define GPR(x) (FXGPREGBASE + (x)) /* free GPRs: x = 0x00 - 0xff */ 158674e95caSDavid Howells #define ITRAM_DATA(x) (TANKMEMDATAREGBASE + 0x00 + (x)) /* x = 0x00 - 0x7f */ 159674e95caSDavid Howells #define ETRAM_DATA(x) (TANKMEMDATAREGBASE + 0x80 + (x)) /* x = 0x00 - 0x1f */ 160674e95caSDavid Howells #define ITRAM_ADDR(x) (TANKMEMADDRREGBASE + 0x00 + (x)) /* x = 0x00 - 0x7f */ 161674e95caSDavid Howells #define ETRAM_ADDR(x) (TANKMEMADDRREGBASE + 0x80 + (x)) /* x = 0x00 - 0x1f */ 162674e95caSDavid Howells 163*2696d5a3SOswald Buddenhagen #define A_GPR(x) (A_FXGPREGBASE + (x)) 164674e95caSDavid Howells #define A_ITRAM_DATA(x) (TANKMEMDATAREGBASE + 0x00 + (x)) /* x = 0x00 - 0xbf */ 165674e95caSDavid Howells #define A_ETRAM_DATA(x) (TANKMEMDATAREGBASE + 0xc0 + (x)) /* x = 0x00 - 0x3f */ 166674e95caSDavid Howells #define A_ITRAM_ADDR(x) (TANKMEMADDRREGBASE + 0x00 + (x)) /* x = 0x00 - 0xbf */ 167674e95caSDavid Howells #define A_ETRAM_ADDR(x) (TANKMEMADDRREGBASE + 0xc0 + (x)) /* x = 0x00 - 0x3f */ 168674e95caSDavid Howells #define A_ITRAM_CTL(x) (A_TANKMEMCTLREGBASE + 0x00 + (x)) /* x = 0x00 - 0xbf */ 169674e95caSDavid Howells #define A_ETRAM_CTL(x) (A_TANKMEMCTLREGBASE + 0xc0 + (x)) /* x = 0x00 - 0x3f */ 170674e95caSDavid Howells 171674e95caSDavid Howells /* cc_reg constants */ 172674e95caSDavid Howells #define CC_REG_NORMALIZED C_00000001 173674e95caSDavid Howells #define CC_REG_BORROW C_00000002 174674e95caSDavid Howells #define CC_REG_MINUS C_00000004 175674e95caSDavid Howells #define CC_REG_ZERO C_00000008 176674e95caSDavid Howells #define CC_REG_SATURATE C_00000010 177674e95caSDavid Howells #define CC_REG_NONZERO C_00000100 178674e95caSDavid Howells 179*2696d5a3SOswald Buddenhagen #define A_CC_REG_NORMALIZED A_C_00000001 180*2696d5a3SOswald Buddenhagen #define A_CC_REG_BORROW A_C_00000002 181*2696d5a3SOswald Buddenhagen #define A_CC_REG_MINUS A_C_00000004 182*2696d5a3SOswald Buddenhagen #define A_CC_REG_ZERO A_C_00000008 183*2696d5a3SOswald Buddenhagen #define A_CC_REG_SATURATE A_C_00000010 184*2696d5a3SOswald Buddenhagen #define A_CC_REG_NONZERO A_C_00000100 185*2696d5a3SOswald Buddenhagen 186674e95caSDavid Howells /* FX buses */ 187a869057cSOswald Buddenhagen // These are arbitrary mappings; our DSP code simply expects 188a869057cSOswald Buddenhagen // the config files to route the channels this way. 189a869057cSOswald Buddenhagen // The numbers are documented in {audigy,sb-live}-mixer.rst. 190674e95caSDavid Howells #define FXBUS_PCM_LEFT 0x00 191674e95caSDavid Howells #define FXBUS_PCM_RIGHT 0x01 192674e95caSDavid Howells #define FXBUS_PCM_LEFT_REAR 0x02 193674e95caSDavid Howells #define FXBUS_PCM_RIGHT_REAR 0x03 194674e95caSDavid Howells #define FXBUS_MIDI_LEFT 0x04 195674e95caSDavid Howells #define FXBUS_MIDI_RIGHT 0x05 196674e95caSDavid Howells #define FXBUS_PCM_CENTER 0x06 197674e95caSDavid Howells #define FXBUS_PCM_LFE 0x07 198674e95caSDavid Howells #define FXBUS_PCM_LEFT_FRONT 0x08 199674e95caSDavid Howells #define FXBUS_PCM_RIGHT_FRONT 0x09 200674e95caSDavid Howells #define FXBUS_MIDI_REVERB 0x0c 201674e95caSDavid Howells #define FXBUS_MIDI_CHORUS 0x0d 202674e95caSDavid Howells #define FXBUS_PCM_LEFT_SIDE 0x0e 203674e95caSDavid Howells #define FXBUS_PCM_RIGHT_SIDE 0x0f 204674e95caSDavid Howells #define FXBUS_PT_LEFT 0x14 205674e95caSDavid Howells #define FXBUS_PT_RIGHT 0x15 206674e95caSDavid Howells 207674e95caSDavid Howells /* Inputs */ 208674e95caSDavid Howells #define EXTIN_AC97_L 0x00 /* AC'97 capture channel - left */ 209674e95caSDavid Howells #define EXTIN_AC97_R 0x01 /* AC'97 capture channel - right */ 210674e95caSDavid Howells #define EXTIN_SPDIF_CD_L 0x02 /* internal S/PDIF CD - onboard - left */ 211674e95caSDavid Howells #define EXTIN_SPDIF_CD_R 0x03 /* internal S/PDIF CD - onboard - right */ 212674e95caSDavid Howells #define EXTIN_ZOOM_L 0x04 /* Zoom Video I2S - left */ 213674e95caSDavid Howells #define EXTIN_ZOOM_R 0x05 /* Zoom Video I2S - right */ 214674e95caSDavid Howells #define EXTIN_TOSLINK_L 0x06 /* LiveDrive - TOSLink Optical - left */ 215674e95caSDavid Howells #define EXTIN_TOSLINK_R 0x07 /* LiveDrive - TOSLink Optical - right */ 216674e95caSDavid Howells #define EXTIN_LINE1_L 0x08 /* LiveDrive - Line/Mic 1 - left */ 217674e95caSDavid Howells #define EXTIN_LINE1_R 0x09 /* LiveDrive - Line/Mic 1 - right */ 218674e95caSDavid Howells #define EXTIN_COAX_SPDIF_L 0x0a /* LiveDrive - Coaxial S/PDIF - left */ 219674e95caSDavid Howells #define EXTIN_COAX_SPDIF_R 0x0b /* LiveDrive - Coaxial S/PDIF - right */ 220674e95caSDavid Howells #define EXTIN_LINE2_L 0x0c /* LiveDrive - Line/Mic 2 - left */ 221674e95caSDavid Howells #define EXTIN_LINE2_R 0x0d /* LiveDrive - Line/Mic 2 - right */ 222674e95caSDavid Howells 223674e95caSDavid Howells /* Outputs */ 224674e95caSDavid Howells #define EXTOUT_AC97_L 0x00 /* AC'97 playback channel - left */ 225674e95caSDavid Howells #define EXTOUT_AC97_R 0x01 /* AC'97 playback channel - right */ 226674e95caSDavid Howells #define EXTOUT_TOSLINK_L 0x02 /* LiveDrive - TOSLink Optical - left */ 227674e95caSDavid Howells #define EXTOUT_TOSLINK_R 0x03 /* LiveDrive - TOSLink Optical - right */ 228674e95caSDavid Howells #define EXTOUT_AC97_CENTER 0x04 /* SB Live 5.1 - center */ 229674e95caSDavid Howells #define EXTOUT_AC97_LFE 0x05 /* SB Live 5.1 - LFE */ 230674e95caSDavid Howells #define EXTOUT_HEADPHONE_L 0x06 /* LiveDrive - Headphone - left */ 231674e95caSDavid Howells #define EXTOUT_HEADPHONE_R 0x07 /* LiveDrive - Headphone - right */ 232674e95caSDavid Howells #define EXTOUT_REAR_L 0x08 /* Rear channel - left */ 233674e95caSDavid Howells #define EXTOUT_REAR_R 0x09 /* Rear channel - right */ 234674e95caSDavid Howells #define EXTOUT_ADC_CAP_L 0x0a /* ADC Capture buffer - left */ 235674e95caSDavid Howells #define EXTOUT_ADC_CAP_R 0x0b /* ADC Capture buffer - right */ 236674e95caSDavid Howells #define EXTOUT_MIC_CAP 0x0c /* MIC Capture buffer */ 237674e95caSDavid Howells #define EXTOUT_AC97_REAR_L 0x0d /* SB Live 5.1 (c) 2003 - Rear Left */ 238674e95caSDavid Howells #define EXTOUT_AC97_REAR_R 0x0e /* SB Live 5.1 (c) 2003 - Rear Right */ 239674e95caSDavid Howells #define EXTOUT_ACENTER 0x11 /* Analog Center */ 240674e95caSDavid Howells #define EXTOUT_ALFE 0x12 /* Analog LFE */ 241674e95caSDavid Howells 242674e95caSDavid Howells /* Audigy Inputs */ 243674e95caSDavid Howells #define A_EXTIN_AC97_L 0x00 /* AC'97 capture channel - left */ 244674e95caSDavid Howells #define A_EXTIN_AC97_R 0x01 /* AC'97 capture channel - right */ 245674e95caSDavid Howells #define A_EXTIN_SPDIF_CD_L 0x02 /* digital CD left */ 246674e95caSDavid Howells #define A_EXTIN_SPDIF_CD_R 0x03 /* digital CD left */ 247674e95caSDavid Howells #define A_EXTIN_OPT_SPDIF_L 0x04 /* audigy drive Optical SPDIF - left */ 248674e95caSDavid Howells #define A_EXTIN_OPT_SPDIF_R 0x05 /* right */ 249674e95caSDavid Howells #define A_EXTIN_LINE2_L 0x08 /* audigy drive line2/mic2 - left */ 250674e95caSDavid Howells #define A_EXTIN_LINE2_R 0x09 /* right */ 251674e95caSDavid Howells #define A_EXTIN_ADC_L 0x0a /* Philips ADC - left */ 252674e95caSDavid Howells #define A_EXTIN_ADC_R 0x0b /* right */ 253674e95caSDavid Howells #define A_EXTIN_AUX2_L 0x0c /* audigy drive aux2 - left */ 254674e95caSDavid Howells #define A_EXTIN_AUX2_R 0x0d /* - right */ 255674e95caSDavid Howells 256674e95caSDavid Howells /* Audigiy Outputs */ 257674e95caSDavid Howells #define A_EXTOUT_FRONT_L 0x00 /* digital front left */ 258674e95caSDavid Howells #define A_EXTOUT_FRONT_R 0x01 /* right */ 259674e95caSDavid Howells #define A_EXTOUT_CENTER 0x02 /* digital front center */ 260674e95caSDavid Howells #define A_EXTOUT_LFE 0x03 /* digital front lfe */ 261674e95caSDavid Howells #define A_EXTOUT_HEADPHONE_L 0x04 /* headphone audigy drive left */ 262674e95caSDavid Howells #define A_EXTOUT_HEADPHONE_R 0x05 /* right */ 263674e95caSDavid Howells #define A_EXTOUT_REAR_L 0x06 /* digital rear left */ 264674e95caSDavid Howells #define A_EXTOUT_REAR_R 0x07 /* right */ 265674e95caSDavid Howells #define A_EXTOUT_AFRONT_L 0x08 /* analog front left */ 266674e95caSDavid Howells #define A_EXTOUT_AFRONT_R 0x09 /* right */ 267674e95caSDavid Howells #define A_EXTOUT_ACENTER 0x0a /* analog center */ 268674e95caSDavid Howells #define A_EXTOUT_ALFE 0x0b /* analog LFE */ 269674e95caSDavid Howells #define A_EXTOUT_ASIDE_L 0x0c /* analog side left - Audigy 2 ZS */ 270674e95caSDavid Howells #define A_EXTOUT_ASIDE_R 0x0d /* right - Audigy 2 ZS */ 271674e95caSDavid Howells #define A_EXTOUT_AREAR_L 0x0e /* analog rear left */ 272674e95caSDavid Howells #define A_EXTOUT_AREAR_R 0x0f /* right */ 273674e95caSDavid Howells #define A_EXTOUT_AC97_L 0x10 /* AC97 left (front) */ 274674e95caSDavid Howells #define A_EXTOUT_AC97_R 0x11 /* right */ 275674e95caSDavid Howells #define A_EXTOUT_ADC_CAP_L 0x16 /* ADC capture buffer left */ 276674e95caSDavid Howells #define A_EXTOUT_ADC_CAP_R 0x17 /* right */ 277674e95caSDavid Howells #define A_EXTOUT_MIC_CAP 0x18 /* Mic capture buffer */ 278674e95caSDavid Howells 279*2696d5a3SOswald Buddenhagen /* Definitions for debug register. Note that these are for emu10k1 ONLY. */ 280674e95caSDavid Howells #define EMU10K1_DBG_ZC 0x80000000 /* zero tram counter */ 281674e95caSDavid Howells #define EMU10K1_DBG_SATURATION_OCCURED 0x02000000 /* saturation control */ 282674e95caSDavid Howells #define EMU10K1_DBG_SATURATION_ADDR 0x01ff0000 /* saturation address */ 283674e95caSDavid Howells #define EMU10K1_DBG_SINGLE_STEP 0x00008000 /* single step mode */ 284674e95caSDavid Howells #define EMU10K1_DBG_STEP 0x00004000 /* start single step */ 285674e95caSDavid Howells #define EMU10K1_DBG_CONDITION_CODE 0x00003e00 /* condition code */ 286674e95caSDavid Howells #define EMU10K1_DBG_SINGLE_STEP_ADDR 0x000001ff /* single step address */ 287674e95caSDavid Howells 288*2696d5a3SOswald Buddenhagen /* Definitions for emu10k2 debug register. */ 289*2696d5a3SOswald Buddenhagen #define A_DBG_ZC 0x40000000 /* zero tram counter */ 290*2696d5a3SOswald Buddenhagen #define A_DBG_SATURATION_OCCURED 0x20000000 291*2696d5a3SOswald Buddenhagen #define A_DBG_SATURATION_ADDR 0x0ffc0000 292*2696d5a3SOswald Buddenhagen #define A_DBG_SINGLE_STEP 0x00020000 /* Set to zero to start dsp */ 293*2696d5a3SOswald Buddenhagen #define A_DBG_STEP 0x00010000 294*2696d5a3SOswald Buddenhagen #define A_DBG_CONDITION_CODE 0x0000f800 295*2696d5a3SOswald Buddenhagen #define A_DBG_STEP_ADDR 0x000003ff 296674e95caSDavid Howells 297674e95caSDavid Howells struct snd_emu10k1_fx8010_info { 298674e95caSDavid Howells unsigned int internal_tram_size; /* in samples */ 299674e95caSDavid Howells unsigned int external_tram_size; /* in samples */ 300674e95caSDavid Howells char fxbus_names[16][32]; /* names of FXBUSes */ 301674e95caSDavid Howells char extin_names[16][32]; /* names of external inputs */ 302674e95caSDavid Howells char extout_names[32][32]; /* names of external outputs */ 303674e95caSDavid Howells unsigned int gpr_controls; /* count of GPR controls */ 304674e95caSDavid Howells }; 305674e95caSDavid Howells 306674e95caSDavid Howells #define EMU10K1_GPR_TRANSLATION_NONE 0 307674e95caSDavid Howells #define EMU10K1_GPR_TRANSLATION_TABLE100 1 308674e95caSDavid Howells #define EMU10K1_GPR_TRANSLATION_BASS 2 309674e95caSDavid Howells #define EMU10K1_GPR_TRANSLATION_TREBLE 3 310674e95caSDavid Howells #define EMU10K1_GPR_TRANSLATION_ONOFF 4 311674e95caSDavid Howells #define EMU10K1_GPR_TRANSLATION_NEGATE 5 3122e468867STakashi Iwai #define EMU10K1_GPR_TRANSLATION_NEG_TABLE100 6 3132e468867STakashi Iwai 3142e468867STakashi Iwai enum emu10k1_ctl_elem_iface { 3152e468867STakashi Iwai EMU10K1_CTL_ELEM_IFACE_MIXER = 2, /* virtual mixer device */ 3162e468867STakashi Iwai EMU10K1_CTL_ELEM_IFACE_PCM = 3, /* PCM device */ 3172e468867STakashi Iwai }; 3182e468867STakashi Iwai 3192e468867STakashi Iwai struct emu10k1_ctl_elem_id { 3202e468867STakashi Iwai unsigned int pad; /* don't use */ 3212e468867STakashi Iwai int iface; /* interface identifier */ 3222e468867STakashi Iwai unsigned int device; /* device/client number */ 3232e468867STakashi Iwai unsigned int subdevice; /* subdevice (substream) number */ 3242e468867STakashi Iwai unsigned char name[44]; /* ASCII name of item */ 3252e468867STakashi Iwai unsigned int index; /* index of item */ 326674e95caSDavid Howells }; 3272e468867STakashi Iwai 328674e95caSDavid Howells struct snd_emu10k1_fx8010_control_gpr { 329674e95caSDavid Howells struct emu10k1_ctl_elem_id id; /* full control ID definition */ 330674e95caSDavid Howells unsigned int vcount; /* visible count */ 331674e95caSDavid Howells unsigned int count; /* count of GPR (1..16) */ 332674e95caSDavid Howells unsigned short gpr[32]; /* GPR number(s) */ 333674e95caSDavid Howells int value[32]; /* initial values */ 334674e95caSDavid Howells int min; /* minimum range */ 335674e95caSDavid Howells int max; /* maximum range */ 336674e95caSDavid Howells unsigned int translation; /* translation type (EMU10K1_GPR_TRANSLATION*) */ 337674e95caSDavid Howells const unsigned int *tlv; 338674e95caSDavid Howells }; 339674e95caSDavid Howells 3402e468867STakashi Iwai /* old ABI without TLV support */ 341674e95caSDavid Howells struct snd_emu10k1_fx8010_control_old_gpr { 342674e95caSDavid Howells struct emu10k1_ctl_elem_id id; 343674e95caSDavid Howells unsigned int vcount; 344674e95caSDavid Howells unsigned int count; 345674e95caSDavid Howells unsigned short gpr[32]; 346674e95caSDavid Howells unsigned int value[32]; 347674e95caSDavid Howells unsigned int min; 348674e95caSDavid Howells unsigned int max; 349674e95caSDavid Howells unsigned int translation; 350674e95caSDavid Howells }; 351674e95caSDavid Howells 352674e95caSDavid Howells struct snd_emu10k1_fx8010_code { 353a82d24f8SMikko Rapeli char name[128]; 3542e468867STakashi Iwai 355674e95caSDavid Howells __EMU10K1_DECLARE_BITMAP(gpr_valid, 0x200); /* bitmask of valid initializers */ 356674e95caSDavid Howells __u32 *gpr_map; /* initializers */ 3572e468867STakashi Iwai 358674e95caSDavid Howells unsigned int gpr_add_control_count; /* count of GPR controls to add/replace */ 359674e95caSDavid Howells struct snd_emu10k1_fx8010_control_gpr *gpr_add_controls; /* GPR controls to add/replace */ 3602e468867STakashi Iwai 361674e95caSDavid Howells unsigned int gpr_del_control_count; /* count of GPR controls to remove */ 362674e95caSDavid Howells struct emu10k1_ctl_elem_id *gpr_del_controls; /* IDs of GPR controls to remove */ 363674e95caSDavid Howells 3642e468867STakashi Iwai unsigned int gpr_list_control_count; /* count of GPR controls to list */ 365674e95caSDavid Howells unsigned int gpr_list_control_total; /* total count of GPR controls */ 366a82d24f8SMikko Rapeli struct snd_emu10k1_fx8010_control_gpr *gpr_list_controls; /* listed GPR controls */ 3672e468867STakashi Iwai 3682e468867STakashi Iwai __EMU10K1_DECLARE_BITMAP(tram_valid, 0x100); /* bitmask of valid initializers */ 369674e95caSDavid Howells __u32 *tram_data_map; /* data initializers */ 370a82d24f8SMikko Rapeli __u32 *tram_addr_map; /* map initializers */ 3712e468867STakashi Iwai 372674e95caSDavid Howells __EMU10K1_DECLARE_BITMAP(code_valid, 1024); /* bitmask of valid instructions */ 373674e95caSDavid Howells __u32 *code; /* one instruction - 64 bits */ 374674e95caSDavid Howells }; 375674e95caSDavid Howells 376674e95caSDavid Howells struct snd_emu10k1_fx8010_tram { 377674e95caSDavid Howells unsigned int address; /* 31.bit == 1 -> external TRAM */ 378674e95caSDavid Howells unsigned int size; /* size in samples (4 bytes) */ 379674e95caSDavid Howells unsigned int *samples; /* pointer to samples (20-bit) */ 380674e95caSDavid Howells /* NULL->clear memory */ 381674e95caSDavid Howells }; 382674e95caSDavid Howells 383674e95caSDavid Howells struct snd_emu10k1_fx8010_pcm_rec { 384674e95caSDavid Howells unsigned int substream; /* substream number */ 385674e95caSDavid Howells unsigned int res1; /* reserved */ 386674e95caSDavid Howells unsigned int channels; /* 16-bit channels count, zero = remove this substream */ 387674e95caSDavid Howells unsigned int tram_start; /* ring buffer position in TRAM (in samples) */ 388674e95caSDavid Howells unsigned int buffer_size; /* count of buffered samples */ 389674e95caSDavid Howells unsigned short gpr_size; /* GPR containing size of ringbuffer in samples (host) */ 390674e95caSDavid Howells unsigned short gpr_ptr; /* GPR containing current pointer in the ring buffer (host = reset, FX8010) */ 391674e95caSDavid Howells unsigned short gpr_count; /* GPR containing count of samples between two interrupts (host) */ 392674e95caSDavid Howells unsigned short gpr_tmpcount; /* GPR containing current count of samples to interrupt (host = set, FX8010) */ 393674e95caSDavid Howells unsigned short gpr_trigger; /* GPR containing trigger (activate) information (host) */ 394674e95caSDavid Howells unsigned short gpr_running; /* GPR containing info if PCM is running (FX8010) */ 395674e95caSDavid Howells unsigned char pad; /* reserved */ 396674e95caSDavid Howells unsigned char etram[32]; /* external TRAM address & data (one per channel) */ 397674e95caSDavid Howells unsigned int res2; /* reserved */ 398674e95caSDavid Howells }; 399674e95caSDavid Howells 400674e95caSDavid Howells #define SNDRV_EMU10K1_VERSION SNDRV_PROTOCOL_VERSION(1, 0, 1) 401674e95caSDavid Howells 402674e95caSDavid Howells #define SNDRV_EMU10K1_IOCTL_INFO _IOR ('H', 0x10, struct snd_emu10k1_fx8010_info) 403674e95caSDavid Howells #define SNDRV_EMU10K1_IOCTL_CODE_POKE _IOW ('H', 0x11, struct snd_emu10k1_fx8010_code) 404674e95caSDavid Howells #define SNDRV_EMU10K1_IOCTL_CODE_PEEK _IOWR('H', 0x12, struct snd_emu10k1_fx8010_code) 405674e95caSDavid Howells #define SNDRV_EMU10K1_IOCTL_TRAM_SETUP _IOW ('H', 0x20, int) 406674e95caSDavid Howells #define SNDRV_EMU10K1_IOCTL_TRAM_POKE _IOW ('H', 0x21, struct snd_emu10k1_fx8010_tram) 407674e95caSDavid Howells #define SNDRV_EMU10K1_IOCTL_TRAM_PEEK _IOWR('H', 0x22, struct snd_emu10k1_fx8010_tram) 408674e95caSDavid Howells #define SNDRV_EMU10K1_IOCTL_PCM_POKE _IOW ('H', 0x30, struct snd_emu10k1_fx8010_pcm_rec) 409674e95caSDavid Howells #define SNDRV_EMU10K1_IOCTL_PCM_PEEK _IOWR('H', 0x31, struct snd_emu10k1_fx8010_pcm_rec) 410674e95caSDavid Howells #define SNDRV_EMU10K1_IOCTL_PVERSION _IOR ('H', 0x40, int) 411674e95caSDavid Howells #define SNDRV_EMU10K1_IOCTL_STOP _IO ('H', 0x80) 412674e95caSDavid Howells #define SNDRV_EMU10K1_IOCTL_CONTINUE _IO ('H', 0x81) 413674e95caSDavid Howells #define SNDRV_EMU10K1_IOCTL_ZERO_TRAM_COUNTER _IO ('H', 0x82) 414674e95caSDavid Howells #define SNDRV_EMU10K1_IOCTL_SINGLE_STEP _IOW ('H', 0x83, int) 415674e95caSDavid Howells #define SNDRV_EMU10K1_IOCTL_DBG_READ _IOR ('H', 0x84, int) 416 417 #endif /* _UAPI__SOUND_EMU10K1_H */ 418