From patchwork Mon Mar 25 21:25:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gergo Koteles X-Patchwork-Id: 782678 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B874EC54E58 for ; Mon, 25 Mar 2024 21:27:29 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 346D1EA3; Mon, 25 Mar 2024 22:27:18 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 346D1EA3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1711402048; bh=7tKjUPBeypTJx3dhjiPVGtY+r3oYW9ckUbJZzdlsjYY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=pnszog3sTq6zWvIFyg8FgMImdVnRGoZJo6V3UopF6PLkEfG8Ms+vnADq6tv+kYcnx jf1wnmSw0o4/+o2Xjvn+KM1MrdED5XrullIhGZNG0zg8shh+UA+CM8UeBBQ6cN30Fw Vd9smsNSf9q5iX+6RS5PnQLiNdoF9z3y+T6HqL4U= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 30A6AF80604; Mon, 25 Mar 2024 22:26:13 +0100 (CET) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 8C7D0F8058C; Mon, 25 Mar 2024 22:26:13 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id D6F80F805DF; Mon, 25 Mar 2024 22:26:08 +0100 (CET) Received: from irl.hu (irl.hu [95.85.9.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by alsa1.perex.cz (Postfix) with UTF8SMTPS id 9B400F805AA for ; Mon, 25 Mar 2024 22:26:06 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 9B400F805AA Received: from fedori.lan (51b68717.dsl.pool.telekom.hu [::ffff:81.182.135.23]) (AUTH: CRAM-MD5 soyer@irl.hu, ) by irl.hu with ESMTPSA id 00000000000770B0.000000006601EBEE.0023A89D; Mon, 25 Mar 2024 22:26:03 +0100 From: Gergo Koteles To: Shenghao Ding , Kevin Lu , Baojun Xu , Jaroslav Kysela , Takashi Iwai Cc: alsa-devel@alsa-project.org, linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, Gergo Koteles Subject: [PATCH 3/3] ALSA: hda/tas2781: add debug statements to kcontrols Date: Mon, 25 Mar 2024 22:25:35 +0100 Message-ID: X-Mailer: git-send-email 2.44.0 In-Reply-To: References: Mime-Version: 1.0 X-Mime-Autoconverted: from 8bit to 7bit by courier 1.0 Message-ID-Hash: OPWIC62ECVDE7FW4HNZQUACT7KA5JHVA X-Message-ID-Hash: OPWIC62ECVDE7FW4HNZQUACT7KA5JHVA X-MailFrom: soyer@irl.hu X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.9 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Sometimes it is useful to examine the timing of kcontrol events. Add debug statements to each kcontrol. Signed-off-by: Gergo Koteles --- sound/pci/hda/tas2781_hda_i2c.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/sound/pci/hda/tas2781_hda_i2c.c b/sound/pci/hda/tas2781_hda_i2c.c index 9a43f563bb9e..b60ce4c2c090 100644 --- a/sound/pci/hda/tas2781_hda_i2c.c +++ b/sound/pci/hda/tas2781_hda_i2c.c @@ -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; + dev_dbg(tas_priv->dev, "%s: %d\n", __func__, + tas_priv->rcabin.profile_cfg_id); + mutex_unlock(&tas_priv->codec_lock); return 0; @@ -206,6 +209,9 @@ static int tasdevice_set_profile_id(struct snd_kcontrol *kcontrol, mutex_lock(&tas_priv->codec_lock); + dev_dbg(tas_priv->dev, "%s: %d -> %d\n", __func__, + tas_priv->rcabin.profile_cfg_id, val); + if (tas_priv->rcabin.profile_cfg_id != val) { tas_priv->rcabin.profile_cfg_id = val; ret = 1; @@ -253,6 +259,8 @@ static int tasdevice_program_get(struct snd_kcontrol *kcontrol, ucontrol->value.integer.value[0] = tas_priv->cur_prog; + dev_dbg(tas_priv->dev, "%s: %d\n", __func__, tas_priv->cur_prog); + mutex_unlock(&tas_priv->codec_lock); return 0; @@ -271,6 +279,9 @@ static int tasdevice_program_put(struct snd_kcontrol *kcontrol, mutex_lock(&tas_priv->codec_lock); + dev_dbg(tas_priv->dev, "%s: %d -> %d\n", __func__, + tas_priv->cur_prog, val); + if (tas_priv->cur_prog != val) { tas_priv->cur_prog = val; ret = 1; @@ -290,6 +301,8 @@ static int tasdevice_config_get(struct snd_kcontrol *kcontrol, ucontrol->value.integer.value[0] = tas_priv->cur_conf; + dev_dbg(tas_priv->dev, "%s: %d\n", __func__, tas_priv->cur_conf); + mutex_unlock(&tas_priv->codec_lock); return 0; @@ -308,6 +321,9 @@ static int tasdevice_config_put(struct snd_kcontrol *kcontrol, mutex_lock(&tas_priv->codec_lock); + dev_dbg(tas_priv->dev, "%s: %d -> %d\n", __func__, + tas_priv->cur_conf, val); + if (tas_priv->cur_conf != val) { tas_priv->cur_conf = val; ret = 1; @@ -330,6 +346,9 @@ static int tas2781_amp_getvol(struct snd_kcontrol *kcontrol, ret = tasdevice_amp_getvol(tas_priv, ucontrol, mc); + dev_dbg(tas_priv->dev, "%s: %ld\n", __func__, + ucontrol->value.integer.value[0]); + mutex_unlock(&tas_priv->codec_lock); return ret; @@ -345,6 +364,9 @@ static int tas2781_amp_putvol(struct snd_kcontrol *kcontrol, mutex_lock(&tas_priv->codec_lock); + dev_dbg(tas_priv->dev, "%s: %ld\n", __func__, + ucontrol->value.integer.value[0]); + /* The check of the given value is in tasdevice_amp_putvol. */ ret = tasdevice_amp_putvol(tas_priv, ucontrol, mc);