2019-05-20 17:07:57 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
2005-04-16 22:20:36 +00:00
|
|
|
/*
|
|
|
|
* Universal Interface for Intel High Definition Audio Codec
|
|
|
|
*
|
|
|
|
* Generic proc interface
|
|
|
|
*
|
|
|
|
* Copyright (c) 2004 Takashi Iwai <tiwai@suse.de>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <linux/init.h>
|
ALSA: hda - Remove limit of widget connections
Currently we set the max number of connections to be 32, but there
seems codec that gives longer connection lists like AD1988, and we see
errors in proc output and else. (Though, in the case of AD1988, it's
a list of all codecs connected to a single vendor widget, so this must
be something fishy, but it's still valid from the h/w design POV.)
This patch tries to remove this restriction. For efficiency, we still
use the fixed size array in the parser, but takes a dynamic array when
the size is reported to be greater than that.
Now the fixed array size is found only in patch_hdmi.c, but it should
be fine, as the codec itself can't support so many pins.
Reported-by: Raymond Yau <superquad.vortex2@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-02-07 17:18:19 +00:00
|
|
|
#include <linux/slab.h>
|
2005-04-16 22:20:36 +00:00
|
|
|
#include <sound/core.h>
|
2014-01-29 09:37:10 +00:00
|
|
|
#include <linux/module.h>
|
2018-08-22 20:24:57 +00:00
|
|
|
#include <sound/hda_codec.h>
|
2005-11-23 12:14:50 +00:00
|
|
|
#include "hda_local.h"
|
2005-04-16 22:20:36 +00:00
|
|
|
|
2014-01-29 09:37:10 +00:00
|
|
|
static int dump_coef = -1;
|
|
|
|
module_param(dump_coef, int, 0644);
|
|
|
|
MODULE_PARM_DESC(dump_coef, "Dump processing coefficients in codec proc file (-1=auto, 0=disable, 1=enable)");
|
|
|
|
|
2015-03-03 22:29:47 +00:00
|
|
|
/* always use noncached version */
|
|
|
|
#define param_read(codec, nid, parm) \
|
|
|
|
snd_hdac_read_parm_uncached(&(codec)->core, nid, parm)
|
|
|
|
|
2005-04-16 22:20:36 +00:00
|
|
|
static const char *get_wid_type_name(unsigned int wid_value)
|
|
|
|
{
|
2015-08-17 12:52:51 +00:00
|
|
|
static const char * const names[16] = {
|
2005-04-16 22:20:36 +00:00
|
|
|
[AC_WID_AUD_OUT] = "Audio Output",
|
|
|
|
[AC_WID_AUD_IN] = "Audio Input",
|
|
|
|
[AC_WID_AUD_MIX] = "Audio Mixer",
|
|
|
|
[AC_WID_AUD_SEL] = "Audio Selector",
|
|
|
|
[AC_WID_PIN] = "Pin Complex",
|
|
|
|
[AC_WID_POWER] = "Power Widget",
|
|
|
|
[AC_WID_VOL_KNB] = "Volume Knob Widget",
|
|
|
|
[AC_WID_BEEP] = "Beep Generator Widget",
|
|
|
|
[AC_WID_VENDOR] = "Vendor Defined Widget",
|
|
|
|
};
|
2012-01-10 11:41:22 +00:00
|
|
|
if (wid_value == -1)
|
|
|
|
return "UNKNOWN Widget";
|
2005-04-16 22:20:36 +00:00
|
|
|
wid_value &= 0xf;
|
|
|
|
if (names[wid_value])
|
|
|
|
return names[wid_value];
|
|
|
|
else
|
2006-10-17 18:41:38 +00:00
|
|
|
return "UNKNOWN Widget";
|
2005-04-16 22:20:36 +00:00
|
|
|
}
|
|
|
|
|
2009-12-08 15:13:32 +00:00
|
|
|
static void print_nid_array(struct snd_info_buffer *buffer,
|
|
|
|
struct hda_codec *codec, hda_nid_t nid,
|
|
|
|
struct snd_array *array)
|
2009-11-11 12:43:01 +00:00
|
|
|
{
|
|
|
|
int i;
|
2009-12-08 15:13:32 +00:00
|
|
|
struct hda_nid_item *items = array->list, *item;
|
2009-11-11 12:43:01 +00:00
|
|
|
struct snd_kcontrol *kctl;
|
2009-12-08 15:13:32 +00:00
|
|
|
for (i = 0; i < array->used; i++) {
|
|
|
|
item = &items[i];
|
|
|
|
if (item->nid == nid) {
|
|
|
|
kctl = item->kctl;
|
2009-11-11 12:43:01 +00:00
|
|
|
snd_iprintf(buffer,
|
|
|
|
" Control: name=\"%s\", index=%i, device=%i\n",
|
2009-12-08 15:13:32 +00:00
|
|
|
kctl->id.name, kctl->id.index + item->index,
|
|
|
|
kctl->id.device);
|
ALSA: hda - introduce HDA_SUBDEV_AMP_FLAG (ControlAmp in proc)
The purpose of this changeset is to show information about amplifier
setting in the codec proc file. Something like:
Control: name="Front Playback Volume", index=0, device=0
ControlAmp: chs=3, dir=Out, idx=0, ofs=0
Control: name="Front Playback Switch", index=0, device=0
ControlAmp: chs=3, dir=In, idx=2, ofs=0
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2009-12-08 16:45:25 +00:00
|
|
|
if (item->flags & HDA_NID_ITEM_AMP)
|
|
|
|
snd_iprintf(buffer,
|
|
|
|
" ControlAmp: chs=%lu, dir=%s, "
|
|
|
|
"idx=%lu, ofs=%lu\n",
|
|
|
|
get_amp_channels(kctl),
|
|
|
|
get_amp_direction(kctl) ? "Out" : "In",
|
|
|
|
get_amp_index(kctl),
|
|
|
|
get_amp_offset(kctl));
|
2009-11-11 12:43:01 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void print_nid_pcms(struct snd_info_buffer *buffer,
|
|
|
|
struct hda_codec *codec, hda_nid_t nid)
|
|
|
|
{
|
2015-02-27 16:43:19 +00:00
|
|
|
int type;
|
2009-11-11 12:43:01 +00:00
|
|
|
struct hda_pcm *cpcm;
|
2015-02-27 16:43:19 +00:00
|
|
|
|
|
|
|
list_for_each_entry(cpcm, &codec->pcm_list_head, list) {
|
2009-11-11 12:43:01 +00:00
|
|
|
for (type = 0; type < 2; type++) {
|
|
|
|
if (cpcm->stream[type].nid != nid || cpcm->pcm == NULL)
|
|
|
|
continue;
|
|
|
|
snd_iprintf(buffer, " Device: name=\"%s\", "
|
|
|
|
"type=\"%s\", device=%i\n",
|
|
|
|
cpcm->name,
|
|
|
|
snd_hda_pcm_type_name[cpcm->pcm_type],
|
|
|
|
cpcm->pcm->device);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2005-11-17 13:57:47 +00:00
|
|
|
static void print_amp_caps(struct snd_info_buffer *buffer,
|
2005-04-16 22:20:36 +00:00
|
|
|
struct hda_codec *codec, hda_nid_t nid, int dir)
|
|
|
|
{
|
|
|
|
unsigned int caps;
|
2015-03-03 22:29:47 +00:00
|
|
|
caps = param_read(codec, nid, dir == HDA_OUTPUT ?
|
|
|
|
AC_PAR_AMP_OUT_CAP : AC_PAR_AMP_IN_CAP);
|
2005-04-16 22:20:36 +00:00
|
|
|
if (caps == -1 || caps == 0) {
|
|
|
|
snd_iprintf(buffer, "N/A\n");
|
|
|
|
return;
|
|
|
|
}
|
2007-07-27 14:52:19 +00:00
|
|
|
snd_iprintf(buffer, "ofs=0x%02x, nsteps=0x%02x, stepsize=0x%02x, "
|
|
|
|
"mute=%x\n",
|
2005-04-16 22:20:36 +00:00
|
|
|
caps & AC_AMPCAP_OFFSET,
|
|
|
|
(caps & AC_AMPCAP_NUM_STEPS) >> AC_AMPCAP_NUM_STEPS_SHIFT,
|
|
|
|
(caps & AC_AMPCAP_STEP_SIZE) >> AC_AMPCAP_STEP_SIZE_SHIFT,
|
|
|
|
(caps & AC_AMPCAP_MUTE) >> AC_AMPCAP_MUTE_SHIFT);
|
|
|
|
}
|
|
|
|
|
2015-03-16 09:18:08 +00:00
|
|
|
/* is this a stereo widget or a stereo-to-mono mix? */
|
|
|
|
static bool is_stereo_amps(struct hda_codec *codec, hda_nid_t nid,
|
|
|
|
int dir, unsigned int wcaps, int indices)
|
|
|
|
{
|
|
|
|
hda_nid_t conn;
|
|
|
|
|
|
|
|
if (wcaps & AC_WCAP_STEREO)
|
|
|
|
return true;
|
|
|
|
/* check for a stereo-to-mono mix; it must be:
|
|
|
|
* only a single connection, only for input, and only a mixer widget
|
|
|
|
*/
|
|
|
|
if (indices != 1 || dir != HDA_INPUT ||
|
|
|
|
get_wcaps_type(wcaps) != AC_WID_AUD_MIX)
|
|
|
|
return false;
|
|
|
|
|
|
|
|
if (snd_hda_get_raw_connections(codec, nid, &conn, 1) < 0)
|
|
|
|
return false;
|
|
|
|
/* the connection source is a stereo? */
|
|
|
|
wcaps = snd_hda_param_read(codec, conn, AC_PAR_AUDIO_WIDGET_CAP);
|
|
|
|
return !!(wcaps & AC_WCAP_STEREO);
|
|
|
|
}
|
|
|
|
|
2005-11-17 13:57:47 +00:00
|
|
|
static void print_amp_vals(struct snd_info_buffer *buffer,
|
2005-04-16 22:20:36 +00:00
|
|
|
struct hda_codec *codec, hda_nid_t nid,
|
2015-03-16 09:18:08 +00:00
|
|
|
int dir, unsigned int wcaps, int indices)
|
2005-04-16 22:20:36 +00:00
|
|
|
{
|
|
|
|
unsigned int val;
|
2015-03-16 09:18:08 +00:00
|
|
|
bool stereo;
|
2005-06-10 17:45:09 +00:00
|
|
|
int i;
|
|
|
|
|
2015-03-16 09:18:08 +00:00
|
|
|
stereo = is_stereo_amps(codec, nid, dir, wcaps, indices);
|
|
|
|
|
2006-07-05 15:39:14 +00:00
|
|
|
dir = dir == HDA_OUTPUT ? AC_AMP_GET_OUTPUT : AC_AMP_GET_INPUT;
|
2005-06-10 17:45:09 +00:00
|
|
|
for (i = 0; i < indices; i++) {
|
|
|
|
snd_iprintf(buffer, " [");
|
2012-12-10 14:58:34 +00:00
|
|
|
val = snd_hda_codec_read(codec, nid, 0,
|
|
|
|
AC_VERB_GET_AMP_GAIN_MUTE,
|
|
|
|
AC_AMP_GET_LEFT | dir | i);
|
|
|
|
snd_iprintf(buffer, "0x%02x", val);
|
2005-06-10 17:45:09 +00:00
|
|
|
if (stereo) {
|
2007-07-27 14:52:19 +00:00
|
|
|
val = snd_hda_codec_read(codec, nid, 0,
|
|
|
|
AC_VERB_GET_AMP_GAIN_MUTE,
|
2012-12-10 14:58:34 +00:00
|
|
|
AC_AMP_GET_RIGHT | dir | i);
|
|
|
|
snd_iprintf(buffer, " 0x%02x", val);
|
2005-06-10 17:45:09 +00:00
|
|
|
}
|
2012-12-10 14:58:34 +00:00
|
|
|
snd_iprintf(buffer, "]");
|
2005-04-16 22:20:36 +00:00
|
|
|
}
|
2005-06-10 17:45:09 +00:00
|
|
|
snd_iprintf(buffer, "\n");
|
2005-04-16 22:20:36 +00:00
|
|
|
}
|
|
|
|
|
2008-11-18 03:47:51 +00:00
|
|
|
static void print_pcm_rates(struct snd_info_buffer *buffer, unsigned int pcm)
|
|
|
|
{
|
2020-01-05 14:47:24 +00:00
|
|
|
static const unsigned int rates[] = {
|
2011-10-06 06:16:29 +00:00
|
|
|
8000, 11025, 16000, 22050, 32000, 44100, 48000, 88200,
|
|
|
|
96000, 176400, 192000, 384000
|
|
|
|
};
|
|
|
|
int i;
|
2008-11-19 07:14:02 +00:00
|
|
|
|
2006-11-07 15:10:06 +00:00
|
|
|
pcm &= AC_SUPPCM_RATES;
|
|
|
|
snd_iprintf(buffer, " rates [0x%x]:", pcm);
|
2011-10-06 06:16:29 +00:00
|
|
|
for (i = 0; i < ARRAY_SIZE(rates); i++)
|
|
|
|
if (pcm & (1 << i))
|
|
|
|
snd_iprintf(buffer, " %d", rates[i]);
|
|
|
|
snd_iprintf(buffer, "\n");
|
2006-11-07 15:10:06 +00:00
|
|
|
}
|
|
|
|
|
2008-11-19 07:14:02 +00:00
|
|
|
static void print_pcm_bits(struct snd_info_buffer *buffer, unsigned int pcm)
|
|
|
|
{
|
|
|
|
char buf[SND_PRINT_BITS_ADVISED_BUFSIZE];
|
2006-11-07 15:10:06 +00:00
|
|
|
|
2008-11-25 15:07:01 +00:00
|
|
|
snd_iprintf(buffer, " bits [0x%x]:", (pcm >> 16) & 0xff);
|
2008-11-19 07:14:02 +00:00
|
|
|
snd_print_pcm_bits(pcm, buf, sizeof(buf));
|
|
|
|
snd_iprintf(buffer, "%s\n", buf);
|
2006-11-07 15:10:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void print_pcm_formats(struct snd_info_buffer *buffer,
|
|
|
|
unsigned int streams)
|
|
|
|
{
|
|
|
|
snd_iprintf(buffer, " formats [0x%x]:", streams & 0xf);
|
|
|
|
if (streams & AC_SUPFMT_PCM)
|
|
|
|
snd_iprintf(buffer, " PCM");
|
|
|
|
if (streams & AC_SUPFMT_FLOAT32)
|
|
|
|
snd_iprintf(buffer, " FLOAT");
|
|
|
|
if (streams & AC_SUPFMT_AC3)
|
|
|
|
snd_iprintf(buffer, " AC3");
|
|
|
|
snd_iprintf(buffer, "\n");
|
|
|
|
}
|
|
|
|
|
2005-11-17 13:57:47 +00:00
|
|
|
static void print_pcm_caps(struct snd_info_buffer *buffer,
|
2005-04-16 22:20:36 +00:00
|
|
|
struct hda_codec *codec, hda_nid_t nid)
|
|
|
|
{
|
2015-03-03 22:29:47 +00:00
|
|
|
unsigned int pcm = param_read(codec, nid, AC_PAR_PCM);
|
|
|
|
unsigned int stream = param_read(codec, nid, AC_PAR_STREAM);
|
2005-04-16 22:20:36 +00:00
|
|
|
if (pcm == -1 || stream == -1) {
|
|
|
|
snd_iprintf(buffer, "N/A\n");
|
|
|
|
return;
|
|
|
|
}
|
2006-11-07 15:10:06 +00:00
|
|
|
print_pcm_rates(buffer, pcm);
|
|
|
|
print_pcm_bits(buffer, pcm);
|
|
|
|
print_pcm_formats(buffer, stream);
|
2005-04-16 22:20:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static const char *get_jack_connection(u32 cfg)
|
|
|
|
{
|
2015-08-17 12:52:51 +00:00
|
|
|
static const char * const names[16] = {
|
2005-04-16 22:20:36 +00:00
|
|
|
"Unknown", "1/8", "1/4", "ATAPI",
|
|
|
|
"RCA", "Optical","Digital", "Analog",
|
|
|
|
"DIN", "XLR", "RJ11", "Comb",
|
|
|
|
NULL, NULL, NULL, "Other"
|
|
|
|
};
|
|
|
|
cfg = (cfg & AC_DEFCFG_CONN_TYPE) >> AC_DEFCFG_CONN_TYPE_SHIFT;
|
|
|
|
if (names[cfg])
|
|
|
|
return names[cfg];
|
|
|
|
else
|
|
|
|
return "UNKNOWN";
|
|
|
|
}
|
|
|
|
|
|
|
|
static const char *get_jack_color(u32 cfg)
|
|
|
|
{
|
2015-08-17 12:52:51 +00:00
|
|
|
static const char * const names[16] = {
|
2005-04-16 22:20:36 +00:00
|
|
|
"Unknown", "Black", "Grey", "Blue",
|
|
|
|
"Green", "Red", "Orange", "Yellow",
|
|
|
|
"Purple", "Pink", NULL, NULL,
|
|
|
|
NULL, NULL, "White", "Other",
|
|
|
|
};
|
|
|
|
cfg = (cfg & AC_DEFCFG_COLOR) >> AC_DEFCFG_COLOR_SHIFT;
|
|
|
|
if (names[cfg])
|
|
|
|
return names[cfg];
|
|
|
|
else
|
|
|
|
return "UNKNOWN";
|
|
|
|
}
|
|
|
|
|
2015-08-17 12:44:24 +00:00
|
|
|
/*
|
|
|
|
* Parse the pin default config value and returns the string of the
|
|
|
|
* jack location, e.g. "Rear", "Front", etc.
|
|
|
|
*/
|
|
|
|
static const char *get_jack_location(u32 cfg)
|
|
|
|
{
|
2015-08-17 12:52:51 +00:00
|
|
|
static const char * const bases[7] = {
|
2015-08-17 12:44:24 +00:00
|
|
|
"N/A", "Rear", "Front", "Left", "Right", "Top", "Bottom",
|
|
|
|
};
|
2015-08-17 12:52:51 +00:00
|
|
|
static const unsigned char specials_idx[] = {
|
2015-08-17 12:44:24 +00:00
|
|
|
0x07, 0x08,
|
|
|
|
0x17, 0x18, 0x19,
|
|
|
|
0x37, 0x38
|
|
|
|
};
|
2015-08-17 12:52:51 +00:00
|
|
|
static const char * const specials[] = {
|
2015-08-17 12:44:24 +00:00
|
|
|
"Rear Panel", "Drive Bar",
|
|
|
|
"Riser", "HDMI", "ATAPI",
|
|
|
|
"Mobile-In", "Mobile-Out"
|
|
|
|
};
|
|
|
|
int i;
|
|
|
|
|
|
|
|
cfg = (cfg & AC_DEFCFG_LOCATION) >> AC_DEFCFG_LOCATION_SHIFT;
|
|
|
|
if ((cfg & 0x0f) < 7)
|
|
|
|
return bases[cfg & 0x0f];
|
|
|
|
for (i = 0; i < ARRAY_SIZE(specials_idx); i++) {
|
|
|
|
if (cfg == specials_idx[i])
|
|
|
|
return specials[i];
|
|
|
|
}
|
|
|
|
return "UNKNOWN";
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Parse the pin default config value and returns the string of the
|
|
|
|
* jack connectivity, i.e. external or internal connection.
|
|
|
|
*/
|
|
|
|
static const char *get_jack_connectivity(u32 cfg)
|
|
|
|
{
|
2015-08-17 12:52:51 +00:00
|
|
|
static const char * const jack_locations[4] = {
|
|
|
|
"Ext", "Int", "Sep", "Oth"
|
|
|
|
};
|
2015-08-17 12:44:24 +00:00
|
|
|
|
|
|
|
return jack_locations[(cfg >> (AC_DEFCFG_LOCATION_SHIFT + 4)) & 3];
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Parse the pin default config value and returns the string of the
|
|
|
|
* jack type, i.e. the purpose of the jack, such as Line-Out or CD.
|
|
|
|
*/
|
|
|
|
static const char *get_jack_type(u32 cfg)
|
|
|
|
{
|
2015-08-17 12:52:51 +00:00
|
|
|
static const char * const jack_types[16] = {
|
2015-08-17 12:44:24 +00:00
|
|
|
"Line Out", "Speaker", "HP Out", "CD",
|
|
|
|
"SPDIF Out", "Digital Out", "Modem Line", "Modem Hand",
|
|
|
|
"Line In", "Aux", "Mic", "Telephony",
|
|
|
|
"SPDIF In", "Digital In", "Reserved", "Other"
|
|
|
|
};
|
|
|
|
|
|
|
|
return jack_types[(cfg & AC_DEFCFG_DEVICE)
|
|
|
|
>> AC_DEFCFG_DEVICE_SHIFT];
|
|
|
|
}
|
|
|
|
|
2005-11-17 13:57:47 +00:00
|
|
|
static void print_pin_caps(struct snd_info_buffer *buffer,
|
[ALSA] hda_proc - Add a number of new settings to proc codec output
This patch adds additional output to the /proc codec#X info.
The following pieces of information are added to the output:
- Balanced, L/R swap, trigger, impedance sense pin capabilities
- Vref pin capabilities
- Current Vref pin widget control setting
- Default configuration association, sequence, and misc bit test
- EAPD/BTL bits conveying balanced mode, EAPD, and L/R swap
- Power state modified to show state name as well as setting vs actual value
- GPIO parameter output on Audio Function Group, including enumeration of IO
pins which are indicated present (Any I and O pins are not output at this
time)
- Stripe and L/R swap widget capabilities
- All digital converter bits: enable, validity, validity config, preemphasis,
copyright, non-audio, professional, generation level, and content category
- Converter stream and channel values for in/out widgets
- SDI select value for in widgets
- Unsolicited response widget capability tag and enabled bit
- Delay widget capability value
- Processing widget capability benign bit and number of coefficients
- Realtek Define Registers: processing coefficient, coefficient index
[Also, fixed space/tab issues and make codes a bit more readable
-- Takashi]
Signed-off-by: Andrew Paprocki <andrew@ishiboo.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-01-18 11:51:11 +00:00
|
|
|
struct hda_codec *codec, hda_nid_t nid,
|
|
|
|
int *supports_vref)
|
2005-04-16 22:20:36 +00:00
|
|
|
{
|
2015-08-17 12:52:51 +00:00
|
|
|
static const char * const jack_conns[4] = {
|
|
|
|
"Jack", "N/A", "Fixed", "Both"
|
|
|
|
};
|
2007-10-26 12:56:36 +00:00
|
|
|
unsigned int caps, val;
|
2005-04-16 22:20:36 +00:00
|
|
|
|
2015-03-03 22:29:47 +00:00
|
|
|
caps = param_read(codec, nid, AC_PAR_PIN_CAP);
|
2008-09-13 23:54:57 +00:00
|
|
|
snd_iprintf(buffer, " Pincap 0x%08x:", caps);
|
2005-04-16 22:20:36 +00:00
|
|
|
if (caps & AC_PINCAP_IN)
|
|
|
|
snd_iprintf(buffer, " IN");
|
|
|
|
if (caps & AC_PINCAP_OUT)
|
|
|
|
snd_iprintf(buffer, " OUT");
|
|
|
|
if (caps & AC_PINCAP_HP_DRV)
|
|
|
|
snd_iprintf(buffer, " HP");
|
2006-06-21 17:19:25 +00:00
|
|
|
if (caps & AC_PINCAP_EAPD)
|
|
|
|
snd_iprintf(buffer, " EAPD");
|
|
|
|
if (caps & AC_PINCAP_PRES_DETECT)
|
|
|
|
snd_iprintf(buffer, " Detect");
|
[ALSA] hda_proc - Add a number of new settings to proc codec output
This patch adds additional output to the /proc codec#X info.
The following pieces of information are added to the output:
- Balanced, L/R swap, trigger, impedance sense pin capabilities
- Vref pin capabilities
- Current Vref pin widget control setting
- Default configuration association, sequence, and misc bit test
- EAPD/BTL bits conveying balanced mode, EAPD, and L/R swap
- Power state modified to show state name as well as setting vs actual value
- GPIO parameter output on Audio Function Group, including enumeration of IO
pins which are indicated present (Any I and O pins are not output at this
time)
- Stripe and L/R swap widget capabilities
- All digital converter bits: enable, validity, validity config, preemphasis,
copyright, non-audio, professional, generation level, and content category
- Converter stream and channel values for in/out widgets
- SDI select value for in widgets
- Unsolicited response widget capability tag and enabled bit
- Delay widget capability value
- Processing widget capability benign bit and number of coefficients
- Realtek Define Registers: processing coefficient, coefficient index
[Also, fixed space/tab issues and make codes a bit more readable
-- Takashi]
Signed-off-by: Andrew Paprocki <andrew@ishiboo.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-01-18 11:51:11 +00:00
|
|
|
if (caps & AC_PINCAP_BALANCE)
|
|
|
|
snd_iprintf(buffer, " Balanced");
|
2008-07-30 13:13:29 +00:00
|
|
|
if (caps & AC_PINCAP_HDMI) {
|
|
|
|
/* Realtek uses this bit as a different meaning */
|
2015-03-03 09:07:24 +00:00
|
|
|
if ((codec->core.vendor_id >> 16) == 0x10ec)
|
2008-07-30 13:13:29 +00:00
|
|
|
snd_iprintf(buffer, " R/L");
|
2009-12-11 04:28:33 +00:00
|
|
|
else {
|
|
|
|
if (caps & AC_PINCAP_HBR)
|
|
|
|
snd_iprintf(buffer, " HBR");
|
2008-07-30 13:13:29 +00:00
|
|
|
snd_iprintf(buffer, " HDMI");
|
2009-12-11 04:28:33 +00:00
|
|
|
}
|
2008-07-30 13:13:29 +00:00
|
|
|
}
|
2009-12-11 04:28:34 +00:00
|
|
|
if (caps & AC_PINCAP_DP)
|
|
|
|
snd_iprintf(buffer, " DP");
|
[ALSA] hda_proc - Add a number of new settings to proc codec output
This patch adds additional output to the /proc codec#X info.
The following pieces of information are added to the output:
- Balanced, L/R swap, trigger, impedance sense pin capabilities
- Vref pin capabilities
- Current Vref pin widget control setting
- Default configuration association, sequence, and misc bit test
- EAPD/BTL bits conveying balanced mode, EAPD, and L/R swap
- Power state modified to show state name as well as setting vs actual value
- GPIO parameter output on Audio Function Group, including enumeration of IO
pins which are indicated present (Any I and O pins are not output at this
time)
- Stripe and L/R swap widget capabilities
- All digital converter bits: enable, validity, validity config, preemphasis,
copyright, non-audio, professional, generation level, and content category
- Converter stream and channel values for in/out widgets
- SDI select value for in widgets
- Unsolicited response widget capability tag and enabled bit
- Delay widget capability value
- Processing widget capability benign bit and number of coefficients
- Realtek Define Registers: processing coefficient, coefficient index
[Also, fixed space/tab issues and make codes a bit more readable
-- Takashi]
Signed-off-by: Andrew Paprocki <andrew@ishiboo.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-01-18 11:51:11 +00:00
|
|
|
if (caps & AC_PINCAP_TRIG_REQ)
|
|
|
|
snd_iprintf(buffer, " Trigger");
|
|
|
|
if (caps & AC_PINCAP_IMP_SENSE)
|
|
|
|
snd_iprintf(buffer, " ImpSense");
|
2005-04-16 22:20:36 +00:00
|
|
|
snd_iprintf(buffer, "\n");
|
[ALSA] hda_proc - Add a number of new settings to proc codec output
This patch adds additional output to the /proc codec#X info.
The following pieces of information are added to the output:
- Balanced, L/R swap, trigger, impedance sense pin capabilities
- Vref pin capabilities
- Current Vref pin widget control setting
- Default configuration association, sequence, and misc bit test
- EAPD/BTL bits conveying balanced mode, EAPD, and L/R swap
- Power state modified to show state name as well as setting vs actual value
- GPIO parameter output on Audio Function Group, including enumeration of IO
pins which are indicated present (Any I and O pins are not output at this
time)
- Stripe and L/R swap widget capabilities
- All digital converter bits: enable, validity, validity config, preemphasis,
copyright, non-audio, professional, generation level, and content category
- Converter stream and channel values for in/out widgets
- SDI select value for in widgets
- Unsolicited response widget capability tag and enabled bit
- Delay widget capability value
- Processing widget capability benign bit and number of coefficients
- Realtek Define Registers: processing coefficient, coefficient index
[Also, fixed space/tab issues and make codes a bit more readable
-- Takashi]
Signed-off-by: Andrew Paprocki <andrew@ishiboo.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-01-18 11:51:11 +00:00
|
|
|
if (caps & AC_PINCAP_VREF) {
|
|
|
|
unsigned int vref =
|
|
|
|
(caps & AC_PINCAP_VREF) >> AC_PINCAP_VREF_SHIFT;
|
|
|
|
snd_iprintf(buffer, " Vref caps:");
|
|
|
|
if (vref & AC_PINCAP_VREF_HIZ)
|
|
|
|
snd_iprintf(buffer, " HIZ");
|
|
|
|
if (vref & AC_PINCAP_VREF_50)
|
|
|
|
snd_iprintf(buffer, " 50");
|
|
|
|
if (vref & AC_PINCAP_VREF_GRD)
|
|
|
|
snd_iprintf(buffer, " GRD");
|
|
|
|
if (vref & AC_PINCAP_VREF_80)
|
|
|
|
snd_iprintf(buffer, " 80");
|
|
|
|
if (vref & AC_PINCAP_VREF_100)
|
|
|
|
snd_iprintf(buffer, " 100");
|
|
|
|
snd_iprintf(buffer, "\n");
|
|
|
|
*supports_vref = 1;
|
|
|
|
} else
|
|
|
|
*supports_vref = 0;
|
|
|
|
if (caps & AC_PINCAP_EAPD) {
|
|
|
|
val = snd_hda_codec_read(codec, nid, 0,
|
|
|
|
AC_VERB_GET_EAPD_BTLENABLE, 0);
|
|
|
|
snd_iprintf(buffer, " EAPD 0x%x:", val);
|
|
|
|
if (val & AC_EAPDBTL_BALANCED)
|
|
|
|
snd_iprintf(buffer, " BALANCED");
|
|
|
|
if (val & AC_EAPDBTL_EAPD)
|
|
|
|
snd_iprintf(buffer, " EAPD");
|
|
|
|
if (val & AC_EAPDBTL_LR_SWAP)
|
|
|
|
snd_iprintf(buffer, " R/L");
|
|
|
|
snd_iprintf(buffer, "\n");
|
|
|
|
}
|
2005-04-16 22:20:36 +00:00
|
|
|
caps = snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_CONFIG_DEFAULT, 0);
|
2005-04-20 11:44:08 +00:00
|
|
|
snd_iprintf(buffer, " Pin Default 0x%08x: [%s] %s at %s %s\n", caps,
|
|
|
|
jack_conns[(caps & AC_DEFCFG_PORT_CONN) >> AC_DEFCFG_PORT_CONN_SHIFT],
|
2015-08-17 12:44:24 +00:00
|
|
|
get_jack_type(caps),
|
|
|
|
get_jack_connectivity(caps),
|
|
|
|
get_jack_location(caps));
|
2005-04-16 22:20:36 +00:00
|
|
|
snd_iprintf(buffer, " Conn = %s, Color = %s\n",
|
|
|
|
get_jack_connection(caps),
|
|
|
|
get_jack_color(caps));
|
[ALSA] hda_proc - Add a number of new settings to proc codec output
This patch adds additional output to the /proc codec#X info.
The following pieces of information are added to the output:
- Balanced, L/R swap, trigger, impedance sense pin capabilities
- Vref pin capabilities
- Current Vref pin widget control setting
- Default configuration association, sequence, and misc bit test
- EAPD/BTL bits conveying balanced mode, EAPD, and L/R swap
- Power state modified to show state name as well as setting vs actual value
- GPIO parameter output on Audio Function Group, including enumeration of IO
pins which are indicated present (Any I and O pins are not output at this
time)
- Stripe and L/R swap widget capabilities
- All digital converter bits: enable, validity, validity config, preemphasis,
copyright, non-audio, professional, generation level, and content category
- Converter stream and channel values for in/out widgets
- SDI select value for in widgets
- Unsolicited response widget capability tag and enabled bit
- Delay widget capability value
- Processing widget capability benign bit and number of coefficients
- Realtek Define Registers: processing coefficient, coefficient index
[Also, fixed space/tab issues and make codes a bit more readable
-- Takashi]
Signed-off-by: Andrew Paprocki <andrew@ishiboo.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-01-18 11:51:11 +00:00
|
|
|
/* Default association and sequence values refer to default grouping
|
|
|
|
* of pin complexes and their sequence within the group. This is used
|
|
|
|
* for priority and resource allocation.
|
|
|
|
*/
|
|
|
|
snd_iprintf(buffer, " DefAssociation = 0x%x, Sequence = 0x%x\n",
|
|
|
|
(caps & AC_DEFCFG_DEF_ASSOC) >> AC_DEFCFG_ASSOC_SHIFT,
|
|
|
|
caps & AC_DEFCFG_SEQUENCE);
|
|
|
|
if (((caps & AC_DEFCFG_MISC) >> AC_DEFCFG_MISC_SHIFT) &
|
|
|
|
AC_DEFCFG_MISC_NO_PRESENCE) {
|
|
|
|
/* Miscellaneous bit indicates external hardware does not
|
|
|
|
* support presence detection even if the pin complex
|
|
|
|
* indicates it is supported.
|
|
|
|
*/
|
|
|
|
snd_iprintf(buffer, " Misc = NO_PRESENCE\n");
|
2007-10-26 12:56:36 +00:00
|
|
|
}
|
2005-04-16 22:20:36 +00:00
|
|
|
}
|
|
|
|
|
[ALSA] hda_proc - Add a number of new settings to proc codec output
This patch adds additional output to the /proc codec#X info.
The following pieces of information are added to the output:
- Balanced, L/R swap, trigger, impedance sense pin capabilities
- Vref pin capabilities
- Current Vref pin widget control setting
- Default configuration association, sequence, and misc bit test
- EAPD/BTL bits conveying balanced mode, EAPD, and L/R swap
- Power state modified to show state name as well as setting vs actual value
- GPIO parameter output on Audio Function Group, including enumeration of IO
pins which are indicated present (Any I and O pins are not output at this
time)
- Stripe and L/R swap widget capabilities
- All digital converter bits: enable, validity, validity config, preemphasis,
copyright, non-audio, professional, generation level, and content category
- Converter stream and channel values for in/out widgets
- SDI select value for in widgets
- Unsolicited response widget capability tag and enabled bit
- Delay widget capability value
- Processing widget capability benign bit and number of coefficients
- Realtek Define Registers: processing coefficient, coefficient index
[Also, fixed space/tab issues and make codes a bit more readable
-- Takashi]
Signed-off-by: Andrew Paprocki <andrew@ishiboo.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-01-18 11:51:11 +00:00
|
|
|
static void print_pin_ctls(struct snd_info_buffer *buffer,
|
|
|
|
struct hda_codec *codec, hda_nid_t nid,
|
|
|
|
int supports_vref)
|
|
|
|
{
|
|
|
|
unsigned int pinctls;
|
|
|
|
|
|
|
|
pinctls = snd_hda_codec_read(codec, nid, 0,
|
|
|
|
AC_VERB_GET_PIN_WIDGET_CONTROL, 0);
|
|
|
|
snd_iprintf(buffer, " Pin-ctls: 0x%02x:", pinctls);
|
|
|
|
if (pinctls & AC_PINCTL_IN_EN)
|
|
|
|
snd_iprintf(buffer, " IN");
|
|
|
|
if (pinctls & AC_PINCTL_OUT_EN)
|
|
|
|
snd_iprintf(buffer, " OUT");
|
|
|
|
if (pinctls & AC_PINCTL_HP_EN)
|
|
|
|
snd_iprintf(buffer, " HP");
|
|
|
|
if (supports_vref) {
|
|
|
|
int vref = pinctls & AC_PINCTL_VREFEN;
|
|
|
|
switch (vref) {
|
|
|
|
case AC_PINCTL_VREF_HIZ:
|
|
|
|
snd_iprintf(buffer, " VREF_HIZ");
|
|
|
|
break;
|
|
|
|
case AC_PINCTL_VREF_50:
|
|
|
|
snd_iprintf(buffer, " VREF_50");
|
|
|
|
break;
|
|
|
|
case AC_PINCTL_VREF_GRD:
|
|
|
|
snd_iprintf(buffer, " VREF_GRD");
|
|
|
|
break;
|
|
|
|
case AC_PINCTL_VREF_80:
|
|
|
|
snd_iprintf(buffer, " VREF_80");
|
|
|
|
break;
|
|
|
|
case AC_PINCTL_VREF_100:
|
|
|
|
snd_iprintf(buffer, " VREF_100");
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
snd_iprintf(buffer, "\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
static void print_vol_knob(struct snd_info_buffer *buffer,
|
|
|
|
struct hda_codec *codec, hda_nid_t nid)
|
|
|
|
{
|
2015-03-03 22:29:47 +00:00
|
|
|
unsigned int cap = param_read(codec, nid, AC_PAR_VOL_KNB_CAP);
|
[ALSA] hda_proc - Add a number of new settings to proc codec output
This patch adds additional output to the /proc codec#X info.
The following pieces of information are added to the output:
- Balanced, L/R swap, trigger, impedance sense pin capabilities
- Vref pin capabilities
- Current Vref pin widget control setting
- Default configuration association, sequence, and misc bit test
- EAPD/BTL bits conveying balanced mode, EAPD, and L/R swap
- Power state modified to show state name as well as setting vs actual value
- GPIO parameter output on Audio Function Group, including enumeration of IO
pins which are indicated present (Any I and O pins are not output at this
time)
- Stripe and L/R swap widget capabilities
- All digital converter bits: enable, validity, validity config, preemphasis,
copyright, non-audio, professional, generation level, and content category
- Converter stream and channel values for in/out widgets
- SDI select value for in widgets
- Unsolicited response widget capability tag and enabled bit
- Delay widget capability value
- Processing widget capability benign bit and number of coefficients
- Realtek Define Registers: processing coefficient, coefficient index
[Also, fixed space/tab issues and make codes a bit more readable
-- Takashi]
Signed-off-by: Andrew Paprocki <andrew@ishiboo.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-01-18 11:51:11 +00:00
|
|
|
snd_iprintf(buffer, " Volume-Knob: delta=%d, steps=%d, ",
|
|
|
|
(cap >> 7) & 1, cap & 0x7f);
|
|
|
|
cap = snd_hda_codec_read(codec, nid, 0,
|
|
|
|
AC_VERB_GET_VOLUME_KNOB_CONTROL, 0);
|
|
|
|
snd_iprintf(buffer, "direct=%d, val=%d\n",
|
|
|
|
(cap >> 7) & 1, cap & 0x7f);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void print_audio_io(struct snd_info_buffer *buffer,
|
|
|
|
struct hda_codec *codec, hda_nid_t nid,
|
|
|
|
unsigned int wid_type)
|
|
|
|
{
|
2009-11-11 12:43:01 +00:00
|
|
|
int conv = snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_CONV, 0);
|
[ALSA] hda_proc - Add a number of new settings to proc codec output
This patch adds additional output to the /proc codec#X info.
The following pieces of information are added to the output:
- Balanced, L/R swap, trigger, impedance sense pin capabilities
- Vref pin capabilities
- Current Vref pin widget control setting
- Default configuration association, sequence, and misc bit test
- EAPD/BTL bits conveying balanced mode, EAPD, and L/R swap
- Power state modified to show state name as well as setting vs actual value
- GPIO parameter output on Audio Function Group, including enumeration of IO
pins which are indicated present (Any I and O pins are not output at this
time)
- Stripe and L/R swap widget capabilities
- All digital converter bits: enable, validity, validity config, preemphasis,
copyright, non-audio, professional, generation level, and content category
- Converter stream and channel values for in/out widgets
- SDI select value for in widgets
- Unsolicited response widget capability tag and enabled bit
- Delay widget capability value
- Processing widget capability benign bit and number of coefficients
- Realtek Define Registers: processing coefficient, coefficient index
[Also, fixed space/tab issues and make codes a bit more readable
-- Takashi]
Signed-off-by: Andrew Paprocki <andrew@ishiboo.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-01-18 11:51:11 +00:00
|
|
|
snd_iprintf(buffer,
|
|
|
|
" Converter: stream=%d, channel=%d\n",
|
|
|
|
(conv & AC_CONV_STREAM) >> AC_CONV_STREAM_SHIFT,
|
|
|
|
conv & AC_CONV_CHANNEL);
|
|
|
|
|
|
|
|
if (wid_type == AC_WID_AUD_IN && (conv & AC_CONV_CHANNEL) == 0) {
|
|
|
|
int sdi = snd_hda_codec_read(codec, nid, 0,
|
|
|
|
AC_VERB_GET_SDI_SELECT, 0);
|
|
|
|
snd_iprintf(buffer, " SDI-Select: %d\n",
|
|
|
|
sdi & AC_SDI_SELECT);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void print_digital_conv(struct snd_info_buffer *buffer,
|
|
|
|
struct hda_codec *codec, hda_nid_t nid)
|
|
|
|
{
|
|
|
|
unsigned int digi1 = snd_hda_codec_read(codec, nid, 0,
|
|
|
|
AC_VERB_GET_DIGI_CONVERT_1, 0);
|
2012-08-13 07:43:49 +00:00
|
|
|
unsigned char digi2 = digi1 >> 8;
|
|
|
|
unsigned char digi3 = digi1 >> 16;
|
|
|
|
|
[ALSA] hda_proc - Add a number of new settings to proc codec output
This patch adds additional output to the /proc codec#X info.
The following pieces of information are added to the output:
- Balanced, L/R swap, trigger, impedance sense pin capabilities
- Vref pin capabilities
- Current Vref pin widget control setting
- Default configuration association, sequence, and misc bit test
- EAPD/BTL bits conveying balanced mode, EAPD, and L/R swap
- Power state modified to show state name as well as setting vs actual value
- GPIO parameter output on Audio Function Group, including enumeration of IO
pins which are indicated present (Any I and O pins are not output at this
time)
- Stripe and L/R swap widget capabilities
- All digital converter bits: enable, validity, validity config, preemphasis,
copyright, non-audio, professional, generation level, and content category
- Converter stream and channel values for in/out widgets
- SDI select value for in widgets
- Unsolicited response widget capability tag and enabled bit
- Delay widget capability value
- Processing widget capability benign bit and number of coefficients
- Realtek Define Registers: processing coefficient, coefficient index
[Also, fixed space/tab issues and make codes a bit more readable
-- Takashi]
Signed-off-by: Andrew Paprocki <andrew@ishiboo.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-01-18 11:51:11 +00:00
|
|
|
snd_iprintf(buffer, " Digital:");
|
|
|
|
if (digi1 & AC_DIG1_ENABLE)
|
|
|
|
snd_iprintf(buffer, " Enabled");
|
|
|
|
if (digi1 & AC_DIG1_V)
|
|
|
|
snd_iprintf(buffer, " Validity");
|
|
|
|
if (digi1 & AC_DIG1_VCFG)
|
|
|
|
snd_iprintf(buffer, " ValidityCfg");
|
|
|
|
if (digi1 & AC_DIG1_EMPHASIS)
|
|
|
|
snd_iprintf(buffer, " Preemphasis");
|
|
|
|
if (digi1 & AC_DIG1_COPYRIGHT)
|
2012-08-13 06:11:10 +00:00
|
|
|
snd_iprintf(buffer, " Non-Copyright");
|
[ALSA] hda_proc - Add a number of new settings to proc codec output
This patch adds additional output to the /proc codec#X info.
The following pieces of information are added to the output:
- Balanced, L/R swap, trigger, impedance sense pin capabilities
- Vref pin capabilities
- Current Vref pin widget control setting
- Default configuration association, sequence, and misc bit test
- EAPD/BTL bits conveying balanced mode, EAPD, and L/R swap
- Power state modified to show state name as well as setting vs actual value
- GPIO parameter output on Audio Function Group, including enumeration of IO
pins which are indicated present (Any I and O pins are not output at this
time)
- Stripe and L/R swap widget capabilities
- All digital converter bits: enable, validity, validity config, preemphasis,
copyright, non-audio, professional, generation level, and content category
- Converter stream and channel values for in/out widgets
- SDI select value for in widgets
- Unsolicited response widget capability tag and enabled bit
- Delay widget capability value
- Processing widget capability benign bit and number of coefficients
- Realtek Define Registers: processing coefficient, coefficient index
[Also, fixed space/tab issues and make codes a bit more readable
-- Takashi]
Signed-off-by: Andrew Paprocki <andrew@ishiboo.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-01-18 11:51:11 +00:00
|
|
|
if (digi1 & AC_DIG1_NONAUDIO)
|
|
|
|
snd_iprintf(buffer, " Non-Audio");
|
|
|
|
if (digi1 & AC_DIG1_PROFESSIONAL)
|
|
|
|
snd_iprintf(buffer, " Pro");
|
|
|
|
if (digi1 & AC_DIG1_LEVEL)
|
|
|
|
snd_iprintf(buffer, " GenLevel");
|
2012-08-13 07:43:49 +00:00
|
|
|
if (digi3 & AC_DIG3_KAE)
|
|
|
|
snd_iprintf(buffer, " KAE");
|
[ALSA] hda_proc - Add a number of new settings to proc codec output
This patch adds additional output to the /proc codec#X info.
The following pieces of information are added to the output:
- Balanced, L/R swap, trigger, impedance sense pin capabilities
- Vref pin capabilities
- Current Vref pin widget control setting
- Default configuration association, sequence, and misc bit test
- EAPD/BTL bits conveying balanced mode, EAPD, and L/R swap
- Power state modified to show state name as well as setting vs actual value
- GPIO parameter output on Audio Function Group, including enumeration of IO
pins which are indicated present (Any I and O pins are not output at this
time)
- Stripe and L/R swap widget capabilities
- All digital converter bits: enable, validity, validity config, preemphasis,
copyright, non-audio, professional, generation level, and content category
- Converter stream and channel values for in/out widgets
- SDI select value for in widgets
- Unsolicited response widget capability tag and enabled bit
- Delay widget capability value
- Processing widget capability benign bit and number of coefficients
- Realtek Define Registers: processing coefficient, coefficient index
[Also, fixed space/tab issues and make codes a bit more readable
-- Takashi]
Signed-off-by: Andrew Paprocki <andrew@ishiboo.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-01-18 11:51:11 +00:00
|
|
|
snd_iprintf(buffer, "\n");
|
2008-06-19 13:41:37 +00:00
|
|
|
snd_iprintf(buffer, " Digital category: 0x%x\n",
|
2012-08-13 07:43:49 +00:00
|
|
|
digi2 & AC_DIG2_CC);
|
|
|
|
snd_iprintf(buffer, " IEC Coding Type: 0x%x\n",
|
|
|
|
digi3 & AC_DIG3_ICT);
|
[ALSA] hda_proc - Add a number of new settings to proc codec output
This patch adds additional output to the /proc codec#X info.
The following pieces of information are added to the output:
- Balanced, L/R swap, trigger, impedance sense pin capabilities
- Vref pin capabilities
- Current Vref pin widget control setting
- Default configuration association, sequence, and misc bit test
- EAPD/BTL bits conveying balanced mode, EAPD, and L/R swap
- Power state modified to show state name as well as setting vs actual value
- GPIO parameter output on Audio Function Group, including enumeration of IO
pins which are indicated present (Any I and O pins are not output at this
time)
- Stripe and L/R swap widget capabilities
- All digital converter bits: enable, validity, validity config, preemphasis,
copyright, non-audio, professional, generation level, and content category
- Converter stream and channel values for in/out widgets
- SDI select value for in widgets
- Unsolicited response widget capability tag and enabled bit
- Delay widget capability value
- Processing widget capability benign bit and number of coefficients
- Realtek Define Registers: processing coefficient, coefficient index
[Also, fixed space/tab issues and make codes a bit more readable
-- Takashi]
Signed-off-by: Andrew Paprocki <andrew@ishiboo.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-01-18 11:51:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static const char *get_pwr_state(u32 state)
|
|
|
|
{
|
2012-06-06 10:17:20 +00:00
|
|
|
static const char * const buf[] = {
|
|
|
|
"D0", "D1", "D2", "D3", "D3cold"
|
[ALSA] hda_proc - Add a number of new settings to proc codec output
This patch adds additional output to the /proc codec#X info.
The following pieces of information are added to the output:
- Balanced, L/R swap, trigger, impedance sense pin capabilities
- Vref pin capabilities
- Current Vref pin widget control setting
- Default configuration association, sequence, and misc bit test
- EAPD/BTL bits conveying balanced mode, EAPD, and L/R swap
- Power state modified to show state name as well as setting vs actual value
- GPIO parameter output on Audio Function Group, including enumeration of IO
pins which are indicated present (Any I and O pins are not output at this
time)
- Stripe and L/R swap widget capabilities
- All digital converter bits: enable, validity, validity config, preemphasis,
copyright, non-audio, professional, generation level, and content category
- Converter stream and channel values for in/out widgets
- SDI select value for in widgets
- Unsolicited response widget capability tag and enabled bit
- Delay widget capability value
- Processing widget capability benign bit and number of coefficients
- Realtek Define Registers: processing coefficient, coefficient index
[Also, fixed space/tab issues and make codes a bit more readable
-- Takashi]
Signed-off-by: Andrew Paprocki <andrew@ishiboo.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-01-18 11:51:11 +00:00
|
|
|
};
|
2012-06-06 10:17:20 +00:00
|
|
|
if (state < ARRAY_SIZE(buf))
|
[ALSA] hda_proc - Add a number of new settings to proc codec output
This patch adds additional output to the /proc codec#X info.
The following pieces of information are added to the output:
- Balanced, L/R swap, trigger, impedance sense pin capabilities
- Vref pin capabilities
- Current Vref pin widget control setting
- Default configuration association, sequence, and misc bit test
- EAPD/BTL bits conveying balanced mode, EAPD, and L/R swap
- Power state modified to show state name as well as setting vs actual value
- GPIO parameter output on Audio Function Group, including enumeration of IO
pins which are indicated present (Any I and O pins are not output at this
time)
- Stripe and L/R swap widget capabilities
- All digital converter bits: enable, validity, validity config, preemphasis,
copyright, non-audio, professional, generation level, and content category
- Converter stream and channel values for in/out widgets
- SDI select value for in widgets
- Unsolicited response widget capability tag and enabled bit
- Delay widget capability value
- Processing widget capability benign bit and number of coefficients
- Realtek Define Registers: processing coefficient, coefficient index
[Also, fixed space/tab issues and make codes a bit more readable
-- Takashi]
Signed-off-by: Andrew Paprocki <andrew@ishiboo.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-01-18 11:51:11 +00:00
|
|
|
return buf[state];
|
|
|
|
return "UNKNOWN";
|
|
|
|
}
|
|
|
|
|
|
|
|
static void print_power_state(struct snd_info_buffer *buffer,
|
|
|
|
struct hda_codec *codec, hda_nid_t nid)
|
|
|
|
{
|
2015-08-17 12:52:51 +00:00
|
|
|
static const char * const names[] = {
|
2009-11-18 04:38:08 +00:00
|
|
|
[ilog2(AC_PWRST_D0SUP)] = "D0",
|
|
|
|
[ilog2(AC_PWRST_D1SUP)] = "D1",
|
|
|
|
[ilog2(AC_PWRST_D2SUP)] = "D2",
|
|
|
|
[ilog2(AC_PWRST_D3SUP)] = "D3",
|
|
|
|
[ilog2(AC_PWRST_D3COLDSUP)] = "D3cold",
|
|
|
|
[ilog2(AC_PWRST_S3D3COLDSUP)] = "S3D3cold",
|
|
|
|
[ilog2(AC_PWRST_CLKSTOP)] = "CLKSTOP",
|
|
|
|
[ilog2(AC_PWRST_EPSS)] = "EPSS",
|
|
|
|
};
|
|
|
|
|
2015-03-03 22:29:47 +00:00
|
|
|
int sup = param_read(codec, nid, AC_PAR_POWER_STATE);
|
[ALSA] hda_proc - Add a number of new settings to proc codec output
This patch adds additional output to the /proc codec#X info.
The following pieces of information are added to the output:
- Balanced, L/R swap, trigger, impedance sense pin capabilities
- Vref pin capabilities
- Current Vref pin widget control setting
- Default configuration association, sequence, and misc bit test
- EAPD/BTL bits conveying balanced mode, EAPD, and L/R swap
- Power state modified to show state name as well as setting vs actual value
- GPIO parameter output on Audio Function Group, including enumeration of IO
pins which are indicated present (Any I and O pins are not output at this
time)
- Stripe and L/R swap widget capabilities
- All digital converter bits: enable, validity, validity config, preemphasis,
copyright, non-audio, professional, generation level, and content category
- Converter stream and channel values for in/out widgets
- SDI select value for in widgets
- Unsolicited response widget capability tag and enabled bit
- Delay widget capability value
- Processing widget capability benign bit and number of coefficients
- Realtek Define Registers: processing coefficient, coefficient index
[Also, fixed space/tab issues and make codes a bit more readable
-- Takashi]
Signed-off-by: Andrew Paprocki <andrew@ishiboo.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-01-18 11:51:11 +00:00
|
|
|
int pwr = snd_hda_codec_read(codec, nid, 0,
|
|
|
|
AC_VERB_GET_POWER_STATE, 0);
|
2015-08-17 12:57:32 +00:00
|
|
|
if (sup != -1) {
|
|
|
|
int i;
|
|
|
|
|
|
|
|
snd_iprintf(buffer, " Power states: ");
|
|
|
|
for (i = 0; i < ARRAY_SIZE(names); i++) {
|
|
|
|
if (sup & (1U << i))
|
|
|
|
snd_iprintf(buffer, " %s", names[i]);
|
|
|
|
}
|
|
|
|
snd_iprintf(buffer, "\n");
|
|
|
|
}
|
2009-11-18 04:38:08 +00:00
|
|
|
|
2012-06-06 05:49:44 +00:00
|
|
|
snd_iprintf(buffer, " Power: setting=%s, actual=%s",
|
[ALSA] hda_proc - Add a number of new settings to proc codec output
This patch adds additional output to the /proc codec#X info.
The following pieces of information are added to the output:
- Balanced, L/R swap, trigger, impedance sense pin capabilities
- Vref pin capabilities
- Current Vref pin widget control setting
- Default configuration association, sequence, and misc bit test
- EAPD/BTL bits conveying balanced mode, EAPD, and L/R swap
- Power state modified to show state name as well as setting vs actual value
- GPIO parameter output on Audio Function Group, including enumeration of IO
pins which are indicated present (Any I and O pins are not output at this
time)
- Stripe and L/R swap widget capabilities
- All digital converter bits: enable, validity, validity config, preemphasis,
copyright, non-audio, professional, generation level, and content category
- Converter stream and channel values for in/out widgets
- SDI select value for in widgets
- Unsolicited response widget capability tag and enabled bit
- Delay widget capability value
- Processing widget capability benign bit and number of coefficients
- Realtek Define Registers: processing coefficient, coefficient index
[Also, fixed space/tab issues and make codes a bit more readable
-- Takashi]
Signed-off-by: Andrew Paprocki <andrew@ishiboo.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-01-18 11:51:11 +00:00
|
|
|
get_pwr_state(pwr & AC_PWRST_SETTING),
|
|
|
|
get_pwr_state((pwr & AC_PWRST_ACTUAL) >>
|
|
|
|
AC_PWRST_ACTUAL_SHIFT));
|
2012-06-06 05:49:44 +00:00
|
|
|
if (pwr & AC_PWRST_ERROR)
|
|
|
|
snd_iprintf(buffer, ", Error");
|
|
|
|
if (pwr & AC_PWRST_CLK_STOP_OK)
|
|
|
|
snd_iprintf(buffer, ", Clock-stop-OK");
|
|
|
|
if (pwr & AC_PWRST_SETTING_RESET)
|
|
|
|
snd_iprintf(buffer, ", Setting-reset");
|
|
|
|
snd_iprintf(buffer, "\n");
|
[ALSA] hda_proc - Add a number of new settings to proc codec output
This patch adds additional output to the /proc codec#X info.
The following pieces of information are added to the output:
- Balanced, L/R swap, trigger, impedance sense pin capabilities
- Vref pin capabilities
- Current Vref pin widget control setting
- Default configuration association, sequence, and misc bit test
- EAPD/BTL bits conveying balanced mode, EAPD, and L/R swap
- Power state modified to show state name as well as setting vs actual value
- GPIO parameter output on Audio Function Group, including enumeration of IO
pins which are indicated present (Any I and O pins are not output at this
time)
- Stripe and L/R swap widget capabilities
- All digital converter bits: enable, validity, validity config, preemphasis,
copyright, non-audio, professional, generation level, and content category
- Converter stream and channel values for in/out widgets
- SDI select value for in widgets
- Unsolicited response widget capability tag and enabled bit
- Delay widget capability value
- Processing widget capability benign bit and number of coefficients
- Realtek Define Registers: processing coefficient, coefficient index
[Also, fixed space/tab issues and make codes a bit more readable
-- Takashi]
Signed-off-by: Andrew Paprocki <andrew@ishiboo.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-01-18 11:51:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void print_unsol_cap(struct snd_info_buffer *buffer,
|
|
|
|
struct hda_codec *codec, hda_nid_t nid)
|
|
|
|
{
|
|
|
|
int unsol = snd_hda_codec_read(codec, nid, 0,
|
|
|
|
AC_VERB_GET_UNSOLICITED_RESPONSE, 0);
|
|
|
|
snd_iprintf(buffer,
|
|
|
|
" Unsolicited: tag=%02x, enabled=%d\n",
|
|
|
|
unsol & AC_UNSOL_TAG,
|
|
|
|
(unsol & AC_UNSOL_ENABLED) ? 1 : 0);
|
|
|
|
}
|
|
|
|
|
2014-01-29 09:37:10 +00:00
|
|
|
static inline bool can_dump_coef(struct hda_codec *codec)
|
|
|
|
{
|
|
|
|
switch (dump_coef) {
|
|
|
|
case 0: return false;
|
|
|
|
case 1: return true;
|
|
|
|
default: return codec->dump_coef;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
[ALSA] hda_proc - Add a number of new settings to proc codec output
This patch adds additional output to the /proc codec#X info.
The following pieces of information are added to the output:
- Balanced, L/R swap, trigger, impedance sense pin capabilities
- Vref pin capabilities
- Current Vref pin widget control setting
- Default configuration association, sequence, and misc bit test
- EAPD/BTL bits conveying balanced mode, EAPD, and L/R swap
- Power state modified to show state name as well as setting vs actual value
- GPIO parameter output on Audio Function Group, including enumeration of IO
pins which are indicated present (Any I and O pins are not output at this
time)
- Stripe and L/R swap widget capabilities
- All digital converter bits: enable, validity, validity config, preemphasis,
copyright, non-audio, professional, generation level, and content category
- Converter stream and channel values for in/out widgets
- SDI select value for in widgets
- Unsolicited response widget capability tag and enabled bit
- Delay widget capability value
- Processing widget capability benign bit and number of coefficients
- Realtek Define Registers: processing coefficient, coefficient index
[Also, fixed space/tab issues and make codes a bit more readable
-- Takashi]
Signed-off-by: Andrew Paprocki <andrew@ishiboo.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-01-18 11:51:11 +00:00
|
|
|
static void print_proc_caps(struct snd_info_buffer *buffer,
|
|
|
|
struct hda_codec *codec, hda_nid_t nid)
|
|
|
|
{
|
2014-01-29 09:37:10 +00:00
|
|
|
unsigned int i, ncoeff, oldindex;
|
2015-03-03 22:29:47 +00:00
|
|
|
unsigned int proc_caps = param_read(codec, nid, AC_PAR_PROC_CAP);
|
2014-01-29 09:37:10 +00:00
|
|
|
ncoeff = (proc_caps & AC_PCAP_NUM_COEF) >> AC_PCAP_NUM_COEF_SHIFT;
|
[ALSA] hda_proc - Add a number of new settings to proc codec output
This patch adds additional output to the /proc codec#X info.
The following pieces of information are added to the output:
- Balanced, L/R swap, trigger, impedance sense pin capabilities
- Vref pin capabilities
- Current Vref pin widget control setting
- Default configuration association, sequence, and misc bit test
- EAPD/BTL bits conveying balanced mode, EAPD, and L/R swap
- Power state modified to show state name as well as setting vs actual value
- GPIO parameter output on Audio Function Group, including enumeration of IO
pins which are indicated present (Any I and O pins are not output at this
time)
- Stripe and L/R swap widget capabilities
- All digital converter bits: enable, validity, validity config, preemphasis,
copyright, non-audio, professional, generation level, and content category
- Converter stream and channel values for in/out widgets
- SDI select value for in widgets
- Unsolicited response widget capability tag and enabled bit
- Delay widget capability value
- Processing widget capability benign bit and number of coefficients
- Realtek Define Registers: processing coefficient, coefficient index
[Also, fixed space/tab issues and make codes a bit more readable
-- Takashi]
Signed-off-by: Andrew Paprocki <andrew@ishiboo.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-01-18 11:51:11 +00:00
|
|
|
snd_iprintf(buffer, " Processing caps: benign=%d, ncoeff=%d\n",
|
2014-01-29 09:37:10 +00:00
|
|
|
proc_caps & AC_PCAP_BENIGN, ncoeff);
|
|
|
|
|
|
|
|
if (!can_dump_coef(codec))
|
|
|
|
return;
|
|
|
|
|
|
|
|
/* Note: This is racy - another process could run in parallel and change
|
|
|
|
the coef index too. */
|
|
|
|
oldindex = snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_COEF_INDEX, 0);
|
|
|
|
for (i = 0; i < ncoeff; i++) {
|
|
|
|
unsigned int val;
|
|
|
|
snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_COEF_INDEX, i);
|
|
|
|
val = snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_PROC_COEF,
|
|
|
|
0);
|
|
|
|
snd_iprintf(buffer, " Coeff 0x%02x: 0x%04x\n", i, val);
|
|
|
|
}
|
|
|
|
snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_COEF_INDEX, oldindex);
|
[ALSA] hda_proc - Add a number of new settings to proc codec output
This patch adds additional output to the /proc codec#X info.
The following pieces of information are added to the output:
- Balanced, L/R swap, trigger, impedance sense pin capabilities
- Vref pin capabilities
- Current Vref pin widget control setting
- Default configuration association, sequence, and misc bit test
- EAPD/BTL bits conveying balanced mode, EAPD, and L/R swap
- Power state modified to show state name as well as setting vs actual value
- GPIO parameter output on Audio Function Group, including enumeration of IO
pins which are indicated present (Any I and O pins are not output at this
time)
- Stripe and L/R swap widget capabilities
- All digital converter bits: enable, validity, validity config, preemphasis,
copyright, non-audio, professional, generation level, and content category
- Converter stream and channel values for in/out widgets
- SDI select value for in widgets
- Unsolicited response widget capability tag and enabled bit
- Delay widget capability value
- Processing widget capability benign bit and number of coefficients
- Realtek Define Registers: processing coefficient, coefficient index
[Also, fixed space/tab issues and make codes a bit more readable
-- Takashi]
Signed-off-by: Andrew Paprocki <andrew@ishiboo.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-01-18 11:51:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void print_conn_list(struct snd_info_buffer *buffer,
|
|
|
|
struct hda_codec *codec, hda_nid_t nid,
|
|
|
|
unsigned int wid_type, hda_nid_t *conn,
|
|
|
|
int conn_len)
|
|
|
|
{
|
|
|
|
int c, curr = -1;
|
2013-06-25 03:41:23 +00:00
|
|
|
const hda_nid_t *list;
|
|
|
|
int cache_len;
|
[ALSA] hda_proc - Add a number of new settings to proc codec output
This patch adds additional output to the /proc codec#X info.
The following pieces of information are added to the output:
- Balanced, L/R swap, trigger, impedance sense pin capabilities
- Vref pin capabilities
- Current Vref pin widget control setting
- Default configuration association, sequence, and misc bit test
- EAPD/BTL bits conveying balanced mode, EAPD, and L/R swap
- Power state modified to show state name as well as setting vs actual value
- GPIO parameter output on Audio Function Group, including enumeration of IO
pins which are indicated present (Any I and O pins are not output at this
time)
- Stripe and L/R swap widget capabilities
- All digital converter bits: enable, validity, validity config, preemphasis,
copyright, non-audio, professional, generation level, and content category
- Converter stream and channel values for in/out widgets
- SDI select value for in widgets
- Unsolicited response widget capability tag and enabled bit
- Delay widget capability value
- Processing widget capability benign bit and number of coefficients
- Realtek Define Registers: processing coefficient, coefficient index
[Also, fixed space/tab issues and make codes a bit more readable
-- Takashi]
Signed-off-by: Andrew Paprocki <andrew@ishiboo.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-01-18 11:51:11 +00:00
|
|
|
|
2009-03-19 16:08:19 +00:00
|
|
|
if (conn_len > 1 &&
|
|
|
|
wid_type != AC_WID_AUD_MIX &&
|
|
|
|
wid_type != AC_WID_VOL_KNB &&
|
|
|
|
wid_type != AC_WID_POWER)
|
[ALSA] hda_proc - Add a number of new settings to proc codec output
This patch adds additional output to the /proc codec#X info.
The following pieces of information are added to the output:
- Balanced, L/R swap, trigger, impedance sense pin capabilities
- Vref pin capabilities
- Current Vref pin widget control setting
- Default configuration association, sequence, and misc bit test
- EAPD/BTL bits conveying balanced mode, EAPD, and L/R swap
- Power state modified to show state name as well as setting vs actual value
- GPIO parameter output on Audio Function Group, including enumeration of IO
pins which are indicated present (Any I and O pins are not output at this
time)
- Stripe and L/R swap widget capabilities
- All digital converter bits: enable, validity, validity config, preemphasis,
copyright, non-audio, professional, generation level, and content category
- Converter stream and channel values for in/out widgets
- SDI select value for in widgets
- Unsolicited response widget capability tag and enabled bit
- Delay widget capability value
- Processing widget capability benign bit and number of coefficients
- Realtek Define Registers: processing coefficient, coefficient index
[Also, fixed space/tab issues and make codes a bit more readable
-- Takashi]
Signed-off-by: Andrew Paprocki <andrew@ishiboo.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-01-18 11:51:11 +00:00
|
|
|
curr = snd_hda_codec_read(codec, nid, 0,
|
|
|
|
AC_VERB_GET_CONNECT_SEL, 0);
|
|
|
|
snd_iprintf(buffer, " Connection: %d\n", conn_len);
|
|
|
|
if (conn_len > 0) {
|
|
|
|
snd_iprintf(buffer, " ");
|
|
|
|
for (c = 0; c < conn_len; c++) {
|
|
|
|
snd_iprintf(buffer, " 0x%02x", conn[c]);
|
|
|
|
if (c == curr)
|
|
|
|
snd_iprintf(buffer, "*");
|
|
|
|
}
|
|
|
|
snd_iprintf(buffer, "\n");
|
|
|
|
}
|
2013-06-25 03:41:23 +00:00
|
|
|
|
|
|
|
/* Get Cache connections info */
|
|
|
|
cache_len = snd_hda_get_conn_list(codec, nid, &list);
|
2015-04-17 13:19:46 +00:00
|
|
|
if (cache_len >= 0 && (cache_len != conn_len ||
|
|
|
|
memcmp(list, conn, conn_len) != 0)) {
|
2013-06-25 03:41:23 +00:00
|
|
|
snd_iprintf(buffer, " In-driver Connection: %d\n", cache_len);
|
|
|
|
if (cache_len > 0) {
|
|
|
|
snd_iprintf(buffer, " ");
|
|
|
|
for (c = 0; c < cache_len; c++)
|
|
|
|
snd_iprintf(buffer, " 0x%02x", list[c]);
|
|
|
|
snd_iprintf(buffer, "\n");
|
|
|
|
}
|
|
|
|
}
|
[ALSA] hda_proc - Add a number of new settings to proc codec output
This patch adds additional output to the /proc codec#X info.
The following pieces of information are added to the output:
- Balanced, L/R swap, trigger, impedance sense pin capabilities
- Vref pin capabilities
- Current Vref pin widget control setting
- Default configuration association, sequence, and misc bit test
- EAPD/BTL bits conveying balanced mode, EAPD, and L/R swap
- Power state modified to show state name as well as setting vs actual value
- GPIO parameter output on Audio Function Group, including enumeration of IO
pins which are indicated present (Any I and O pins are not output at this
time)
- Stripe and L/R swap widget capabilities
- All digital converter bits: enable, validity, validity config, preemphasis,
copyright, non-audio, professional, generation level, and content category
- Converter stream and channel values for in/out widgets
- SDI select value for in widgets
- Unsolicited response widget capability tag and enabled bit
- Delay widget capability value
- Processing widget capability benign bit and number of coefficients
- Realtek Define Registers: processing coefficient, coefficient index
[Also, fixed space/tab issues and make codes a bit more readable
-- Takashi]
Signed-off-by: Andrew Paprocki <andrew@ishiboo.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-01-18 11:51:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void print_gpio(struct snd_info_buffer *buffer,
|
|
|
|
struct hda_codec *codec, hda_nid_t nid)
|
|
|
|
{
|
|
|
|
unsigned int gpio =
|
2015-03-03 22:29:47 +00:00
|
|
|
param_read(codec, codec->core.afg, AC_PAR_GPIO_CAP);
|
[ALSA] hda_proc - Add a number of new settings to proc codec output
This patch adds additional output to the /proc codec#X info.
The following pieces of information are added to the output:
- Balanced, L/R swap, trigger, impedance sense pin capabilities
- Vref pin capabilities
- Current Vref pin widget control setting
- Default configuration association, sequence, and misc bit test
- EAPD/BTL bits conveying balanced mode, EAPD, and L/R swap
- Power state modified to show state name as well as setting vs actual value
- GPIO parameter output on Audio Function Group, including enumeration of IO
pins which are indicated present (Any I and O pins are not output at this
time)
- Stripe and L/R swap widget capabilities
- All digital converter bits: enable, validity, validity config, preemphasis,
copyright, non-audio, professional, generation level, and content category
- Converter stream and channel values for in/out widgets
- SDI select value for in widgets
- Unsolicited response widget capability tag and enabled bit
- Delay widget capability value
- Processing widget capability benign bit and number of coefficients
- Realtek Define Registers: processing coefficient, coefficient index
[Also, fixed space/tab issues and make codes a bit more readable
-- Takashi]
Signed-off-by: Andrew Paprocki <andrew@ishiboo.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-01-18 11:51:11 +00:00
|
|
|
unsigned int enable, direction, wake, unsol, sticky, data;
|
|
|
|
int i, max;
|
|
|
|
snd_iprintf(buffer, "GPIO: io=%d, o=%d, i=%d, "
|
|
|
|
"unsolicited=%d, wake=%d\n",
|
|
|
|
gpio & AC_GPIO_IO_COUNT,
|
|
|
|
(gpio & AC_GPIO_O_COUNT) >> AC_GPIO_O_COUNT_SHIFT,
|
|
|
|
(gpio & AC_GPIO_I_COUNT) >> AC_GPIO_I_COUNT_SHIFT,
|
|
|
|
(gpio & AC_GPIO_UNSOLICITED) ? 1 : 0,
|
|
|
|
(gpio & AC_GPIO_WAKE) ? 1 : 0);
|
|
|
|
max = gpio & AC_GPIO_IO_COUNT;
|
2008-11-04 12:30:57 +00:00
|
|
|
if (!max || max > 8)
|
|
|
|
return;
|
[ALSA] hda_proc - Add a number of new settings to proc codec output
This patch adds additional output to the /proc codec#X info.
The following pieces of information are added to the output:
- Balanced, L/R swap, trigger, impedance sense pin capabilities
- Vref pin capabilities
- Current Vref pin widget control setting
- Default configuration association, sequence, and misc bit test
- EAPD/BTL bits conveying balanced mode, EAPD, and L/R swap
- Power state modified to show state name as well as setting vs actual value
- GPIO parameter output on Audio Function Group, including enumeration of IO
pins which are indicated present (Any I and O pins are not output at this
time)
- Stripe and L/R swap widget capabilities
- All digital converter bits: enable, validity, validity config, preemphasis,
copyright, non-audio, professional, generation level, and content category
- Converter stream and channel values for in/out widgets
- SDI select value for in widgets
- Unsolicited response widget capability tag and enabled bit
- Delay widget capability value
- Processing widget capability benign bit and number of coefficients
- Realtek Define Registers: processing coefficient, coefficient index
[Also, fixed space/tab issues and make codes a bit more readable
-- Takashi]
Signed-off-by: Andrew Paprocki <andrew@ishiboo.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-01-18 11:51:11 +00:00
|
|
|
enable = snd_hda_codec_read(codec, nid, 0,
|
|
|
|
AC_VERB_GET_GPIO_MASK, 0);
|
|
|
|
direction = snd_hda_codec_read(codec, nid, 0,
|
|
|
|
AC_VERB_GET_GPIO_DIRECTION, 0);
|
|
|
|
wake = snd_hda_codec_read(codec, nid, 0,
|
|
|
|
AC_VERB_GET_GPIO_WAKE_MASK, 0);
|
|
|
|
unsol = snd_hda_codec_read(codec, nid, 0,
|
|
|
|
AC_VERB_GET_GPIO_UNSOLICITED_RSP_MASK, 0);
|
|
|
|
sticky = snd_hda_codec_read(codec, nid, 0,
|
|
|
|
AC_VERB_GET_GPIO_STICKY_MASK, 0);
|
|
|
|
data = snd_hda_codec_read(codec, nid, 0,
|
|
|
|
AC_VERB_GET_GPIO_DATA, 0);
|
|
|
|
for (i = 0; i < max; ++i)
|
|
|
|
snd_iprintf(buffer,
|
|
|
|
" IO[%d]: enable=%d, dir=%d, wake=%d, "
|
2008-11-19 13:14:50 +00:00
|
|
|
"sticky=%d, data=%d, unsol=%d\n", i,
|
[ALSA] hda_proc - Add a number of new settings to proc codec output
This patch adds additional output to the /proc codec#X info.
The following pieces of information are added to the output:
- Balanced, L/R swap, trigger, impedance sense pin capabilities
- Vref pin capabilities
- Current Vref pin widget control setting
- Default configuration association, sequence, and misc bit test
- EAPD/BTL bits conveying balanced mode, EAPD, and L/R swap
- Power state modified to show state name as well as setting vs actual value
- GPIO parameter output on Audio Function Group, including enumeration of IO
pins which are indicated present (Any I and O pins are not output at this
time)
- Stripe and L/R swap widget capabilities
- All digital converter bits: enable, validity, validity config, preemphasis,
copyright, non-audio, professional, generation level, and content category
- Converter stream and channel values for in/out widgets
- SDI select value for in widgets
- Unsolicited response widget capability tag and enabled bit
- Delay widget capability value
- Processing widget capability benign bit and number of coefficients
- Realtek Define Registers: processing coefficient, coefficient index
[Also, fixed space/tab issues and make codes a bit more readable
-- Takashi]
Signed-off-by: Andrew Paprocki <andrew@ishiboo.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-01-18 11:51:11 +00:00
|
|
|
(enable & (1<<i)) ? 1 : 0,
|
|
|
|
(direction & (1<<i)) ? 1 : 0,
|
|
|
|
(wake & (1<<i)) ? 1 : 0,
|
|
|
|
(sticky & (1<<i)) ? 1 : 0,
|
2008-11-19 13:14:50 +00:00
|
|
|
(data & (1<<i)) ? 1 : 0,
|
|
|
|
(unsol & (1<<i)) ? 1 : 0);
|
[ALSA] hda_proc - Add a number of new settings to proc codec output
This patch adds additional output to the /proc codec#X info.
The following pieces of information are added to the output:
- Balanced, L/R swap, trigger, impedance sense pin capabilities
- Vref pin capabilities
- Current Vref pin widget control setting
- Default configuration association, sequence, and misc bit test
- EAPD/BTL bits conveying balanced mode, EAPD, and L/R swap
- Power state modified to show state name as well as setting vs actual value
- GPIO parameter output on Audio Function Group, including enumeration of IO
pins which are indicated present (Any I and O pins are not output at this
time)
- Stripe and L/R swap widget capabilities
- All digital converter bits: enable, validity, validity config, preemphasis,
copyright, non-audio, professional, generation level, and content category
- Converter stream and channel values for in/out widgets
- SDI select value for in widgets
- Unsolicited response widget capability tag and enabled bit
- Delay widget capability value
- Processing widget capability benign bit and number of coefficients
- Realtek Define Registers: processing coefficient, coefficient index
[Also, fixed space/tab issues and make codes a bit more readable
-- Takashi]
Signed-off-by: Andrew Paprocki <andrew@ishiboo.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-01-18 11:51:11 +00:00
|
|
|
/* FIXME: add GPO and GPI pin information */
|
2009-12-08 15:13:32 +00:00
|
|
|
print_nid_array(buffer, codec, nid, &codec->mixers);
|
|
|
|
print_nid_array(buffer, codec, nid, &codec->nids);
|
[ALSA] hda_proc - Add a number of new settings to proc codec output
This patch adds additional output to the /proc codec#X info.
The following pieces of information are added to the output:
- Balanced, L/R swap, trigger, impedance sense pin capabilities
- Vref pin capabilities
- Current Vref pin widget control setting
- Default configuration association, sequence, and misc bit test
- EAPD/BTL bits conveying balanced mode, EAPD, and L/R swap
- Power state modified to show state name as well as setting vs actual value
- GPIO parameter output on Audio Function Group, including enumeration of IO
pins which are indicated present (Any I and O pins are not output at this
time)
- Stripe and L/R swap widget capabilities
- All digital converter bits: enable, validity, validity config, preemphasis,
copyright, non-audio, professional, generation level, and content category
- Converter stream and channel values for in/out widgets
- SDI select value for in widgets
- Unsolicited response widget capability tag and enabled bit
- Delay widget capability value
- Processing widget capability benign bit and number of coefficients
- Realtek Define Registers: processing coefficient, coefficient index
[Also, fixed space/tab issues and make codes a bit more readable
-- Takashi]
Signed-off-by: Andrew Paprocki <andrew@ishiboo.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-01-18 11:51:11 +00:00
|
|
|
}
|
2005-04-16 22:20:36 +00:00
|
|
|
|
ALSA: hda/proc - print DP-MST connections
To help in debugging issues with DisplayPort Multi-Stream Transport (aka
DP-MST) support, print information of active connections for each device
of a display audio pin widget.
Example output with the patch with two monitors connected to a DP-MST hub:
Devices: 4
Dev 00: PD = 0, ELDV = 0, IA = 0, Connections [ 0x03* 0x05 0x07 0x09 ]
Dev 01: PD = 1, ELDV = 1, IA = 0, Connections [ 0x03* 0x05 0x07 0x09 ]
*Dev 02: PD = 1, ELDV = 1, IA = 0, Connections [ 0x03 0x05* 0x07 0x09 ]
Dev 03: PD = 0, ELDV = 0, IA = 0, Connections [ 0x03* 0x05 0x07 0x09 ]
Connection: 4
0x03 0x05* 0x07 0x09
Format of existing "Connection:" entry is left intact to keep
compatibility.
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20201208185736.2877541-1-kai.vehmanen@linux.intel.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-12-08 18:57:36 +00:00
|
|
|
static void print_dpmst_connections(struct snd_info_buffer *buffer, struct hda_codec *codec,
|
|
|
|
hda_nid_t nid, int dev_num)
|
|
|
|
{
|
|
|
|
int c, conn_len, curr, dev_id_saved;
|
|
|
|
hda_nid_t *conn;
|
|
|
|
|
|
|
|
conn_len = snd_hda_get_num_raw_conns(codec, nid);
|
|
|
|
if (conn_len <= 0)
|
|
|
|
return;
|
|
|
|
|
|
|
|
conn = kmalloc_array(conn_len, sizeof(hda_nid_t), GFP_KERNEL);
|
|
|
|
if (!conn)
|
|
|
|
return;
|
|
|
|
|
|
|
|
dev_id_saved = snd_hda_get_dev_select(codec, nid);
|
|
|
|
|
|
|
|
snd_hda_set_dev_select(codec, nid, dev_num);
|
|
|
|
curr = snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_CONNECT_SEL, 0);
|
|
|
|
if (snd_hda_get_raw_connections(codec, nid, conn, conn_len) < 0)
|
|
|
|
goto out;
|
|
|
|
|
|
|
|
for (c = 0; c < conn_len; c++) {
|
|
|
|
snd_iprintf(buffer, " 0x%02x", conn[c]);
|
|
|
|
if (c == curr)
|
|
|
|
snd_iprintf(buffer, "*");
|
|
|
|
}
|
|
|
|
|
|
|
|
out:
|
|
|
|
kfree(conn);
|
|
|
|
snd_hda_set_dev_select(codec, nid, dev_id_saved);
|
|
|
|
}
|
|
|
|
|
2013-08-27 01:35:31 +00:00
|
|
|
static void print_device_list(struct snd_info_buffer *buffer,
|
|
|
|
struct hda_codec *codec, hda_nid_t nid)
|
|
|
|
{
|
|
|
|
int i, curr = -1;
|
|
|
|
u8 dev_list[AC_MAX_DEV_LIST_LEN];
|
|
|
|
int devlist_len;
|
|
|
|
|
|
|
|
devlist_len = snd_hda_get_devices(codec, nid, dev_list,
|
|
|
|
AC_MAX_DEV_LIST_LEN);
|
|
|
|
snd_iprintf(buffer, " Devices: %d\n", devlist_len);
|
|
|
|
if (devlist_len <= 0)
|
|
|
|
return;
|
|
|
|
|
|
|
|
curr = snd_hda_codec_read(codec, nid, 0,
|
|
|
|
AC_VERB_GET_DEVICE_SEL, 0);
|
|
|
|
|
|
|
|
for (i = 0; i < devlist_len; i++) {
|
|
|
|
if (i == curr)
|
|
|
|
snd_iprintf(buffer, " *");
|
|
|
|
else
|
|
|
|
snd_iprintf(buffer, " ");
|
|
|
|
|
|
|
|
snd_iprintf(buffer,
|
ALSA: hda/proc - print DP-MST connections
To help in debugging issues with DisplayPort Multi-Stream Transport (aka
DP-MST) support, print information of active connections for each device
of a display audio pin widget.
Example output with the patch with two monitors connected to a DP-MST hub:
Devices: 4
Dev 00: PD = 0, ELDV = 0, IA = 0, Connections [ 0x03* 0x05 0x07 0x09 ]
Dev 01: PD = 1, ELDV = 1, IA = 0, Connections [ 0x03* 0x05 0x07 0x09 ]
*Dev 02: PD = 1, ELDV = 1, IA = 0, Connections [ 0x03 0x05* 0x07 0x09 ]
Dev 03: PD = 0, ELDV = 0, IA = 0, Connections [ 0x03* 0x05 0x07 0x09 ]
Connection: 4
0x03 0x05* 0x07 0x09
Format of existing "Connection:" entry is left intact to keep
compatibility.
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20201208185736.2877541-1-kai.vehmanen@linux.intel.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-12-08 18:57:36 +00:00
|
|
|
"Dev %02d: PD = %d, ELDV = %d, IA = %d, Connections [", i,
|
2013-08-27 01:35:31 +00:00
|
|
|
!!(dev_list[i] & AC_DE_PD),
|
|
|
|
!!(dev_list[i] & AC_DE_ELDV),
|
|
|
|
!!(dev_list[i] & AC_DE_IA));
|
ALSA: hda/proc - print DP-MST connections
To help in debugging issues with DisplayPort Multi-Stream Transport (aka
DP-MST) support, print information of active connections for each device
of a display audio pin widget.
Example output with the patch with two monitors connected to a DP-MST hub:
Devices: 4
Dev 00: PD = 0, ELDV = 0, IA = 0, Connections [ 0x03* 0x05 0x07 0x09 ]
Dev 01: PD = 1, ELDV = 1, IA = 0, Connections [ 0x03* 0x05 0x07 0x09 ]
*Dev 02: PD = 1, ELDV = 1, IA = 0, Connections [ 0x03 0x05* 0x07 0x09 ]
Dev 03: PD = 0, ELDV = 0, IA = 0, Connections [ 0x03* 0x05 0x07 0x09 ]
Connection: 4
0x03 0x05* 0x07 0x09
Format of existing "Connection:" entry is left intact to keep
compatibility.
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20201208185736.2877541-1-kai.vehmanen@linux.intel.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-12-08 18:57:36 +00:00
|
|
|
|
|
|
|
print_dpmst_connections(buffer, codec, nid, i);
|
|
|
|
|
|
|
|
snd_iprintf(buffer, " ]\n");
|
2013-08-27 01:35:31 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-03-03 09:07:24 +00:00
|
|
|
static void print_codec_core_info(struct hdac_device *codec,
|
|
|
|
struct snd_info_buffer *buffer)
|
2005-04-16 22:20:36 +00:00
|
|
|
{
|
2009-05-16 08:00:49 +00:00
|
|
|
snd_iprintf(buffer, "Codec: ");
|
|
|
|
if (codec->vendor_name && codec->chip_name)
|
|
|
|
snd_iprintf(buffer, "%s %s\n",
|
|
|
|
codec->vendor_name, codec->chip_name);
|
|
|
|
else
|
|
|
|
snd_iprintf(buffer, "Not Set\n");
|
2005-04-16 22:20:36 +00:00
|
|
|
snd_iprintf(buffer, "Address: %d\n", codec->addr);
|
2010-07-19 13:52:39 +00:00
|
|
|
if (codec->afg)
|
|
|
|
snd_iprintf(buffer, "AFG Function Id: 0x%x (unsol %u)\n",
|
|
|
|
codec->afg_function_id, codec->afg_unsol);
|
|
|
|
if (codec->mfg)
|
|
|
|
snd_iprintf(buffer, "MFG Function Id: 0x%x (unsol %u)\n",
|
|
|
|
codec->mfg_function_id, codec->mfg_unsol);
|
2009-03-23 10:15:59 +00:00
|
|
|
snd_iprintf(buffer, "Vendor Id: 0x%08x\n", codec->vendor_id);
|
|
|
|
snd_iprintf(buffer, "Subsystem Id: 0x%08x\n", codec->subsystem_id);
|
2005-04-16 22:20:36 +00:00
|
|
|
snd_iprintf(buffer, "Revision Id: 0x%x\n", codec->revision_id);
|
2007-06-19 16:31:28 +00:00
|
|
|
|
|
|
|
if (codec->mfg)
|
|
|
|
snd_iprintf(buffer, "Modem Function Group: 0x%x\n", codec->mfg);
|
|
|
|
else
|
|
|
|
snd_iprintf(buffer, "No Modem Function Group found\n");
|
2015-03-03 09:07:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void print_codec_info(struct snd_info_entry *entry,
|
|
|
|
struct snd_info_buffer *buffer)
|
|
|
|
{
|
|
|
|
struct hda_codec *codec = entry->private_data;
|
|
|
|
hda_nid_t nid, fg;
|
|
|
|
int i, nodes;
|
2007-06-19 16:31:28 +00:00
|
|
|
|
2015-03-03 09:07:24 +00:00
|
|
|
print_codec_core_info(&codec->core, buffer);
|
|
|
|
fg = codec->core.afg;
|
|
|
|
if (!fg)
|
2005-09-07 11:29:22 +00:00
|
|
|
return;
|
2007-08-10 15:21:45 +00:00
|
|
|
snd_hda_power_up(codec);
|
2006-11-07 15:10:06 +00:00
|
|
|
snd_iprintf(buffer, "Default PCM:\n");
|
2015-03-03 09:07:24 +00:00
|
|
|
print_pcm_caps(buffer, codec, fg);
|
2005-04-16 22:20:36 +00:00
|
|
|
snd_iprintf(buffer, "Default Amp-In caps: ");
|
2015-03-03 09:07:24 +00:00
|
|
|
print_amp_caps(buffer, codec, fg, HDA_INPUT);
|
2005-04-16 22:20:36 +00:00
|
|
|
snd_iprintf(buffer, "Default Amp-Out caps: ");
|
2015-03-03 09:07:24 +00:00
|
|
|
print_amp_caps(buffer, codec, fg, HDA_OUTPUT);
|
|
|
|
snd_iprintf(buffer, "State of AFG node 0x%02x:\n", fg);
|
|
|
|
print_power_state(buffer, codec, fg);
|
2005-04-16 22:20:36 +00:00
|
|
|
|
2015-03-03 09:07:24 +00:00
|
|
|
nodes = snd_hda_get_sub_nodes(codec, fg, &nid);
|
2005-04-16 22:20:36 +00:00
|
|
|
if (! nid || nodes < 0) {
|
|
|
|
snd_iprintf(buffer, "Invalid AFG subtree\n");
|
2007-08-10 15:21:45 +00:00
|
|
|
snd_hda_power_down(codec);
|
2005-04-16 22:20:36 +00:00
|
|
|
return;
|
|
|
|
}
|
[ALSA] hda_proc - Add a number of new settings to proc codec output
This patch adds additional output to the /proc codec#X info.
The following pieces of information are added to the output:
- Balanced, L/R swap, trigger, impedance sense pin capabilities
- Vref pin capabilities
- Current Vref pin widget control setting
- Default configuration association, sequence, and misc bit test
- EAPD/BTL bits conveying balanced mode, EAPD, and L/R swap
- Power state modified to show state name as well as setting vs actual value
- GPIO parameter output on Audio Function Group, including enumeration of IO
pins which are indicated present (Any I and O pins are not output at this
time)
- Stripe and L/R swap widget capabilities
- All digital converter bits: enable, validity, validity config, preemphasis,
copyright, non-audio, professional, generation level, and content category
- Converter stream and channel values for in/out widgets
- SDI select value for in widgets
- Unsolicited response widget capability tag and enabled bit
- Delay widget capability value
- Processing widget capability benign bit and number of coefficients
- Realtek Define Registers: processing coefficient, coefficient index
[Also, fixed space/tab issues and make codes a bit more readable
-- Takashi]
Signed-off-by: Andrew Paprocki <andrew@ishiboo.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-01-18 11:51:11 +00:00
|
|
|
|
2015-03-03 09:07:24 +00:00
|
|
|
print_gpio(buffer, codec, fg);
|
2008-11-28 13:35:16 +00:00
|
|
|
if (codec->proc_widget_hook)
|
2015-03-03 09:07:24 +00:00
|
|
|
codec->proc_widget_hook(buffer, codec, fg);
|
[ALSA] hda_proc - Add a number of new settings to proc codec output
This patch adds additional output to the /proc codec#X info.
The following pieces of information are added to the output:
- Balanced, L/R swap, trigger, impedance sense pin capabilities
- Vref pin capabilities
- Current Vref pin widget control setting
- Default configuration association, sequence, and misc bit test
- EAPD/BTL bits conveying balanced mode, EAPD, and L/R swap
- Power state modified to show state name as well as setting vs actual value
- GPIO parameter output on Audio Function Group, including enumeration of IO
pins which are indicated present (Any I and O pins are not output at this
time)
- Stripe and L/R swap widget capabilities
- All digital converter bits: enable, validity, validity config, preemphasis,
copyright, non-audio, professional, generation level, and content category
- Converter stream and channel values for in/out widgets
- SDI select value for in widgets
- Unsolicited response widget capability tag and enabled bit
- Delay widget capability value
- Processing widget capability benign bit and number of coefficients
- Realtek Define Registers: processing coefficient, coefficient index
[Also, fixed space/tab issues and make codes a bit more readable
-- Takashi]
Signed-off-by: Andrew Paprocki <andrew@ishiboo.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-01-18 11:51:11 +00:00
|
|
|
|
2005-04-16 22:20:36 +00:00
|
|
|
for (i = 0; i < nodes; i++, nid++) {
|
2007-07-27 14:52:19 +00:00
|
|
|
unsigned int wid_caps =
|
2015-03-03 22:29:47 +00:00
|
|
|
param_read(codec, nid, AC_PAR_AUDIO_WIDGET_CAP);
|
2009-07-27 10:54:26 +00:00
|
|
|
unsigned int wid_type = get_wcaps_type(wid_caps);
|
ALSA: hda - Remove limit of widget connections
Currently we set the max number of connections to be 32, but there
seems codec that gives longer connection lists like AD1988, and we see
errors in proc output and else. (Though, in the case of AD1988, it's
a list of all codecs connected to a single vendor widget, so this must
be something fishy, but it's still valid from the h/w design POV.)
This patch tries to remove this restriction. For efficiency, we still
use the fixed size array in the parser, but takes a dynamic array when
the size is reported to be greater than that.
Now the fixed array size is found only in patch_hdmi.c, but it should
be fine, as the codec itself can't support so many pins.
Reported-by: Raymond Yau <superquad.vortex2@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-02-07 17:18:19 +00:00
|
|
|
hda_nid_t *conn = NULL;
|
[ALSA] hda_proc - Add a number of new settings to proc codec output
This patch adds additional output to the /proc codec#X info.
The following pieces of information are added to the output:
- Balanced, L/R swap, trigger, impedance sense pin capabilities
- Vref pin capabilities
- Current Vref pin widget control setting
- Default configuration association, sequence, and misc bit test
- EAPD/BTL bits conveying balanced mode, EAPD, and L/R swap
- Power state modified to show state name as well as setting vs actual value
- GPIO parameter output on Audio Function Group, including enumeration of IO
pins which are indicated present (Any I and O pins are not output at this
time)
- Stripe and L/R swap widget capabilities
- All digital converter bits: enable, validity, validity config, preemphasis,
copyright, non-audio, professional, generation level, and content category
- Converter stream and channel values for in/out widgets
- SDI select value for in widgets
- Unsolicited response widget capability tag and enabled bit
- Delay widget capability value
- Processing widget capability benign bit and number of coefficients
- Realtek Define Registers: processing coefficient, coefficient index
[Also, fixed space/tab issues and make codes a bit more readable
-- Takashi]
Signed-off-by: Andrew Paprocki <andrew@ishiboo.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-01-18 11:51:11 +00:00
|
|
|
int conn_len = 0;
|
2005-06-10 17:45:09 +00:00
|
|
|
|
2005-04-16 22:20:36 +00:00
|
|
|
snd_iprintf(buffer, "Node 0x%02x [%s] wcaps 0x%x:", nid,
|
|
|
|
get_wid_type_name(wid_type), wid_caps);
|
2008-07-30 13:13:29 +00:00
|
|
|
if (wid_caps & AC_WCAP_STEREO) {
|
2009-08-24 01:50:46 +00:00
|
|
|
unsigned int chans = get_wcaps_channels(wid_caps);
|
2008-07-30 13:13:29 +00:00
|
|
|
if (chans == 2)
|
|
|
|
snd_iprintf(buffer, " Stereo");
|
|
|
|
else
|
|
|
|
snd_iprintf(buffer, " %d-Channels", chans);
|
|
|
|
} else
|
2005-04-16 22:20:36 +00:00
|
|
|
snd_iprintf(buffer, " Mono");
|
|
|
|
if (wid_caps & AC_WCAP_DIGITAL)
|
|
|
|
snd_iprintf(buffer, " Digital");
|
|
|
|
if (wid_caps & AC_WCAP_IN_AMP)
|
|
|
|
snd_iprintf(buffer, " Amp-In");
|
|
|
|
if (wid_caps & AC_WCAP_OUT_AMP)
|
|
|
|
snd_iprintf(buffer, " Amp-Out");
|
[ALSA] hda_proc - Add a number of new settings to proc codec output
This patch adds additional output to the /proc codec#X info.
The following pieces of information are added to the output:
- Balanced, L/R swap, trigger, impedance sense pin capabilities
- Vref pin capabilities
- Current Vref pin widget control setting
- Default configuration association, sequence, and misc bit test
- EAPD/BTL bits conveying balanced mode, EAPD, and L/R swap
- Power state modified to show state name as well as setting vs actual value
- GPIO parameter output on Audio Function Group, including enumeration of IO
pins which are indicated present (Any I and O pins are not output at this
time)
- Stripe and L/R swap widget capabilities
- All digital converter bits: enable, validity, validity config, preemphasis,
copyright, non-audio, professional, generation level, and content category
- Converter stream and channel values for in/out widgets
- SDI select value for in widgets
- Unsolicited response widget capability tag and enabled bit
- Delay widget capability value
- Processing widget capability benign bit and number of coefficients
- Realtek Define Registers: processing coefficient, coefficient index
[Also, fixed space/tab issues and make codes a bit more readable
-- Takashi]
Signed-off-by: Andrew Paprocki <andrew@ishiboo.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-01-18 11:51:11 +00:00
|
|
|
if (wid_caps & AC_WCAP_STRIPE)
|
|
|
|
snd_iprintf(buffer, " Stripe");
|
|
|
|
if (wid_caps & AC_WCAP_LR_SWAP)
|
|
|
|
snd_iprintf(buffer, " R/L");
|
2008-07-30 13:13:29 +00:00
|
|
|
if (wid_caps & AC_WCAP_CP_CAPS)
|
|
|
|
snd_iprintf(buffer, " CP");
|
2005-04-16 22:20:36 +00:00
|
|
|
snd_iprintf(buffer, "\n");
|
|
|
|
|
2009-12-08 15:13:32 +00:00
|
|
|
print_nid_array(buffer, codec, nid, &codec->mixers);
|
|
|
|
print_nid_array(buffer, codec, nid, &codec->nids);
|
2009-11-11 12:43:01 +00:00
|
|
|
print_nid_pcms(buffer, codec, nid);
|
|
|
|
|
2007-11-16 16:52:39 +00:00
|
|
|
/* volume knob is a special widget that always have connection
|
|
|
|
* list
|
|
|
|
*/
|
|
|
|
if (wid_type == AC_WID_VOL_KNB)
|
|
|
|
wid_caps |= AC_WCAP_CONN_LIST;
|
|
|
|
|
ALSA: hda - Remove limit of widget connections
Currently we set the max number of connections to be 32, but there
seems codec that gives longer connection lists like AD1988, and we see
errors in proc output and else. (Though, in the case of AD1988, it's
a list of all codecs connected to a single vendor widget, so this must
be something fishy, but it's still valid from the h/w design POV.)
This patch tries to remove this restriction. For efficiency, we still
use the fixed size array in the parser, but takes a dynamic array when
the size is reported to be greater than that.
Now the fixed array size is found only in patch_hdmi.c, but it should
be fine, as the codec itself can't support so many pins.
Reported-by: Raymond Yau <superquad.vortex2@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-02-07 17:18:19 +00:00
|
|
|
if (wid_caps & AC_WCAP_CONN_LIST) {
|
|
|
|
conn_len = snd_hda_get_num_raw_conns(codec, nid);
|
|
|
|
if (conn_len > 0) {
|
treewide: kmalloc() -> kmalloc_array()
The kmalloc() function has a 2-factor argument form, kmalloc_array(). This
patch replaces cases of:
kmalloc(a * b, gfp)
with:
kmalloc_array(a * b, gfp)
as well as handling cases of:
kmalloc(a * b * c, gfp)
with:
kmalloc(array3_size(a, b, c), gfp)
as it's slightly less ugly than:
kmalloc_array(array_size(a, b), c, gfp)
This does, however, attempt to ignore constant size factors like:
kmalloc(4 * 1024, gfp)
though any constants defined via macros get caught up in the conversion.
Any factors with a sizeof() of "unsigned char", "char", and "u8" were
dropped, since they're redundant.
The tools/ directory was manually excluded, since it has its own
implementation of kmalloc().
The Coccinelle script used for this was:
// Fix redundant parens around sizeof().
@@
type TYPE;
expression THING, E;
@@
(
kmalloc(
- (sizeof(TYPE)) * E
+ sizeof(TYPE) * E
, ...)
|
kmalloc(
- (sizeof(THING)) * E
+ sizeof(THING) * E
, ...)
)
// Drop single-byte sizes and redundant parens.
@@
expression COUNT;
typedef u8;
typedef __u8;
@@
(
kmalloc(
- sizeof(u8) * (COUNT)
+ COUNT
, ...)
|
kmalloc(
- sizeof(__u8) * (COUNT)
+ COUNT
, ...)
|
kmalloc(
- sizeof(char) * (COUNT)
+ COUNT
, ...)
|
kmalloc(
- sizeof(unsigned char) * (COUNT)
+ COUNT
, ...)
|
kmalloc(
- sizeof(u8) * COUNT
+ COUNT
, ...)
|
kmalloc(
- sizeof(__u8) * COUNT
+ COUNT
, ...)
|
kmalloc(
- sizeof(char) * COUNT
+ COUNT
, ...)
|
kmalloc(
- sizeof(unsigned char) * COUNT
+ COUNT
, ...)
)
// 2-factor product with sizeof(type/expression) and identifier or constant.
@@
type TYPE;
expression THING;
identifier COUNT_ID;
constant COUNT_CONST;
@@
(
- kmalloc
+ kmalloc_array
(
- sizeof(TYPE) * (COUNT_ID)
+ COUNT_ID, sizeof(TYPE)
, ...)
|
- kmalloc
+ kmalloc_array
(
- sizeof(TYPE) * COUNT_ID
+ COUNT_ID, sizeof(TYPE)
, ...)
|
- kmalloc
+ kmalloc_array
(
- sizeof(TYPE) * (COUNT_CONST)
+ COUNT_CONST, sizeof(TYPE)
, ...)
|
- kmalloc
+ kmalloc_array
(
- sizeof(TYPE) * COUNT_CONST
+ COUNT_CONST, sizeof(TYPE)
, ...)
|
- kmalloc
+ kmalloc_array
(
- sizeof(THING) * (COUNT_ID)
+ COUNT_ID, sizeof(THING)
, ...)
|
- kmalloc
+ kmalloc_array
(
- sizeof(THING) * COUNT_ID
+ COUNT_ID, sizeof(THING)
, ...)
|
- kmalloc
+ kmalloc_array
(
- sizeof(THING) * (COUNT_CONST)
+ COUNT_CONST, sizeof(THING)
, ...)
|
- kmalloc
+ kmalloc_array
(
- sizeof(THING) * COUNT_CONST
+ COUNT_CONST, sizeof(THING)
, ...)
)
// 2-factor product, only identifiers.
@@
identifier SIZE, COUNT;
@@
- kmalloc
+ kmalloc_array
(
- SIZE * COUNT
+ COUNT, SIZE
, ...)
// 3-factor product with 1 sizeof(type) or sizeof(expression), with
// redundant parens removed.
@@
expression THING;
identifier STRIDE, COUNT;
type TYPE;
@@
(
kmalloc(
- sizeof(TYPE) * (COUNT) * (STRIDE)
+ array3_size(COUNT, STRIDE, sizeof(TYPE))
, ...)
|
kmalloc(
- sizeof(TYPE) * (COUNT) * STRIDE
+ array3_size(COUNT, STRIDE, sizeof(TYPE))
, ...)
|
kmalloc(
- sizeof(TYPE) * COUNT * (STRIDE)
+ array3_size(COUNT, STRIDE, sizeof(TYPE))
, ...)
|
kmalloc(
- sizeof(TYPE) * COUNT * STRIDE
+ array3_size(COUNT, STRIDE, sizeof(TYPE))
, ...)
|
kmalloc(
- sizeof(THING) * (COUNT) * (STRIDE)
+ array3_size(COUNT, STRIDE, sizeof(THING))
, ...)
|
kmalloc(
- sizeof(THING) * (COUNT) * STRIDE
+ array3_size(COUNT, STRIDE, sizeof(THING))
, ...)
|
kmalloc(
- sizeof(THING) * COUNT * (STRIDE)
+ array3_size(COUNT, STRIDE, sizeof(THING))
, ...)
|
kmalloc(
- sizeof(THING) * COUNT * STRIDE
+ array3_size(COUNT, STRIDE, sizeof(THING))
, ...)
)
// 3-factor product with 2 sizeof(variable), with redundant parens removed.
@@
expression THING1, THING2;
identifier COUNT;
type TYPE1, TYPE2;
@@
(
kmalloc(
- sizeof(TYPE1) * sizeof(TYPE2) * COUNT
+ array3_size(COUNT, sizeof(TYPE1), sizeof(TYPE2))
, ...)
|
kmalloc(
- sizeof(TYPE1) * sizeof(THING2) * (COUNT)
+ array3_size(COUNT, sizeof(TYPE1), sizeof(TYPE2))
, ...)
|
kmalloc(
- sizeof(THING1) * sizeof(THING2) * COUNT
+ array3_size(COUNT, sizeof(THING1), sizeof(THING2))
, ...)
|
kmalloc(
- sizeof(THING1) * sizeof(THING2) * (COUNT)
+ array3_size(COUNT, sizeof(THING1), sizeof(THING2))
, ...)
|
kmalloc(
- sizeof(TYPE1) * sizeof(THING2) * COUNT
+ array3_size(COUNT, sizeof(TYPE1), sizeof(THING2))
, ...)
|
kmalloc(
- sizeof(TYPE1) * sizeof(THING2) * (COUNT)
+ array3_size(COUNT, sizeof(TYPE1), sizeof(THING2))
, ...)
)
// 3-factor product, only identifiers, with redundant parens removed.
@@
identifier STRIDE, SIZE, COUNT;
@@
(
kmalloc(
- (COUNT) * STRIDE * SIZE
+ array3_size(COUNT, STRIDE, SIZE)
, ...)
|
kmalloc(
- COUNT * (STRIDE) * SIZE
+ array3_size(COUNT, STRIDE, SIZE)
, ...)
|
kmalloc(
- COUNT * STRIDE * (SIZE)
+ array3_size(COUNT, STRIDE, SIZE)
, ...)
|
kmalloc(
- (COUNT) * (STRIDE) * SIZE
+ array3_size(COUNT, STRIDE, SIZE)
, ...)
|
kmalloc(
- COUNT * (STRIDE) * (SIZE)
+ array3_size(COUNT, STRIDE, SIZE)
, ...)
|
kmalloc(
- (COUNT) * STRIDE * (SIZE)
+ array3_size(COUNT, STRIDE, SIZE)
, ...)
|
kmalloc(
- (COUNT) * (STRIDE) * (SIZE)
+ array3_size(COUNT, STRIDE, SIZE)
, ...)
|
kmalloc(
- COUNT * STRIDE * SIZE
+ array3_size(COUNT, STRIDE, SIZE)
, ...)
)
// Any remaining multi-factor products, first at least 3-factor products,
// when they're not all constants...
@@
expression E1, E2, E3;
constant C1, C2, C3;
@@
(
kmalloc(C1 * C2 * C3, ...)
|
kmalloc(
- (E1) * E2 * E3
+ array3_size(E1, E2, E3)
, ...)
|
kmalloc(
- (E1) * (E2) * E3
+ array3_size(E1, E2, E3)
, ...)
|
kmalloc(
- (E1) * (E2) * (E3)
+ array3_size(E1, E2, E3)
, ...)
|
kmalloc(
- E1 * E2 * E3
+ array3_size(E1, E2, E3)
, ...)
)
// And then all remaining 2 factors products when they're not all constants,
// keeping sizeof() as the second factor argument.
@@
expression THING, E1, E2;
type TYPE;
constant C1, C2, C3;
@@
(
kmalloc(sizeof(THING) * C2, ...)
|
kmalloc(sizeof(TYPE) * C2, ...)
|
kmalloc(C1 * C2 * C3, ...)
|
kmalloc(C1 * C2, ...)
|
- kmalloc
+ kmalloc_array
(
- sizeof(TYPE) * (E2)
+ E2, sizeof(TYPE)
, ...)
|
- kmalloc
+ kmalloc_array
(
- sizeof(TYPE) * E2
+ E2, sizeof(TYPE)
, ...)
|
- kmalloc
+ kmalloc_array
(
- sizeof(THING) * (E2)
+ E2, sizeof(THING)
, ...)
|
- kmalloc
+ kmalloc_array
(
- sizeof(THING) * E2
+ E2, sizeof(THING)
, ...)
|
- kmalloc
+ kmalloc_array
(
- (E1) * E2
+ E1, E2
, ...)
|
- kmalloc
+ kmalloc_array
(
- (E1) * (E2)
+ E1, E2
, ...)
|
- kmalloc
+ kmalloc_array
(
- E1 * E2
+ E1, E2
, ...)
)
Signed-off-by: Kees Cook <keescook@chromium.org>
2018-06-12 20:55:00 +00:00
|
|
|
conn = kmalloc_array(conn_len,
|
|
|
|
sizeof(hda_nid_t),
|
|
|
|
GFP_KERNEL);
|
ALSA: hda - Remove limit of widget connections
Currently we set the max number of connections to be 32, but there
seems codec that gives longer connection lists like AD1988, and we see
errors in proc output and else. (Though, in the case of AD1988, it's
a list of all codecs connected to a single vendor widget, so this must
be something fishy, but it's still valid from the h/w design POV.)
This patch tries to remove this restriction. For efficiency, we still
use the fixed size array in the parser, but takes a dynamic array when
the size is reported to be greater than that.
Now the fixed array size is found only in patch_hdmi.c, but it should
be fine, as the codec itself can't support so many pins.
Reported-by: Raymond Yau <superquad.vortex2@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-02-07 17:18:19 +00:00
|
|
|
if (!conn)
|
|
|
|
return;
|
|
|
|
if (snd_hda_get_raw_connections(codec, nid, conn,
|
|
|
|
conn_len) < 0)
|
|
|
|
conn_len = 0;
|
|
|
|
}
|
|
|
|
}
|
2005-06-10 17:45:09 +00:00
|
|
|
|
2005-04-16 22:20:36 +00:00
|
|
|
if (wid_caps & AC_WCAP_IN_AMP) {
|
|
|
|
snd_iprintf(buffer, " Amp-In caps: ");
|
|
|
|
print_amp_caps(buffer, codec, nid, HDA_INPUT);
|
|
|
|
snd_iprintf(buffer, " Amp-In vals: ");
|
2012-04-06 13:34:15 +00:00
|
|
|
if (wid_type == AC_WID_PIN ||
|
|
|
|
(codec->single_adc_amp &&
|
|
|
|
wid_type == AC_WID_AUD_IN))
|
|
|
|
print_amp_vals(buffer, codec, nid, HDA_INPUT,
|
2015-03-16 09:18:08 +00:00
|
|
|
wid_caps, 1);
|
2012-04-06 13:34:15 +00:00
|
|
|
else
|
|
|
|
print_amp_vals(buffer, codec, nid, HDA_INPUT,
|
2015-03-16 09:18:08 +00:00
|
|
|
wid_caps, conn_len);
|
2005-04-16 22:20:36 +00:00
|
|
|
}
|
|
|
|
if (wid_caps & AC_WCAP_OUT_AMP) {
|
|
|
|
snd_iprintf(buffer, " Amp-Out caps: ");
|
|
|
|
print_amp_caps(buffer, codec, nid, HDA_OUTPUT);
|
|
|
|
snd_iprintf(buffer, " Amp-Out vals: ");
|
2009-03-12 16:06:07 +00:00
|
|
|
if (wid_type == AC_WID_PIN &&
|
|
|
|
codec->pin_amp_workaround)
|
|
|
|
print_amp_vals(buffer, codec, nid, HDA_OUTPUT,
|
2015-03-16 09:18:08 +00:00
|
|
|
wid_caps, conn_len);
|
2009-03-12 16:06:07 +00:00
|
|
|
else
|
|
|
|
print_amp_vals(buffer, codec, nid, HDA_OUTPUT,
|
2015-03-16 09:18:08 +00:00
|
|
|
wid_caps, 1);
|
2005-04-16 22:20:36 +00:00
|
|
|
}
|
|
|
|
|
2007-10-26 12:56:36 +00:00
|
|
|
switch (wid_type) {
|
[ALSA] hda_proc - Add a number of new settings to proc codec output
This patch adds additional output to the /proc codec#X info.
The following pieces of information are added to the output:
- Balanced, L/R swap, trigger, impedance sense pin capabilities
- Vref pin capabilities
- Current Vref pin widget control setting
- Default configuration association, sequence, and misc bit test
- EAPD/BTL bits conveying balanced mode, EAPD, and L/R swap
- Power state modified to show state name as well as setting vs actual value
- GPIO parameter output on Audio Function Group, including enumeration of IO
pins which are indicated present (Any I and O pins are not output at this
time)
- Stripe and L/R swap widget capabilities
- All digital converter bits: enable, validity, validity config, preemphasis,
copyright, non-audio, professional, generation level, and content category
- Converter stream and channel values for in/out widgets
- SDI select value for in widgets
- Unsolicited response widget capability tag and enabled bit
- Delay widget capability value
- Processing widget capability benign bit and number of coefficients
- Realtek Define Registers: processing coefficient, coefficient index
[Also, fixed space/tab issues and make codes a bit more readable
-- Takashi]
Signed-off-by: Andrew Paprocki <andrew@ishiboo.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-01-18 11:51:11 +00:00
|
|
|
case AC_WID_PIN: {
|
|
|
|
int supports_vref;
|
|
|
|
print_pin_caps(buffer, codec, nid, &supports_vref);
|
|
|
|
print_pin_ctls(buffer, codec, nid, supports_vref);
|
2007-10-26 12:56:36 +00:00
|
|
|
break;
|
[ALSA] hda_proc - Add a number of new settings to proc codec output
This patch adds additional output to the /proc codec#X info.
The following pieces of information are added to the output:
- Balanced, L/R swap, trigger, impedance sense pin capabilities
- Vref pin capabilities
- Current Vref pin widget control setting
- Default configuration association, sequence, and misc bit test
- EAPD/BTL bits conveying balanced mode, EAPD, and L/R swap
- Power state modified to show state name as well as setting vs actual value
- GPIO parameter output on Audio Function Group, including enumeration of IO
pins which are indicated present (Any I and O pins are not output at this
time)
- Stripe and L/R swap widget capabilities
- All digital converter bits: enable, validity, validity config, preemphasis,
copyright, non-audio, professional, generation level, and content category
- Converter stream and channel values for in/out widgets
- SDI select value for in widgets
- Unsolicited response widget capability tag and enabled bit
- Delay widget capability value
- Processing widget capability benign bit and number of coefficients
- Realtek Define Registers: processing coefficient, coefficient index
[Also, fixed space/tab issues and make codes a bit more readable
-- Takashi]
Signed-off-by: Andrew Paprocki <andrew@ishiboo.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-01-18 11:51:11 +00:00
|
|
|
}
|
2007-10-26 12:56:36 +00:00
|
|
|
case AC_WID_VOL_KNB:
|
[ALSA] hda_proc - Add a number of new settings to proc codec output
This patch adds additional output to the /proc codec#X info.
The following pieces of information are added to the output:
- Balanced, L/R swap, trigger, impedance sense pin capabilities
- Vref pin capabilities
- Current Vref pin widget control setting
- Default configuration association, sequence, and misc bit test
- EAPD/BTL bits conveying balanced mode, EAPD, and L/R swap
- Power state modified to show state name as well as setting vs actual value
- GPIO parameter output on Audio Function Group, including enumeration of IO
pins which are indicated present (Any I and O pins are not output at this
time)
- Stripe and L/R swap widget capabilities
- All digital converter bits: enable, validity, validity config, preemphasis,
copyright, non-audio, professional, generation level, and content category
- Converter stream and channel values for in/out widgets
- SDI select value for in widgets
- Unsolicited response widget capability tag and enabled bit
- Delay widget capability value
- Processing widget capability benign bit and number of coefficients
- Realtek Define Registers: processing coefficient, coefficient index
[Also, fixed space/tab issues and make codes a bit more readable
-- Takashi]
Signed-off-by: Andrew Paprocki <andrew@ishiboo.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-01-18 11:51:11 +00:00
|
|
|
print_vol_knob(buffer, codec, nid);
|
2007-10-26 12:56:36 +00:00
|
|
|
break;
|
|
|
|
case AC_WID_AUD_OUT:
|
|
|
|
case AC_WID_AUD_IN:
|
[ALSA] hda_proc - Add a number of new settings to proc codec output
This patch adds additional output to the /proc codec#X info.
The following pieces of information are added to the output:
- Balanced, L/R swap, trigger, impedance sense pin capabilities
- Vref pin capabilities
- Current Vref pin widget control setting
- Default configuration association, sequence, and misc bit test
- EAPD/BTL bits conveying balanced mode, EAPD, and L/R swap
- Power state modified to show state name as well as setting vs actual value
- GPIO parameter output on Audio Function Group, including enumeration of IO
pins which are indicated present (Any I and O pins are not output at this
time)
- Stripe and L/R swap widget capabilities
- All digital converter bits: enable, validity, validity config, preemphasis,
copyright, non-audio, professional, generation level, and content category
- Converter stream and channel values for in/out widgets
- SDI select value for in widgets
- Unsolicited response widget capability tag and enabled bit
- Delay widget capability value
- Processing widget capability benign bit and number of coefficients
- Realtek Define Registers: processing coefficient, coefficient index
[Also, fixed space/tab issues and make codes a bit more readable
-- Takashi]
Signed-off-by: Andrew Paprocki <andrew@ishiboo.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-01-18 11:51:11 +00:00
|
|
|
print_audio_io(buffer, codec, nid, wid_type);
|
|
|
|
if (wid_caps & AC_WCAP_DIGITAL)
|
|
|
|
print_digital_conv(buffer, codec, nid);
|
2007-10-26 12:56:36 +00:00
|
|
|
if (wid_caps & AC_WCAP_FORMAT_OVRD) {
|
|
|
|
snd_iprintf(buffer, " PCM:\n");
|
|
|
|
print_pcm_caps(buffer, codec, nid);
|
|
|
|
}
|
|
|
|
break;
|
2005-04-16 22:20:36 +00:00
|
|
|
}
|
|
|
|
|
[ALSA] hda_proc - Add a number of new settings to proc codec output
This patch adds additional output to the /proc codec#X info.
The following pieces of information are added to the output:
- Balanced, L/R swap, trigger, impedance sense pin capabilities
- Vref pin capabilities
- Current Vref pin widget control setting
- Default configuration association, sequence, and misc bit test
- EAPD/BTL bits conveying balanced mode, EAPD, and L/R swap
- Power state modified to show state name as well as setting vs actual value
- GPIO parameter output on Audio Function Group, including enumeration of IO
pins which are indicated present (Any I and O pins are not output at this
time)
- Stripe and L/R swap widget capabilities
- All digital converter bits: enable, validity, validity config, preemphasis,
copyright, non-audio, professional, generation level, and content category
- Converter stream and channel values for in/out widgets
- SDI select value for in widgets
- Unsolicited response widget capability tag and enabled bit
- Delay widget capability value
- Processing widget capability benign bit and number of coefficients
- Realtek Define Registers: processing coefficient, coefficient index
[Also, fixed space/tab issues and make codes a bit more readable
-- Takashi]
Signed-off-by: Andrew Paprocki <andrew@ishiboo.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-01-18 11:51:11 +00:00
|
|
|
if (wid_caps & AC_WCAP_UNSOL_CAP)
|
|
|
|
print_unsol_cap(buffer, codec, nid);
|
|
|
|
|
2005-11-02 17:13:41 +00:00
|
|
|
if (wid_caps & AC_WCAP_POWER)
|
[ALSA] hda_proc - Add a number of new settings to proc codec output
This patch adds additional output to the /proc codec#X info.
The following pieces of information are added to the output:
- Balanced, L/R swap, trigger, impedance sense pin capabilities
- Vref pin capabilities
- Current Vref pin widget control setting
- Default configuration association, sequence, and misc bit test
- EAPD/BTL bits conveying balanced mode, EAPD, and L/R swap
- Power state modified to show state name as well as setting vs actual value
- GPIO parameter output on Audio Function Group, including enumeration of IO
pins which are indicated present (Any I and O pins are not output at this
time)
- Stripe and L/R swap widget capabilities
- All digital converter bits: enable, validity, validity config, preemphasis,
copyright, non-audio, professional, generation level, and content category
- Converter stream and channel values for in/out widgets
- SDI select value for in widgets
- Unsolicited response widget capability tag and enabled bit
- Delay widget capability value
- Processing widget capability benign bit and number of coefficients
- Realtek Define Registers: processing coefficient, coefficient index
[Also, fixed space/tab issues and make codes a bit more readable
-- Takashi]
Signed-off-by: Andrew Paprocki <andrew@ishiboo.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-01-18 11:51:11 +00:00
|
|
|
print_power_state(buffer, codec, nid);
|
|
|
|
|
|
|
|
if (wid_caps & AC_WCAP_DELAY)
|
|
|
|
snd_iprintf(buffer, " Delay: %d samples\n",
|
|
|
|
(wid_caps & AC_WCAP_DELAY) >>
|
|
|
|
AC_WCAP_DELAY_SHIFT);
|
|
|
|
|
2013-08-27 01:35:31 +00:00
|
|
|
if (wid_type == AC_WID_PIN && codec->dp_mst)
|
|
|
|
print_device_list(buffer, codec, nid);
|
|
|
|
|
[ALSA] hda_proc - Add a number of new settings to proc codec output
This patch adds additional output to the /proc codec#X info.
The following pieces of information are added to the output:
- Balanced, L/R swap, trigger, impedance sense pin capabilities
- Vref pin capabilities
- Current Vref pin widget control setting
- Default configuration association, sequence, and misc bit test
- EAPD/BTL bits conveying balanced mode, EAPD, and L/R swap
- Power state modified to show state name as well as setting vs actual value
- GPIO parameter output on Audio Function Group, including enumeration of IO
pins which are indicated present (Any I and O pins are not output at this
time)
- Stripe and L/R swap widget capabilities
- All digital converter bits: enable, validity, validity config, preemphasis,
copyright, non-audio, professional, generation level, and content category
- Converter stream and channel values for in/out widgets
- SDI select value for in widgets
- Unsolicited response widget capability tag and enabled bit
- Delay widget capability value
- Processing widget capability benign bit and number of coefficients
- Realtek Define Registers: processing coefficient, coefficient index
[Also, fixed space/tab issues and make codes a bit more readable
-- Takashi]
Signed-off-by: Andrew Paprocki <andrew@ishiboo.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-01-18 11:51:11 +00:00
|
|
|
if (wid_caps & AC_WCAP_CONN_LIST)
|
|
|
|
print_conn_list(buffer, codec, nid, wid_type,
|
|
|
|
conn, conn_len);
|
|
|
|
|
|
|
|
if (wid_caps & AC_WCAP_PROC_WID)
|
|
|
|
print_proc_caps(buffer, codec, nid);
|
|
|
|
|
2008-11-28 11:55:36 +00:00
|
|
|
if (codec->proc_widget_hook)
|
|
|
|
codec->proc_widget_hook(buffer, codec, nid);
|
ALSA: hda - Remove limit of widget connections
Currently we set the max number of connections to be 32, but there
seems codec that gives longer connection lists like AD1988, and we see
errors in proc output and else. (Though, in the case of AD1988, it's
a list of all codecs connected to a single vendor widget, so this must
be something fishy, but it's still valid from the h/w design POV.)
This patch tries to remove this restriction. For efficiency, we still
use the fixed size array in the parser, but takes a dynamic array when
the size is reported to be greater than that.
Now the fixed array size is found only in patch_hdmi.c, but it should
be fine, as the codec itself can't support so many pins.
Reported-by: Raymond Yau <superquad.vortex2@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-02-07 17:18:19 +00:00
|
|
|
|
|
|
|
kfree(conn);
|
2005-04-16 22:20:36 +00:00
|
|
|
}
|
2007-08-10 15:21:45 +00:00
|
|
|
snd_hda_power_down(codec);
|
2005-04-16 22:20:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* create a proc read
|
|
|
|
*/
|
|
|
|
int snd_hda_codec_proc_new(struct hda_codec *codec)
|
|
|
|
{
|
|
|
|
char name[32];
|
|
|
|
|
2015-03-03 09:07:24 +00:00
|
|
|
snprintf(name, sizeof(name), "codec#%d", codec->core.addr);
|
2019-02-04 15:01:39 +00:00
|
|
|
return snd_card_ro_proc_new(codec->card, name, codec, print_codec_info);
|
2005-04-16 22:20:36 +00:00
|
|
|
}
|
|
|
|
|