Linux Sound subsystem development
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Shenghao Ding <shenghao-ding@ti.com>
Cc: tiwai@suse.de, 13916275206@139.com, perex@perex.cz,
	lgirdwood@gmail.com, linux-sound@vger.kernel.org,
	baojun.xu@ti.com, k-lu@ti.com
Subject: Re: [PATCH v1] ASoC: tas2781: Add TAS2573 calibration support
Date: Sat, 12 Sep 2026 12:05:51 +0100	[thread overview]
Message-ID: <aqUyD2pQIS1JUXmF@sirena.org.uk> (raw)
In-Reply-To: <20260912051538.1052-1-shenghao-ding@ti.com>

[-- Attachment #1: Type: text/plain, Size: 1762 bytes --]

On Sat, Sep 12, 2026 at 01:15:38PM +0800, Shenghao Ding wrote:
> This patch adds complete calibration workflow support for TAS2573.

> @@ -210,6 +211,7 @@ struct tasdevice_rca {
>          * capture.
>          */
>         int capture_profile_id;
> +       int calibration_profile_id;

This should be initialised to -1 like the profile ID so that we don't
get false matches on unitialised values.

> --- a/include/sound/tas2781.h
> +++ b/include/sound/tas2781.h
> @@ -17,6 +17,8 @@
>  #ifndef __TAS2781_H__
>  #define __TAS2781_H__
>  
> +#define CONFIG_SND_SOC_TAS2781_ACOUST_I2C
> +
>  #ifdef CONFIG_SND_SOC_TAS2781_ACOUST_I2C
>  #include <linux/debugfs.h>
>  #endif

This looks like it was committed by mistake?

> +		/*
> +		 * If in the coef bin file are several configs with the
> +		 * keyword "calib", calibration_config_id only store the last
> +		 * calibration profile id.
> +		 */
> +		if (strnstr(config->name, "calib", 64)) {
> +			tas_fmw->calibration_config_id = i;
> +			dev_dbg(tas_priv->dev, "%s: calib cofig id = %d\n",

config.

> +static int tas2573_calib_start_put(struct snd_kcontrol *kcontrol,
> +	struct snd_ctl_elem_value *ucontrol)
> +{
> +	struct snd_soc_component *comp = snd_kcontrol_chip(kcontrol);
> +	struct tasdevice_priv *tas_priv = snd_soc_component_get_drvdata(comp);
> +	int cal_prof_id = tas_priv->rcabin.calibration_profile_id;
> +	int cal_conf_id = tas_priv->fmw->calibration_config_id;
> +
> +	guard(mutex)(&tas_priv->codec_lock);
> +	if (tas_priv->chip_id != TAS2573)
> +		return -1;

Should be a kernel error code, possibily with a WARN_ON_ONCE - we should
only register these controls for devices where they are supported so
this should be unreachable otherwise.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

      reply	other threads:[~2026-09-12 11:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-12  5:15 [PATCH v1] ASoC: tas2781: Add TAS2573 calibration support Shenghao Ding
2026-09-12 11:05 ` Mark Brown [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aqUyD2pQIS1JUXmF@sirena.org.uk \
    --to=broonie@kernel.org \
    --cc=13916275206@139.com \
    --cc=baojun.xu@ti.com \
    --cc=k-lu@ti.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-sound@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=shenghao-ding@ti.com \
    --cc=tiwai@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox