All of lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Shenghao Ding <shenghao-ding@ti.com>
Cc: <broonie@kernel.org>, <andriy.shevchenko@linux.intel.com>,
	<13564923607@139.com>, <alsa-devel@alsa-project.org>,
	<linux-kernel@vger.kernel.org>, <baojun.xu@ti.com>,
	<Baojun.Xu@fpt.com>, <robinchen@ti.com>
Subject: Re: [PATCH v1] ALSA: hda/tas2781: Support dsp firmware Alpha and Beta seaies
Date: Tue, 25 Mar 2025 11:42:15 +0100	[thread overview]
Message-ID: <87r02lcry0.wl-tiwai@suse.de> (raw)
In-Reply-To: <20250325103612.2021-1-shenghao-ding@ti.com>

On Tue, 25 Mar 2025 11:36:12 +0100,
Shenghao Ding wrote:
> 
> For calibration data, basic version firmware does not contain any
> calibration addresses, it depends on calibration tool to convey the
> addresses to the driver. Since Alpha and Beta firmware, all the
> calibration addresses are saved into the firmware.

The description is same with the other changes in ASoC and that's
*very* confusing.

Please give the proper description that matches with the actual
change.  Also consider a better subject line, too.

The same problem happened already a few times from your submitted
series in the past.  Please try to improve the process.


thanks,

Takashi

> Signed-off-by: Shenghao Ding <shenghao-ding@ti.com>
> 
> ---
> v1:
>  - Add updating calibration addresses code into tas2781_apply_calib in
>    case of Alpha and Beta firmware.
> ---
>  sound/pci/hda/tas2781_hda_i2c.c | 30 ++++++++++++++++++++----------
>  1 file changed, 20 insertions(+), 10 deletions(-)
> 
> diff --git a/sound/pci/hda/tas2781_hda_i2c.c b/sound/pci/hda/tas2781_hda_i2c.c
> index 50c5e5f26589..cb3d683013d9 100644
> --- a/sound/pci/hda/tas2781_hda_i2c.c
> +++ b/sound/pci/hda/tas2781_hda_i2c.c
> @@ -558,28 +558,38 @@ static int tas2563_save_calibration(struct tasdevice_priv *tas_priv)
>  
>  static void tas2781_apply_calib(struct tasdevice_priv *tas_priv)
>  {
> -	static const unsigned char page_array[CALIB_MAX] = {
> -		0x17, 0x18, 0x18, 0x13, 0x18,
> +	struct calidata *cali_data = &tas_priv->cali_data;
> +	struct cali_reg *r = &cali_data->cali_reg_array;
> +	unsigned int cali_reg[CALIB_MAX] = {
> +		TASDEVICE_REG(0, 0x17, 0x74),
> +		TASDEVICE_REG(0, 0x18, 0x0c),
> +		TASDEVICE_REG(0, 0x18, 0x14),
> +		TASDEVICE_REG(0, 0x13, 0x70),
> +		TASDEVICE_REG(0, 0x18, 0x7c),
>  	};
> -	static const unsigned char rgno_array[CALIB_MAX] = {
> -		0x74, 0x0c, 0x14, 0x70, 0x7c,
> -	};
> -	int offset = 0;
>  	int i, j, rc;
> +	int oft = 0;
>  	__be32 data;
>  
> +	if (tas_priv->dspbin_typ != TASDEV_BASIC) {
> +		cali_reg[0] = r->r0_reg;
> +		cali_reg[1] = r->invr0_reg;
> +		cali_reg[2] = r->r0_low_reg;
> +		cali_reg[3] = r->pow_reg;
> +		cali_reg[4] = r->tlimit_reg;
> +	}
> +
>  	for (i = 0; i < tas_priv->ndev; i++) {
>  		for (j = 0; j < CALIB_MAX; j++) {
>  			data = cpu_to_be32(
> -				*(uint32_t *)&tas_priv->cali_data.data[offset]);
> +				*(uint32_t *)&tas_priv->cali_data.data[oft]);
>  			rc = tasdevice_dev_bulk_write(tas_priv, i,
> -				TASDEVICE_REG(0, page_array[j], rgno_array[j]),
> -				(unsigned char *)&data, 4);
> +				cali_reg[j], (unsigned char *)&data, 4);
>  			if (rc < 0)
>  				dev_err(tas_priv->dev,
>  					"chn %d calib %d bulk_wr err = %d\n",
>  					i, j, rc);
> -			offset += 4;
> +			oft += 4;
>  		}
>  	}
>  }
> -- 
> 2.34.1
> 

      reply	other threads:[~2025-03-25 10:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-25 10:36 [PATCH v1] ALSA: hda/tas2781: Support dsp firmware Alpha and Beta seaies Shenghao Ding
2025-03-25 10:42 ` Takashi Iwai [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=87r02lcry0.wl-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=13564923607@139.com \
    --cc=Baojun.Xu@fpt.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=baojun.xu@ti.com \
    --cc=broonie@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robinchen@ti.com \
    --cc=shenghao-ding@ti.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.