From: Takashi Iwai <tiwai@suse.de>
To: Shenghao Ding <shenghao-ding@ti.com>
Cc: <robh+dt@kernel.org>, <andriy.shevchenko@linux.intel.com>,
<lgirdwood@gmail.com>, <perex@perex.cz>,
<pierre-louis.bossart@linux.intel.com>, <kevin-lu@ti.com>,
<13916275206@139.com>, <alsa-devel@alsa-project.org>,
<linux-kernel@vger.kernel.org>, <liam.r.girdwood@intel.com>,
<mengdong.lin@intel.com>, <baojun.xu@ti.com>,
<thomas.gfeller@q-drop.com>, <peeyush@ti.com>, <navada@ti.com>,
<broonie@kernel.org>, <gentuser@gmail.com>
Subject: Re: [PATCH v1 2/2] ALSA: hda/tas2781: Update tas2781 HDA driver
Date: Sun, 03 Sep 2023 18:33:34 +0200 [thread overview]
Message-ID: <87ttsbkyht.wl-tiwai@suse.de> (raw)
In-Reply-To: <20230903143759.92-2-shenghao-ding@ti.com>
On Sun, 03 Sep 2023 16:37:58 +0200,
Shenghao Ding wrote:
>
> Support ACPI_ID both TXNW2781 and TIAS2781, update dsp/bypass mode
> switching in tasdevice_program_put.
Again, if you change multiple things, split to individual patches.
thanks,
Takashi
>
> Signed-off-by: Shenghao Ding <shenghao-ding@ti.com>
>
> ---
> Changes in v1:
> - Add comment on dsp/bypass mode in tasdevice_program_put and
> tasdevice_info_programs
> - TIAS2781 has been used by our customers, see following dstd.dsl. We
> have discussed this with them, they requested TIAS2781 must be
> supported for the laptops already released to market, their new laptop
> can switch to TXNW2781
> Name (_HID, "TIAS2781") // _HID: Hardware ID
> Name (_UID, Zero) // _UID: Unique ID
> Method (_SUB, 0, NotSerialized) // _SUB: Subsystem ID
> {
> If ((SPID == Zero))
> {
> Return ("17AA3886")
> }
>
> If ((SPID == One))
> {
> Return ("17AA3884")
> }
> }
> ---
> sound/pci/hda/tas2781_hda_i2c.c | 15 ++++++++++++---
> 1 file changed, 12 insertions(+), 3 deletions(-)
>
> diff --git a/sound/pci/hda/tas2781_hda_i2c.c b/sound/pci/hda/tas2781_hda_i2c.c
> index fb80280293..5250d300a2 100644
> --- a/sound/pci/hda/tas2781_hda_i2c.c
> +++ b/sound/pci/hda/tas2781_hda_i2c.c
> @@ -199,8 +199,11 @@ static int tasdevice_info_programs(struct snd_kcontrol *kcontrol,
>
> uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
> uinfo->count = 1;
> + /* 0: dsp mode
> + * non-zero: bypass mode
> + */
> uinfo->value.integer.min = 0;
> - uinfo->value.integer.max = tas_fw->nr_programs - 1;
> + uinfo->value.integer.max = tas_fw->nr_programs;
>
> return 0;
> }
> @@ -238,7 +241,10 @@ static int tasdevice_program_put(struct snd_kcontrol *kcontrol,
> int max = tas_fw->nr_programs - 1;
> int val, ret = 0;
>
> - val = clamp(nr_program, 0, max);
> + /* 0: dsp mode
> + * non-zero: bypass mode
> + */
> + val = (nr_program) ? max : 0;
>
> if (tas_priv->cur_prog != val) {
> tas_priv->cur_prog = val;
> @@ -647,7 +653,9 @@ static int tas2781_hda_i2c_probe(struct i2c_client *clt)
> const char *device_name;
> int ret;
>
> - if (strstr(dev_name(&clt->dev), "TIAS2781"))
> + if (strstr(dev_name(&clt->dev), "TXNW2781"))
> + device_name = "TXNW2781";
> + else if (strstr(dev_name(&clt->dev), "TIAS2781"))
> device_name = "TIAS2781";
> else
> return -ENODEV;
> @@ -824,6 +832,7 @@ static const struct i2c_device_id tas2781_hda_i2c_id[] = {
>
> static const struct acpi_device_id tas2781_acpi_hda_match[] = {
> {"TIAS2781", 0 },
> + {"TXNW2781", 1 },
> {}
> };
> MODULE_DEVICE_TABLE(acpi, tas2781_acpi_hda_match);
> --
> 2.34.1
>
next prev parent reply other threads:[~2023-09-03 16:34 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-03 14:37 [PATCH v1 1/2] ALSA: hda/tas2781: Update tas2781 HDA driver Shenghao Ding
2023-09-03 14:37 ` [PATCH v1 2/2] " Shenghao Ding
2023-09-03 16:33 ` Takashi Iwai [this message]
2023-09-03 16:44 ` Takashi Iwai
2023-09-03 16:32 ` [PATCH v1 1/2] " Takashi Iwai
2023-09-04 10:17 ` Andy Shevchenko
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=87ttsbkyht.wl-tiwai@suse.de \
--to=tiwai@suse.de \
--cc=13916275206@139.com \
--cc=alsa-devel@alsa-project.org \
--cc=andriy.shevchenko@linux.intel.com \
--cc=baojun.xu@ti.com \
--cc=broonie@kernel.org \
--cc=gentuser@gmail.com \
--cc=kevin-lu@ti.com \
--cc=lgirdwood@gmail.com \
--cc=liam.r.girdwood@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mengdong.lin@intel.com \
--cc=navada@ti.com \
--cc=peeyush@ti.com \
--cc=perex@perex.cz \
--cc=pierre-louis.bossart@linux.intel.com \
--cc=robh+dt@kernel.org \
--cc=shenghao-ding@ti.com \
--cc=thomas.gfeller@q-drop.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox