From mboxrd@z Thu Jan 1 00:00:00 1970 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 79EBBC83F2C for ; Sun, 3 Sep 2023 16:44:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245453AbjICQoi (ORCPT ); Sun, 3 Sep 2023 12:44:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56606 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231963AbjICQoh (ORCPT ); Sun, 3 Sep 2023 12:44:37 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4069E110 for ; Sun, 3 Sep 2023 09:44:33 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id CBCB11F38D; Sun, 3 Sep 2023 16:44:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1693759471; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=v+63eST4xeBRfHafIZ/k1ar2D/0FlzMp6mIqdRaQyls=; b=BKTHXS+kl7meGkm3of2iqV4eEfYo4U5YfysbP3RgAQR8+MWPKghOCvvX1lC3CG8IV/Puma oVgc0PUisqeb48rR+hrKOWI1LJNNP0v3JZSo5K9OrFM/IECnbAWu0nQYxR8fQXqcMi19Ub MQG0KBjCSZhRUoSzd1sbzUarVzHmtl8= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1693759471; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=v+63eST4xeBRfHafIZ/k1ar2D/0FlzMp6mIqdRaQyls=; b=tuwYKUWk5XZLT82iL6fjW+upLOwSwlB+caRUCG6ywFwKXIUxf0LQq+i2I7D1Fzc5PM/jPA Nz4ukFbooUsykWDw== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 7977013583; Sun, 3 Sep 2023 16:44:31 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id SBDQHO+39GTiIgAAMHmgww (envelope-from ); Sun, 03 Sep 2023 16:44:31 +0000 Date: Sun, 03 Sep 2023 18:44:30 +0200 Message-ID: <87pm2zkxzl.wl-tiwai@suse.de> From: Takashi Iwai To: Shenghao Ding Cc: , , , , , , <13916275206@139.com>, , , , , , , , , , Subject: Re: [PATCH v1 2/2] ALSA: hda/tas2781: Update tas2781 HDA driver In-Reply-To: <87ttsbkyht.wl-tiwai@suse.de> References: <20230903143759.92-1-shenghao-ding@ti.com> <20230903143759.92-2-shenghao-ding@ti.com> <87ttsbkyht.wl-tiwai@suse.de> User-Agent: Wanderlust/2.15.9 (Almost Unreal) Emacs/27.2 Mule/6.0 MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 03 Sep 2023 18:33:34 +0200, Takashi Iwai wrote: > > 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. Also, the support of two IDs can be unified to a single patch for changing both files. A patch isn't necessarily split per file; instead, it's split per logic. If applying the changes to multiple files at the same time makes more sense, those should be put in the same patch. thanks, Takashi > > > thanks, > > Takashi > > > > > > Signed-off-by: Shenghao Ding > > > > --- > > 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 > >