Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   1) // SPDX-License-Identifier: GPL-2.0-or-later
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   3)  *  Copyright (c) by Jaroslav Kysela <perex@perex.cz>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   4)  *                   Creative Labs, Inc.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   5)  *  Routines for control of EMU10K1 chips / proc interface routines
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   6)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   7)  *  Copyright (c) by James Courtier-Dutton <James@superbug.co.uk>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   8)  *  	Added EMU 1010 support.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   9)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  10)  *  BUGS:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  11)  *    --
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  12)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  13)  *  TODO:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  14)  *    --
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  15)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  16) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  17) #include <linux/slab.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  18) #include <linux/init.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  19) #include <sound/core.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  20) #include <sound/emu10k1.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  21) #include "p16v.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  22) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  23) static void snd_emu10k1_proc_spdif_status(struct snd_emu10k1 * emu,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  24) 					  struct snd_info_buffer *buffer,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  25) 					  char *title,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  26) 					  int status_reg,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  27) 					  int rate_reg)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  28) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  29) 	static const char * const clkaccy[4] = { "1000ppm", "50ppm", "variable", "unknown" };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  30) 	static const int samplerate[16] = { 44100, 1, 48000, 32000, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  31) 	static const char * const channel[16] = { "unspec", "left", "right", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15" };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  32) 	static const char * const emphasis[8] = { "none", "50/15 usec 2 channel", "2", "3", "4", "5", "6", "7" };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  33) 	unsigned int status, rate = 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  34) 	
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  35) 	status = snd_emu10k1_ptr_read(emu, status_reg, 0);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  36) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  37) 	snd_iprintf(buffer, "\n%s\n", title);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  38) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  39) 	if (status != 0xffffffff) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  40) 		snd_iprintf(buffer, "Professional Mode     : %s\n", (status & SPCS_PROFESSIONAL) ? "yes" : "no");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  41) 		snd_iprintf(buffer, "Not Audio Data        : %s\n", (status & SPCS_NOTAUDIODATA) ? "yes" : "no");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  42) 		snd_iprintf(buffer, "Copyright             : %s\n", (status & SPCS_COPYRIGHT) ? "yes" : "no");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  43) 		snd_iprintf(buffer, "Emphasis              : %s\n", emphasis[(status & SPCS_EMPHASISMASK) >> 3]);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  44) 		snd_iprintf(buffer, "Mode                  : %i\n", (status & SPCS_MODEMASK) >> 6);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  45) 		snd_iprintf(buffer, "Category Code         : 0x%x\n", (status & SPCS_CATEGORYCODEMASK) >> 8);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  46) 		snd_iprintf(buffer, "Generation Status     : %s\n", status & SPCS_GENERATIONSTATUS ? "original" : "copy");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  47) 		snd_iprintf(buffer, "Source Mask           : %i\n", (status & SPCS_SOURCENUMMASK) >> 16);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  48) 		snd_iprintf(buffer, "Channel Number        : %s\n", channel[(status & SPCS_CHANNELNUMMASK) >> 20]);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  49) 		snd_iprintf(buffer, "Sample Rate           : %iHz\n", samplerate[(status & SPCS_SAMPLERATEMASK) >> 24]);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  50) 		snd_iprintf(buffer, "Clock Accuracy        : %s\n", clkaccy[(status & SPCS_CLKACCYMASK) >> 28]);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  51) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  52) 		if (rate_reg > 0) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  53) 			rate = snd_emu10k1_ptr_read(emu, rate_reg, 0);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  54) 			snd_iprintf(buffer, "S/PDIF Valid          : %s\n", rate & SRCS_SPDIFVALID ? "on" : "off");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  55) 			snd_iprintf(buffer, "S/PDIF Locked         : %s\n", rate & SRCS_SPDIFLOCKED ? "on" : "off");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  56) 			snd_iprintf(buffer, "Rate Locked           : %s\n", rate & SRCS_RATELOCKED ? "on" : "off");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  57) 			/* From ((Rate * 48000 ) / 262144); */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  58) 			snd_iprintf(buffer, "Estimated Sample Rate : %d\n", ((rate & 0xFFFFF ) * 375) >> 11); 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  59) 		}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  60) 	} else {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  61) 		snd_iprintf(buffer, "No signal detected.\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  62) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  63) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  64) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  65) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  66) static void snd_emu10k1_proc_read(struct snd_info_entry *entry, 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  67) 				  struct snd_info_buffer *buffer)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  68) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  69) 	/* FIXME - output names are in emufx.c too */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  70) 	static const char * const creative_outs[32] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  71) 		/* 00 */ "AC97 Left",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  72) 		/* 01 */ "AC97 Right",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  73) 		/* 02 */ "Optical IEC958 Left",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  74) 		/* 03 */ "Optical IEC958 Right",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  75) 		/* 04 */ "Center",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  76) 		/* 05 */ "LFE",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  77) 		/* 06 */ "Headphone Left",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  78) 		/* 07 */ "Headphone Right",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  79) 		/* 08 */ "Surround Left",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  80) 		/* 09 */ "Surround Right",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  81) 		/* 10 */ "PCM Capture Left",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  82) 		/* 11 */ "PCM Capture Right",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  83) 		/* 12 */ "MIC Capture",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  84) 		/* 13 */ "AC97 Surround Left",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  85) 		/* 14 */ "AC97 Surround Right",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  86) 		/* 15 */ "???",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  87) 		/* 16 */ "???",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  88) 		/* 17 */ "Analog Center",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  89) 		/* 18 */ "Analog LFE",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  90) 		/* 19 */ "???",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  91) 		/* 20 */ "???",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  92) 		/* 21 */ "???",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  93) 		/* 22 */ "???",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  94) 		/* 23 */ "???",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  95) 		/* 24 */ "???",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  96) 		/* 25 */ "???",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  97) 		/* 26 */ "???",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  98) 		/* 27 */ "???",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  99) 		/* 28 */ "???",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) 		/* 29 */ "???",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) 		/* 30 */ "???",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) 		/* 31 */ "???"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) 	};
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) 	static const char * const audigy_outs[64] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) 		/* 00 */ "Digital Front Left",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) 		/* 01 */ "Digital Front Right",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) 		/* 02 */ "Digital Center",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) 		/* 03 */ "Digital LEF",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) 		/* 04 */ "Headphone Left",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) 		/* 05 */ "Headphone Right",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) 		/* 06 */ "Digital Rear Left",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) 		/* 07 */ "Digital Rear Right",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) 		/* 08 */ "Front Left",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) 		/* 09 */ "Front Right",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) 		/* 10 */ "Center",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) 		/* 11 */ "LFE",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) 		/* 12 */ "???",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) 		/* 13 */ "???",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) 		/* 14 */ "Rear Left",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) 		/* 15 */ "Rear Right",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) 		/* 16 */ "AC97 Front Left",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) 		/* 17 */ "AC97 Front Right",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) 		/* 18 */ "ADC Capture Left",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) 		/* 19 */ "ADC Capture Right",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) 		/* 20 */ "???",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) 		/* 21 */ "???",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) 		/* 22 */ "???",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) 		/* 23 */ "???",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) 		/* 24 */ "???",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) 		/* 25 */ "???",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) 		/* 26 */ "???",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) 		/* 27 */ "???",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) 		/* 28 */ "???",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) 		/* 29 */ "???",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) 		/* 30 */ "???",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) 		/* 31 */ "???",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) 		/* 32 */ "FXBUS2_0",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) 		/* 33 */ "FXBUS2_1",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) 		/* 34 */ "FXBUS2_2",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) 		/* 35 */ "FXBUS2_3",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) 		/* 36 */ "FXBUS2_4",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) 		/* 37 */ "FXBUS2_5",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) 		/* 38 */ "FXBUS2_6",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) 		/* 39 */ "FXBUS2_7",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) 		/* 40 */ "FXBUS2_8",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) 		/* 41 */ "FXBUS2_9",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) 		/* 42 */ "FXBUS2_10",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) 		/* 43 */ "FXBUS2_11",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) 		/* 44 */ "FXBUS2_12",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) 		/* 45 */ "FXBUS2_13",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) 		/* 46 */ "FXBUS2_14",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) 		/* 47 */ "FXBUS2_15",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) 		/* 48 */ "FXBUS2_16",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) 		/* 49 */ "FXBUS2_17",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) 		/* 50 */ "FXBUS2_18",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) 		/* 51 */ "FXBUS2_19",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) 		/* 52 */ "FXBUS2_20",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) 		/* 53 */ "FXBUS2_21",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) 		/* 54 */ "FXBUS2_22",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) 		/* 55 */ "FXBUS2_23",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) 		/* 56 */ "FXBUS2_24",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) 		/* 57 */ "FXBUS2_25",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) 		/* 58 */ "FXBUS2_26",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) 		/* 59 */ "FXBUS2_27",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) 		/* 60 */ "FXBUS2_28",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) 		/* 61 */ "FXBUS2_29",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) 		/* 62 */ "FXBUS2_30",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) 		/* 63 */ "FXBUS2_31"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) 	};
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) 	struct snd_emu10k1 *emu = entry->private_data;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) 	unsigned int val, val1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) 	int nefx = emu->audigy ? 64 : 32;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) 	const char * const *outputs = emu->audigy ? audigy_outs : creative_outs;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) 	int idx;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) 	
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) 	snd_iprintf(buffer, "EMU10K1\n\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) 	snd_iprintf(buffer, "Card                  : %s\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) 		    emu->audigy ? "Audigy" : (emu->card_capabilities->ecard ? "EMU APS" : "Creative"));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) 	snd_iprintf(buffer, "Internal TRAM (words) : 0x%x\n", emu->fx8010.itram_size);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) 	snd_iprintf(buffer, "External TRAM (words) : 0x%x\n", (int)emu->fx8010.etram_pages.bytes / 2);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) 	snd_iprintf(buffer, "\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) 	snd_iprintf(buffer, "Effect Send Routing   :\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) 	for (idx = 0; idx < NUM_G; idx++) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) 		val = emu->audigy ?
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) 			snd_emu10k1_ptr_read(emu, A_FXRT1, idx) :
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) 			snd_emu10k1_ptr_read(emu, FXRT, idx);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) 		val1 = emu->audigy ?
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) 			snd_emu10k1_ptr_read(emu, A_FXRT2, idx) :
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) 			0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) 		if (emu->audigy) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) 			snd_iprintf(buffer, "Ch%i: A=%i, B=%i, C=%i, D=%i, ",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) 				idx,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) 				val & 0x3f,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) 				(val >> 8) & 0x3f,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) 				(val >> 16) & 0x3f,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) 				(val >> 24) & 0x3f);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) 			snd_iprintf(buffer, "E=%i, F=%i, G=%i, H=%i\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) 				val1 & 0x3f,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) 				(val1 >> 8) & 0x3f,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) 				(val1 >> 16) & 0x3f,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) 				(val1 >> 24) & 0x3f);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) 		} else {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) 			snd_iprintf(buffer, "Ch%i: A=%i, B=%i, C=%i, D=%i\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) 				idx,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) 				(val >> 16) & 0x0f,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) 				(val >> 20) & 0x0f,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) 				(val >> 24) & 0x0f,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) 				(val >> 28) & 0x0f);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) 		}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) 	snd_iprintf(buffer, "\nCaptured FX Outputs   :\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) 	for (idx = 0; idx < nefx; idx++) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) 		if (emu->efx_voices_mask[idx/32] & (1 << (idx%32)))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) 			snd_iprintf(buffer, "  Output %02i [%s]\n", idx, outputs[idx]);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) 	snd_iprintf(buffer, "\nAll FX Outputs        :\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) 	for (idx = 0; idx < (emu->audigy ? 64 : 32); idx++)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) 		snd_iprintf(buffer, "  Output %02i [%s]\n", idx, outputs[idx]);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) static void snd_emu10k1_proc_spdif_read(struct snd_info_entry *entry, 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224) 				  struct snd_info_buffer *buffer)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) 	struct snd_emu10k1 *emu = entry->private_data;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227) 	u32 value;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228) 	u32 value2;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229) 	u32 rate;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231) 	if (emu->card_capabilities->emu_model) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232) 		snd_emu1010_fpga_read(emu, 0x38, &value);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233) 		if ((value & 0x1) == 0) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234) 			snd_emu1010_fpga_read(emu, 0x2a, &value);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 235) 			snd_emu1010_fpga_read(emu, 0x2b, &value2);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 236) 			rate = 0x1770000 / (((value << 5) | value2)+1);	
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 237) 			snd_iprintf(buffer, "ADAT Locked : %u\n", rate);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 238) 		} else {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 239) 			snd_iprintf(buffer, "ADAT Unlocked\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 240) 		}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 241) 		snd_emu1010_fpga_read(emu, 0x20, &value);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 242) 		if ((value & 0x4) == 0) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 243) 			snd_emu1010_fpga_read(emu, 0x28, &value);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 244) 			snd_emu1010_fpga_read(emu, 0x29, &value2);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 245) 			rate = 0x1770000 / (((value << 5) | value2)+1);	
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 246) 			snd_iprintf(buffer, "SPDIF Locked : %d\n", rate);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 247) 		} else {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 248) 			snd_iprintf(buffer, "SPDIF Unlocked\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 249) 		}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 250) 	} else {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 251) 		snd_emu10k1_proc_spdif_status(emu, buffer, "CD-ROM S/PDIF In", CDCS, CDSRCS);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 252) 		snd_emu10k1_proc_spdif_status(emu, buffer, "Optical or Coax S/PDIF In", GPSCS, GPSRCS);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 253) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 254) #if 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 255) 	val = snd_emu10k1_ptr_read(emu, ZVSRCS, 0);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 256) 	snd_iprintf(buffer, "\nZoomed Video\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 257) 	snd_iprintf(buffer, "Rate Locked           : %s\n", val & SRCS_RATELOCKED ? "on" : "off");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 258) 	snd_iprintf(buffer, "Estimated Sample Rate : 0x%x\n", val & SRCS_ESTSAMPLERATE);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 259) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 260) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 261) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 262) static void snd_emu10k1_proc_rates_read(struct snd_info_entry *entry, 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 263) 				  struct snd_info_buffer *buffer)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 264) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 265) 	static const int samplerate[8] = { 44100, 48000, 96000, 192000, 4, 5, 6, 7 };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 266) 	struct snd_emu10k1 *emu = entry->private_data;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 267) 	unsigned int val, tmp, n;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 268) 	val = snd_emu10k1_ptr20_read(emu, CAPTURE_RATE_STATUS, 0);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 269) 	for (n = 0; n < 4; n++) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 270) 		tmp = val >> (16 + (n*4));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 271) 		if (tmp & 0x8) snd_iprintf(buffer, "Channel %d: Rate=%d\n", n, samplerate[tmp & 0x7]);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 272) 		else snd_iprintf(buffer, "Channel %d: No input\n", n);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 273) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 274) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 275) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 276) static void snd_emu10k1_proc_acode_read(struct snd_info_entry *entry, 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 277) 				        struct snd_info_buffer *buffer)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 278) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 279) 	u32 pc;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 280) 	struct snd_emu10k1 *emu = entry->private_data;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 281) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 282) 	snd_iprintf(buffer, "FX8010 Instruction List '%s'\n", emu->fx8010.name);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 283) 	snd_iprintf(buffer, "  Code dump      :\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 284) 	for (pc = 0; pc < (emu->audigy ? 1024 : 512); pc++) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 285) 		u32 low, high;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 286) 			
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 287) 		low = snd_emu10k1_efx_read(emu, pc * 2);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 288) 		high = snd_emu10k1_efx_read(emu, pc * 2 + 1);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 289) 		if (emu->audigy)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 290) 			snd_iprintf(buffer, "    OP(0x%02x, 0x%03x, 0x%03x, 0x%03x, 0x%03x) /* 0x%04x: 0x%08x%08x */\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 291) 				    (high >> 24) & 0x0f,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 292) 				    (high >> 12) & 0x7ff,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 293) 				    (high >> 0) & 0x7ff,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 294) 				    (low >> 12) & 0x7ff,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 295) 				    (low >> 0) & 0x7ff,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 296) 				    pc,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 297) 				    high, low);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 298) 		else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 299) 			snd_iprintf(buffer, "    OP(0x%02x, 0x%03x, 0x%03x, 0x%03x, 0x%03x) /* 0x%04x: 0x%08x%08x */\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 300) 				    (high >> 20) & 0x0f,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 301) 				    (high >> 10) & 0x3ff,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 302) 				    (high >> 0) & 0x3ff,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 303) 				    (low >> 10) & 0x3ff,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 304) 				    (low >> 0) & 0x3ff,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 305) 				    pc,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 306) 				    high, low);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 307) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 308) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 309) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 310) #define TOTAL_SIZE_GPR		(0x100*4)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 311) #define A_TOTAL_SIZE_GPR	(0x200*4)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 312) #define TOTAL_SIZE_TANKMEM_DATA	(0xa0*4)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 313) #define TOTAL_SIZE_TANKMEM_ADDR (0xa0*4)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 314) #define A_TOTAL_SIZE_TANKMEM_DATA (0x100*4)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 315) #define A_TOTAL_SIZE_TANKMEM_ADDR (0x100*4)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 316) #define TOTAL_SIZE_CODE		(0x200*8)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 317) #define A_TOTAL_SIZE_CODE	(0x400*8)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 318) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 319) static ssize_t snd_emu10k1_fx8010_read(struct snd_info_entry *entry,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 320) 				       void *file_private_data,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 321) 				       struct file *file, char __user *buf,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 322) 				       size_t count, loff_t pos)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 323) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 324) 	struct snd_emu10k1 *emu = entry->private_data;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 325) 	unsigned int offset;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 326) 	int tram_addr = 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 327) 	unsigned int *tmp;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 328) 	long res;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 329) 	unsigned int idx;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 330) 	
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 331) 	if (!strcmp(entry->name, "fx8010_tram_addr")) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 332) 		offset = TANKMEMADDRREGBASE;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 333) 		tram_addr = 1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 334) 	} else if (!strcmp(entry->name, "fx8010_tram_data")) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 335) 		offset = TANKMEMDATAREGBASE;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 336) 	} else if (!strcmp(entry->name, "fx8010_code")) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 337) 		offset = emu->audigy ? A_MICROCODEBASE : MICROCODEBASE;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 338) 	} else {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 339) 		offset = emu->audigy ? A_FXGPREGBASE : FXGPREGBASE;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 340) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 341) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 342) 	tmp = kmalloc(count + 8, GFP_KERNEL);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 343) 	if (!tmp)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 344) 		return -ENOMEM;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 345) 	for (idx = 0; idx < ((pos & 3) + count + 3) >> 2; idx++) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 346) 		unsigned int val;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 347) 		val = snd_emu10k1_ptr_read(emu, offset + idx + (pos >> 2), 0);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 348) 		if (tram_addr && emu->audigy) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 349) 			val >>= 11;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 350) 			val |= snd_emu10k1_ptr_read(emu, 0x100 + idx + (pos >> 2), 0) << 20;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 351) 		}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 352) 		tmp[idx] = val;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 353) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 354) 	if (copy_to_user(buf, ((char *)tmp) + (pos & 3), count))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 355) 		res = -EFAULT;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 356) 	else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 357) 		res = count;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 358) 	kfree(tmp);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 359) 	return res;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 360) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 361) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 362) static void snd_emu10k1_proc_voices_read(struct snd_info_entry *entry, 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 363) 				  struct snd_info_buffer *buffer)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 364) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 365) 	struct snd_emu10k1 *emu = entry->private_data;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 366) 	struct snd_emu10k1_voice *voice;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 367) 	int idx;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 368) 	
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 369) 	snd_iprintf(buffer, "ch\tuse\tpcm\tefx\tsynth\tmidi\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 370) 	for (idx = 0; idx < NUM_G; idx++) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 371) 		voice = &emu->voices[idx];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 372) 		snd_iprintf(buffer, "%i\t%i\t%i\t%i\t%i\t%i\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 373) 			idx,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 374) 			voice->use,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 375) 			voice->pcm,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 376) 			voice->efx,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 377) 			voice->synth,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 378) 			voice->midi);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 379) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 380) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 381) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 382) #ifdef CONFIG_SND_DEBUG
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 383) static void snd_emu_proc_emu1010_reg_read(struct snd_info_entry *entry,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 384) 				     struct snd_info_buffer *buffer)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 385) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 386) 	struct snd_emu10k1 *emu = entry->private_data;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 387) 	u32 value;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 388) 	int i;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 389) 	snd_iprintf(buffer, "EMU1010 Registers:\n\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 390) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 391) 	for(i = 0; i < 0x40; i+=1) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 392) 		snd_emu1010_fpga_read(emu, i, &value);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 393) 		snd_iprintf(buffer, "%02X: %08X, %02X\n", i, value, (value >> 8) & 0x7f);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 394) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 395) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 396) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 397) static void snd_emu_proc_io_reg_read(struct snd_info_entry *entry,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 398) 				     struct snd_info_buffer *buffer)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 399) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 400) 	struct snd_emu10k1 *emu = entry->private_data;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 401) 	unsigned long value;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 402) 	unsigned long flags;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 403) 	int i;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 404) 	snd_iprintf(buffer, "IO Registers:\n\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 405) 	for(i = 0; i < 0x40; i+=4) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 406) 		spin_lock_irqsave(&emu->emu_lock, flags);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 407) 		value = inl(emu->port + i);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 408) 		spin_unlock_irqrestore(&emu->emu_lock, flags);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 409) 		snd_iprintf(buffer, "%02X: %08lX\n", i, value);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 410) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 411) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 412) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 413) static void snd_emu_proc_io_reg_write(struct snd_info_entry *entry,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 414)                                       struct snd_info_buffer *buffer)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 415) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 416) 	struct snd_emu10k1 *emu = entry->private_data;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 417) 	unsigned long flags;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 418) 	char line[64];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 419) 	u32 reg, val;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 420) 	while (!snd_info_get_line(buffer, line, sizeof(line))) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 421) 		if (sscanf(line, "%x %x", &reg, &val) != 2)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 422) 			continue;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 423) 		if (reg < 0x40 && val <= 0xffffffff) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 424) 			spin_lock_irqsave(&emu->emu_lock, flags);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 425) 			outl(val, emu->port + (reg & 0xfffffffc));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 426) 			spin_unlock_irqrestore(&emu->emu_lock, flags);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 427) 		}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 428) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 429) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 430) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 431) static unsigned int snd_ptr_read(struct snd_emu10k1 * emu,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 432) 				 unsigned int iobase,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 433) 				 unsigned int reg,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 434) 				 unsigned int chn)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 435) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 436) 	unsigned long flags;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 437) 	unsigned int regptr, val;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 438) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 439) 	regptr = (reg << 16) | chn;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 440) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 441) 	spin_lock_irqsave(&emu->emu_lock, flags);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 442) 	outl(regptr, emu->port + iobase + PTR);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 443) 	val = inl(emu->port + iobase + DATA);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 444) 	spin_unlock_irqrestore(&emu->emu_lock, flags);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 445) 	return val;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 446) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 447) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 448) static void snd_ptr_write(struct snd_emu10k1 *emu,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 449) 			  unsigned int iobase,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 450) 			  unsigned int reg,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 451) 			  unsigned int chn,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 452) 			  unsigned int data)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 453) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 454) 	unsigned int regptr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 455) 	unsigned long flags;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 456) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 457) 	regptr = (reg << 16) | chn;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 458) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 459) 	spin_lock_irqsave(&emu->emu_lock, flags);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 460) 	outl(regptr, emu->port + iobase + PTR);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 461) 	outl(data, emu->port + iobase + DATA);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 462) 	spin_unlock_irqrestore(&emu->emu_lock, flags);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 463) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 464) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 465) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 466) static void snd_emu_proc_ptr_reg_read(struct snd_info_entry *entry,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 467) 				      struct snd_info_buffer *buffer, int iobase, int offset, int length, int voices)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 468) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 469) 	struct snd_emu10k1 *emu = entry->private_data;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 470) 	unsigned long value;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 471) 	int i,j;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 472) 	if (offset+length > 0xa0) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 473) 		snd_iprintf(buffer, "Input values out of range\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 474) 		return;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 475) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 476) 	snd_iprintf(buffer, "Registers 0x%x\n", iobase);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 477) 	for(i = offset; i < offset+length; i++) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 478) 		snd_iprintf(buffer, "%02X: ",i);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 479) 		for (j = 0; j < voices; j++) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 480) 			if(iobase == 0)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 481)                 		value = snd_ptr_read(emu, 0, i, j);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 482) 			else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 483)                 		value = snd_ptr_read(emu, 0x20, i, j);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 484) 			snd_iprintf(buffer, "%08lX ", value);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 485) 		}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 486) 		snd_iprintf(buffer, "\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 487) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 488) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 489) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 490) static void snd_emu_proc_ptr_reg_write(struct snd_info_entry *entry,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 491) 				       struct snd_info_buffer *buffer, int iobase)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 492) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 493) 	struct snd_emu10k1 *emu = entry->private_data;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 494) 	char line[64];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 495) 	unsigned int reg, channel_id , val;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 496) 	while (!snd_info_get_line(buffer, line, sizeof(line))) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 497) 		if (sscanf(line, "%x %x %x", &reg, &channel_id, &val) != 3)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 498) 			continue;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 499) 		if (reg < 0xa0 && val <= 0xffffffff && channel_id <= 3)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 500) 			snd_ptr_write(emu, iobase, reg, channel_id, val);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 501) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 502) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 503) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 504) static void snd_emu_proc_ptr_reg_write00(struct snd_info_entry *entry,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 505) 					 struct snd_info_buffer *buffer)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 506) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 507) 	snd_emu_proc_ptr_reg_write(entry, buffer, 0);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 508) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 509) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 510) static void snd_emu_proc_ptr_reg_write20(struct snd_info_entry *entry,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 511) 					 struct snd_info_buffer *buffer)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 512) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 513) 	snd_emu_proc_ptr_reg_write(entry, buffer, 0x20);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 514) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 515) 	
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 516) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 517) static void snd_emu_proc_ptr_reg_read00a(struct snd_info_entry *entry,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 518) 					 struct snd_info_buffer *buffer)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 519) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 520) 	snd_emu_proc_ptr_reg_read(entry, buffer, 0, 0, 0x40, 64);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 521) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 522) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 523) static void snd_emu_proc_ptr_reg_read00b(struct snd_info_entry *entry,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 524) 					 struct snd_info_buffer *buffer)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 525) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 526) 	snd_emu_proc_ptr_reg_read(entry, buffer, 0, 0x40, 0x40, 64);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 527) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 528) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 529) static void snd_emu_proc_ptr_reg_read20a(struct snd_info_entry *entry,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 530) 					 struct snd_info_buffer *buffer)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 531) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 532) 	snd_emu_proc_ptr_reg_read(entry, buffer, 0x20, 0, 0x40, 4);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 533) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 534) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 535) static void snd_emu_proc_ptr_reg_read20b(struct snd_info_entry *entry,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 536) 					 struct snd_info_buffer *buffer)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 537) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 538) 	snd_emu_proc_ptr_reg_read(entry, buffer, 0x20, 0x40, 0x40, 4);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 539) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 540) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 541) static void snd_emu_proc_ptr_reg_read20c(struct snd_info_entry *entry,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 542) 					 struct snd_info_buffer * buffer)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 543) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 544) 	snd_emu_proc_ptr_reg_read(entry, buffer, 0x20, 0x80, 0x20, 4);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 545) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 546) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 547) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 548) static const struct snd_info_entry_ops snd_emu10k1_proc_ops_fx8010 = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 549) 	.read = snd_emu10k1_fx8010_read,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 550) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 551) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 552) int snd_emu10k1_proc_init(struct snd_emu10k1 *emu)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 553) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 554) 	struct snd_info_entry *entry;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 555) #ifdef CONFIG_SND_DEBUG
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 556) 	if (emu->card_capabilities->emu_model) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 557) 		snd_card_ro_proc_new(emu->card, "emu1010_regs",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 558) 				     emu, snd_emu_proc_emu1010_reg_read);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 559) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 560) 	snd_card_rw_proc_new(emu->card, "io_regs", emu,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 561) 			     snd_emu_proc_io_reg_read,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 562) 			     snd_emu_proc_io_reg_write);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 563) 	snd_card_rw_proc_new(emu->card, "ptr_regs00a", emu,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 564) 			     snd_emu_proc_ptr_reg_read00a,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 565) 			     snd_emu_proc_ptr_reg_write00);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 566) 	snd_card_rw_proc_new(emu->card, "ptr_regs00b", emu,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 567) 			     snd_emu_proc_ptr_reg_read00b,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 568) 			     snd_emu_proc_ptr_reg_write00);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 569) 	snd_card_rw_proc_new(emu->card, "ptr_regs20a", emu,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 570) 			     snd_emu_proc_ptr_reg_read20a,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 571) 			     snd_emu_proc_ptr_reg_write20);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 572) 	snd_card_rw_proc_new(emu->card, "ptr_regs20b", emu,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 573) 			     snd_emu_proc_ptr_reg_read20b,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 574) 			     snd_emu_proc_ptr_reg_write20);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 575) 	snd_card_rw_proc_new(emu->card, "ptr_regs20c", emu,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 576) 			     snd_emu_proc_ptr_reg_read20c,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 577) 			     snd_emu_proc_ptr_reg_write20);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 578) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 579) 	
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 580) 	snd_card_ro_proc_new(emu->card, "emu10k1", emu, snd_emu10k1_proc_read);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 581) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 582) 	if (emu->card_capabilities->emu10k2_chip)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 583) 		snd_card_ro_proc_new(emu->card, "spdif-in", emu,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 584) 				     snd_emu10k1_proc_spdif_read);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 585) 	if (emu->card_capabilities->ca0151_chip)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 586) 		snd_card_ro_proc_new(emu->card, "capture-rates", emu,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 587) 				     snd_emu10k1_proc_rates_read);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 588) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 589) 	snd_card_ro_proc_new(emu->card, "voices", emu,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 590) 			     snd_emu10k1_proc_voices_read);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 591) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 592) 	if (! snd_card_proc_new(emu->card, "fx8010_gpr", &entry)) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 593) 		entry->content = SNDRV_INFO_CONTENT_DATA;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 594) 		entry->private_data = emu;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 595) 		entry->mode = S_IFREG | 0444 /*| S_IWUSR*/;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 596) 		entry->size = emu->audigy ? A_TOTAL_SIZE_GPR : TOTAL_SIZE_GPR;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 597) 		entry->c.ops = &snd_emu10k1_proc_ops_fx8010;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 598) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 599) 	if (! snd_card_proc_new(emu->card, "fx8010_tram_data", &entry)) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 600) 		entry->content = SNDRV_INFO_CONTENT_DATA;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 601) 		entry->private_data = emu;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 602) 		entry->mode = S_IFREG | 0444 /*| S_IWUSR*/;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 603) 		entry->size = emu->audigy ? A_TOTAL_SIZE_TANKMEM_DATA : TOTAL_SIZE_TANKMEM_DATA ;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 604) 		entry->c.ops = &snd_emu10k1_proc_ops_fx8010;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 605) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 606) 	if (! snd_card_proc_new(emu->card, "fx8010_tram_addr", &entry)) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 607) 		entry->content = SNDRV_INFO_CONTENT_DATA;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 608) 		entry->private_data = emu;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 609) 		entry->mode = S_IFREG | 0444 /*| S_IWUSR*/;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 610) 		entry->size = emu->audigy ? A_TOTAL_SIZE_TANKMEM_ADDR : TOTAL_SIZE_TANKMEM_ADDR ;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 611) 		entry->c.ops = &snd_emu10k1_proc_ops_fx8010;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 612) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 613) 	if (! snd_card_proc_new(emu->card, "fx8010_code", &entry)) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 614) 		entry->content = SNDRV_INFO_CONTENT_DATA;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 615) 		entry->private_data = emu;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 616) 		entry->mode = S_IFREG | 0444 /*| S_IWUSR*/;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 617) 		entry->size = emu->audigy ? A_TOTAL_SIZE_CODE : TOTAL_SIZE_CODE;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 618) 		entry->c.ops = &snd_emu10k1_proc_ops_fx8010;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 619) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 620) 	snd_card_ro_proc_new(emu->card, "fx8010_acode", emu,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 621) 			     snd_emu10k1_proc_acode_read);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 622) 	return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 623) }