Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp35458340rwd; Mon, 10 Jul 2023 07:45:16 -0700 (PDT) X-Google-Smtp-Source: APBJJlH0WiOo7N7WHS5SRc9bVLEuz1M1C2/hasH0Wew4Gbb2/S0auKctCApv9voAxeZP4PkSCZey X-Received: by 2002:a2e:9189:0:b0:2b6:e2c6:6e1c with SMTP id f9-20020a2e9189000000b002b6e2c66e1cmr9737909ljg.14.1689000316278; Mon, 10 Jul 2023 07:45:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689000316; cv=none; d=google.com; s=arc-20160816; b=pmDOwlJuQEdEkL8FbRb2nZkBB+OEnYdstakXdakVXpGLqM3ahQzzcExRC2veAScsRG AAA6I3cpv76myfDRevOM3atDdd3p/kjt3T1Ewt16n02aaBeyGl69WgPJw4MP1TVgv2Wg 7wH0eLH0LaN2w2f5oDqN86BTl8slbGtJg4xLcePIwmk7h0p+cd61aNx+nGDREUWDBUTq +7yk1Xp9wEZvAJkzY8c0VbCheaqw/PlDEAm6uv7dSfxxV1VhSmzUU45Gbst3RnJay/+l c4Px5loGKhies5AxO9kGZ2lLSto28GJXoEJKBPzqvIKc2jIPAN1/a7WoTHBnmH/9Kldk /nyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:in-reply-to :subject:cc:to:from:message-id:date:dkim-signature:dkim-signature; bh=SjlMk0EbffxuJOjramPPb1TR2XCPnRGkKXj9Qt7aAIQ=; fh=lbOXwbmRwibrZA3oysbCGqqt0S/iTg0hT0dOvhtAEu0=; b=Hdbp26Flo3jUgrR1FJ0iMFDOuSf3BSHYhGN5Z6IgW/vF3D5Lk95RArtqqRWBgY2D/f R9Hi32FLwJ5xhh/ayp6dikK6H6OzBmoqtadvugWg69Wf+eNqV3MUiTQXgd3BmAc6UXHe /pneZvJiZvGqnesFJSbMvmNNHJZX4LAm0E4tEL7Ka27V7W0WchKMamzYGULGBO7pz1W3 4pnk3rzegaB0w0GlKYZ/o/u0Yi4+QTZYSjFfHv+fH392rZpTRRT9mylEVSkUpDPHgDZP wfFCA6VXuJwGGmkP1YZdyoFwcRTqR1uptThSM3djluB6MJXssSkd1wG/0SEAUUIY4b4S tXwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=O2gr+3UK; dkim=neutral (no key) header.i=@suse.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h18-20020a17090634d200b0098874eb2096si5676593ejb.988.2023.07.10.07.44.51; Mon, 10 Jul 2023 07:45:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=O2gr+3UK; dkim=neutral (no key) header.i=@suse.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233243AbjGJOa6 (ORCPT + 99 others); Mon, 10 Jul 2023 10:30:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47038 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231578AbjGJOa5 (ORCPT ); Mon, 10 Jul 2023 10:30:57 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1AB6EBB; Mon, 10 Jul 2023 07:30:56 -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 8CF8B1FFA2; Mon, 10 Jul 2023 14:30:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1688999454; 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=SjlMk0EbffxuJOjramPPb1TR2XCPnRGkKXj9Qt7aAIQ=; b=O2gr+3UKqOIqNDknFnuyExnyA2GyVIpvfbTUZDFkgROlAWUvecJcwYBk3f9qGdVarxw/ps iYm9yXIxGqTMj6uOyBg9AOjOa6C47zxfKmHOjkBeM2H6wJPzHQFk4GzPrYOUFukNxmzOIN sIbyCBg0nbtitfhDHZO7FLFcMSBlk64= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1688999454; 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=SjlMk0EbffxuJOjramPPb1TR2XCPnRGkKXj9Qt7aAIQ=; b=1x34zqImdfaqQE5pWTOJvMwf0R480bRp7n1ETIvCExjCri9k/g4gKTj4ALsioIT21D4zyp 5bOQX6oDJRF4NWAA== 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 2E1E713A05; Mon, 10 Jul 2023 14:30:54 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id SJlECh4WrGS8QwAAMHmgww (envelope-from ); Mon, 10 Jul 2023 14:30:54 +0000 Date: Mon, 10 Jul 2023 16:30:53 +0200 Message-ID: <87351vzvmq.wl-tiwai@suse.de> From: Takashi Iwai To: Shenghao Ding <13916275206@139.com> Cc: broonie@kernel.org, devicetree@vger.kernel.org, krzysztof.kozlowski+dt@linaro.org, robh+dt@kernel.org, lgirdwood@gmail.com, perex@perex.cz, pierre-louis.bossart@linux.intel.com, kevin-lu@ti.com, shenghao-ding@ti.com, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, liam.r.girdwood@intel.com, mengdong.lin@intel.com, x1077012@ti.com, peeyush@ti.com, navada@ti.com Subject: Re: [PATCH v2 1/3] ALSA: hda/tas2781: Add tas2781 HDA driver In-Reply-To: <20230710041217.151099-1-13916275206@139.com> References: <20230710041217.151099-1-13916275206@139.com> 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 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 10 Jul 2023 06:12:15 +0200, Shenghao Ding wrote: > > Integrate tas2781 configs for Lenovo Laptops. All of the tas2781s in the > laptop will be aggregated as one audio device. The code support realtek > as the primary codec. Rename "struct cs35l41_dev_name" to > "struct scodec_dev_name" for all other side codecs instead of the certain > one. > > Signed-off-by: Shenghao Ding <13916275206@139.com> > > --- > Changes in v2: > - simplify the check of vendor id with Lenovo > - ThinkPad is one of Lenovo's brands, they suggested me to use > ALC269_FIXUP_THINKPAD_ACPI. > - Add comments on ACARD_SINGLE_RANGE_EXT_TLV > - Add the range check for tas_priv->tasdevice[] in tas2781_acpi_get_i2c_res. > - remove acpi_subsystem_id > - Issue in Laptop 0x17aa38be ACPI talbe caused codec->bus->pci->subsystem_device > is not equal to (codec->core.subsystem_id & 0xffff) in snd_hda_pick_fixup. > The former is 0x3802 and the latter is 0x38be leads to getting the wrong > fixup_id and enter into the wrong entry. Although, this issue has been raised > to the laptop manufacturer, but the ACPI table is locked, cannot be changed > any more. Correct the wrong entry in the code. > - Rename "struct cs35l41_dev_name" to "struct scodec_dev_name" for all > other side codecs instead of one certain codec. > - Ignore the checkpatch complaints in alc269_fixup_tbl > - Drop the hunk which is irrelevant with my code in > alc_fixup_headset_mode_alc255_no_hp_mic > - Add tiwai@suse.de into Cc list > - remove useless index > - combine ALC287_FIXUP_TAS2781_I2C_2 and ALC287_FIXUP_TAS2781_I2C_4 together as > ALC287_FIXUP_TAS2781_I2C, The code view all the tas2781s in the laptop as one instance. > - delete the white space at the end of the line in alc_fixup_headset_mode_alc255_no_hp_mic The patch looks almost fine. Just a few things: > @@ -6730,12 +6730,32 @@ static int comp_match_cs35l41_dev_name(struct device *dev, void *data) > return !strcmp(d + n, tmp); > } > > +static int comp_match_tas2781_dev_name(struct device *dev, > + void *data) The indentation in the patch doesn't look good. I don't want to be too strict about it, but this inconsistent indentation makes reading quite difficult, so better to be fixed. In general, it's recommended to align the opened parenthesis. (But, in the case above, you don't need to break the line at all.) > @@ -10761,6 +10843,22 @@ static int patch_alc269(struct hda_codec *codec) > codec->fixup_id = HDA_FIXUP_ID_NOT_SET; > } > > + /* FIXME: Issue in Laptop 0x17aa38be ACPI talbe caused > + * codec->bus->pci->subsystem_device is not equal to > + * (codec->core.subsystem_id & 0xffff) in snd_hda_pick_fixup. > + * The former is 0x3802 and the latter is 0x38be leads to getting the > + * wrong fixup_id and enter into the wrong entry. Although, this issue > + * has been raised to the laptop manufacturer, but the ACPI table is > + * locked, cannot be changed any more. Correct the wrong entry in the > + * code. > + */ > + if (codec->fixup_id == ALC287_FIXUP_YOGA7_14ITL_SPEAKERS && > + codec->core.vendor_id == 0x10ec0287 && > + codec->core.subsystem_id == 0x17aa38be) { > + codec_dbg(codec, "Clear wrong fixup for 17aa38be\n"); > + codec->fixup_id = ALC287_FIXUP_TAS2781_I2C; > + } This should be rather applied differently. A similar workaround was found in the commit 56ec3e755bd1041d35bdec020a99b327697ee470 ALSA: hda/realtek: Apply fixup for Lenovo Yoga Duet 7 properly thanks, Takashi