Commit 26c04a8a authored by Gergo Koteles's avatar Gergo Koteles Committed by Takashi Iwai

ALSA: hda/tas2781: add debug statements to kcontrols

Sometimes it is useful to examine the timing of kcontrol events.

Add debug statements to each kcontrol.
Signed-off-by: default avatarGergo Koteles <soyer@irl.hu>
Message-ID: <18ff4b0caab90a2dacf907e62346fd5079a9eb1a.1711469583.git.soyer@irl.hu>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 15bc3066
...@@ -189,6 +189,9 @@ static int tasdevice_get_profile_id(struct snd_kcontrol *kcontrol, ...@@ -189,6 +189,9 @@ static int tasdevice_get_profile_id(struct snd_kcontrol *kcontrol,
ucontrol->value.integer.value[0] = tas_priv->rcabin.profile_cfg_id; ucontrol->value.integer.value[0] = tas_priv->rcabin.profile_cfg_id;
dev_dbg(tas_priv->dev, "%s: kcontrol %s: %d\n",
__func__, kcontrol->id.name, tas_priv->rcabin.profile_cfg_id);
mutex_unlock(&tas_priv->codec_lock); mutex_unlock(&tas_priv->codec_lock);
return 0; return 0;
...@@ -206,6 +209,10 @@ static int tasdevice_set_profile_id(struct snd_kcontrol *kcontrol, ...@@ -206,6 +209,10 @@ static int tasdevice_set_profile_id(struct snd_kcontrol *kcontrol,
mutex_lock(&tas_priv->codec_lock); mutex_lock(&tas_priv->codec_lock);
dev_dbg(tas_priv->dev, "%s: kcontrol %s: %d -> %d\n",
__func__, kcontrol->id.name,
tas_priv->rcabin.profile_cfg_id, val);
if (tas_priv->rcabin.profile_cfg_id != val) { if (tas_priv->rcabin.profile_cfg_id != val) {
tas_priv->rcabin.profile_cfg_id = val; tas_priv->rcabin.profile_cfg_id = val;
ret = 1; ret = 1;
...@@ -253,6 +260,9 @@ static int tasdevice_program_get(struct snd_kcontrol *kcontrol, ...@@ -253,6 +260,9 @@ static int tasdevice_program_get(struct snd_kcontrol *kcontrol,
ucontrol->value.integer.value[0] = tas_priv->cur_prog; ucontrol->value.integer.value[0] = tas_priv->cur_prog;
dev_dbg(tas_priv->dev, "%s: kcontrol %s: %d\n",
__func__, kcontrol->id.name, tas_priv->cur_prog);
mutex_unlock(&tas_priv->codec_lock); mutex_unlock(&tas_priv->codec_lock);
return 0; return 0;
...@@ -271,6 +281,9 @@ static int tasdevice_program_put(struct snd_kcontrol *kcontrol, ...@@ -271,6 +281,9 @@ static int tasdevice_program_put(struct snd_kcontrol *kcontrol,
mutex_lock(&tas_priv->codec_lock); mutex_lock(&tas_priv->codec_lock);
dev_dbg(tas_priv->dev, "%s: kcontrol %s: %d -> %d\n",
__func__, kcontrol->id.name, tas_priv->cur_prog, val);
if (tas_priv->cur_prog != val) { if (tas_priv->cur_prog != val) {
tas_priv->cur_prog = val; tas_priv->cur_prog = val;
ret = 1; ret = 1;
...@@ -290,6 +303,9 @@ static int tasdevice_config_get(struct snd_kcontrol *kcontrol, ...@@ -290,6 +303,9 @@ static int tasdevice_config_get(struct snd_kcontrol *kcontrol,
ucontrol->value.integer.value[0] = tas_priv->cur_conf; ucontrol->value.integer.value[0] = tas_priv->cur_conf;
dev_dbg(tas_priv->dev, "%s: kcontrol %s: %d\n",
__func__, kcontrol->id.name, tas_priv->cur_conf);
mutex_unlock(&tas_priv->codec_lock); mutex_unlock(&tas_priv->codec_lock);
return 0; return 0;
...@@ -308,6 +324,9 @@ static int tasdevice_config_put(struct snd_kcontrol *kcontrol, ...@@ -308,6 +324,9 @@ static int tasdevice_config_put(struct snd_kcontrol *kcontrol,
mutex_lock(&tas_priv->codec_lock); mutex_lock(&tas_priv->codec_lock);
dev_dbg(tas_priv->dev, "%s: kcontrol %s: %d -> %d\n",
__func__, kcontrol->id.name, tas_priv->cur_conf, val);
if (tas_priv->cur_conf != val) { if (tas_priv->cur_conf != val) {
tas_priv->cur_conf = val; tas_priv->cur_conf = val;
ret = 1; ret = 1;
...@@ -330,6 +349,9 @@ static int tas2781_amp_getvol(struct snd_kcontrol *kcontrol, ...@@ -330,6 +349,9 @@ static int tas2781_amp_getvol(struct snd_kcontrol *kcontrol,
ret = tasdevice_amp_getvol(tas_priv, ucontrol, mc); ret = tasdevice_amp_getvol(tas_priv, ucontrol, mc);
dev_dbg(tas_priv->dev, "%s: kcontrol %s: %ld\n",
__func__, kcontrol->id.name, ucontrol->value.integer.value[0]);
mutex_unlock(&tas_priv->codec_lock); mutex_unlock(&tas_priv->codec_lock);
return ret; return ret;
...@@ -345,6 +367,9 @@ static int tas2781_amp_putvol(struct snd_kcontrol *kcontrol, ...@@ -345,6 +367,9 @@ static int tas2781_amp_putvol(struct snd_kcontrol *kcontrol,
mutex_lock(&tas_priv->codec_lock); mutex_lock(&tas_priv->codec_lock);
dev_dbg(tas_priv->dev, "%s: kcontrol %s: -> %ld\n",
__func__, kcontrol->id.name, ucontrol->value.integer.value[0]);
/* The check of the given value is in tasdevice_amp_putvol. */ /* The check of the given value is in tasdevice_amp_putvol. */
ret = tasdevice_amp_putvol(tas_priv, ucontrol, mc); ret = tasdevice_amp_putvol(tas_priv, ucontrol, mc);
...@@ -361,8 +386,8 @@ static int tas2781_force_fwload_get(struct snd_kcontrol *kcontrol, ...@@ -361,8 +386,8 @@ static int tas2781_force_fwload_get(struct snd_kcontrol *kcontrol,
mutex_lock(&tas_priv->codec_lock); mutex_lock(&tas_priv->codec_lock);
ucontrol->value.integer.value[0] = (int)tas_priv->force_fwload_status; ucontrol->value.integer.value[0] = (int)tas_priv->force_fwload_status;
dev_dbg(tas_priv->dev, "%s : Force FWload %s\n", __func__, dev_dbg(tas_priv->dev, "%s: kcontrol %s: %d\n",
tas_priv->force_fwload_status ? "ON" : "OFF"); __func__, kcontrol->id.name, tas_priv->force_fwload_status);
mutex_unlock(&tas_priv->codec_lock); mutex_unlock(&tas_priv->codec_lock);
...@@ -377,14 +402,16 @@ static int tas2781_force_fwload_put(struct snd_kcontrol *kcontrol, ...@@ -377,14 +402,16 @@ static int tas2781_force_fwload_put(struct snd_kcontrol *kcontrol,
mutex_lock(&tas_priv->codec_lock); mutex_lock(&tas_priv->codec_lock);
dev_dbg(tas_priv->dev, "%s: kcontrol %s: %d -> %d\n",
__func__, kcontrol->id.name,
tas_priv->force_fwload_status, val);
if (tas_priv->force_fwload_status == val) if (tas_priv->force_fwload_status == val)
change = false; change = false;
else { else {
change = true; change = true;
tas_priv->force_fwload_status = val; tas_priv->force_fwload_status = val;
} }
dev_dbg(tas_priv->dev, "%s : Force FWload %s\n", __func__,
tas_priv->force_fwload_status ? "ON" : "OFF");
mutex_unlock(&tas_priv->codec_lock); mutex_unlock(&tas_priv->codec_lock);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment