Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp4204057rwd; Tue, 23 May 2023 04:54:12 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ43lbDoaZKtfcNiFlUe/yLKBvnEt5fKIAqUR7meVz0nbg23LjHCbGwKt6MEAqup+hCvUTuN X-Received: by 2002:a17:90a:4286:b0:253:6db6:18be with SMTP id p6-20020a17090a428600b002536db618bemr12737370pjg.14.1684842851659; Tue, 23 May 2023 04:54:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684842851; cv=none; d=google.com; s=arc-20160816; b=XiX+rft9HNS8z4JXORc+qL9Aihd9NUgOFtW9iRz6TFW9uFY/qEnMWgnGpxKpik/UOJ cxHCRUqXZAg4c5FFQaSn40zXCyE4drm7AiEIUJ491i3qxWD8c75Cq7o0oSK8xSlnsGhd +DfBsWb2/KNqW4WMlpY57Vi92ZfDiQ70irokMacUojZJwYGtM0KVvmQxQJesodGJ7qVa UDJIrykJT/nQ78qm9wl1xGayadfPLNFxcayfRYm7i2mq5i1IrIkxkurEML6kWNXSp3q4 Dfi/IAUJDOmS/T7+0G/4OqSTJtAKZZ0RbwUwWW61tzES7zA8NBLGfTP9e/3J/9gDcUq4 CkIg== 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=Y5OsFTJQlT1HP4PZ2CxU3TzCtEIcI+DtJ1ZvdSvwdV8=; b=SR+N69QqNb4SzQ6FTIYq2X456oomitVYJdckhat+HdQh6aDtsmlyF2piDVBBvNdpSh TemJ81zV11oeMBy9m7YrwA3IhDUmtFzsyGaqkKSUQGbDTKqCZvgrtGuaNtzDlWZ0YnJr uqglgDOLZOTovSUdaSRxrTJuDK0hjv9KzOA3ytWWZmb910F2mzKyMKdf94UjjGBea/De wiKz4iy/25EwOGmOBhkS72uvN+B7yHs1Stj5yi1eObUqX1ryA4QXs7+ynyKlDktzDYDe 7U0XgnHx2lrZT9pHoy7fcVBkFy5a/1lsgPYbFplJhnQvkdLKm7SldArrSlkdPzPj9/0D laTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=woqqhvTE; 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 w189-20020a6382c6000000b00530b7eca08dsi6880558pgd.51.2023.05.23.04.53.57; Tue, 23 May 2023 04:54:11 -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=woqqhvTE; 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 S236532AbjEWLmj (ORCPT + 99 others); Tue, 23 May 2023 07:42:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59364 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230197AbjEWLmi (ORCPT ); Tue, 23 May 2023 07:42:38 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D0E4FFE; Tue, 23 May 2023 04:42:36 -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-out1.suse.de (Postfix) with ESMTPS id 8197B229AD; Tue, 23 May 2023 11:42:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1684842155; 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=Y5OsFTJQlT1HP4PZ2CxU3TzCtEIcI+DtJ1ZvdSvwdV8=; b=woqqhvTEeKGw14U0e+mSdFr7+Xm5nkc7Vq/PMqB96PXoXs4riCpEY7i21rIyCnQ9kYIN83 U/lUQTWG6RvI0W+6tzfFu/eZ256WR+J8/oexJpyhj8HvYtwigCFxCcDgD8NPQH1kTEEKkb YOLS2pRDXw8cTZJObz7BWypBem4aDho= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1684842155; 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=Y5OsFTJQlT1HP4PZ2CxU3TzCtEIcI+DtJ1ZvdSvwdV8=; b=ZkvCZau2Mms91EZ20b1cE7FhxReUJxXFJtR6iJagHk/Bjm4ALKeBdRluxvKqdxtfnUDHvL hWmso+f7JNUs6nDQ== 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 0435213588; Tue, 23 May 2023 11:42:35 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id YT0YAKumbGTJFAAAMHmgww (envelope-from ); Tue, 23 May 2023 11:42:34 +0000 Date: Tue, 23 May 2023 13:42:34 +0200 Message-ID: <87353ngtp1.wl-tiwai@suse.de> From: Takashi Iwai To: "Ding, Shenghao" Cc: Shenghao Ding <13916275206@139.com>, "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" , "Lu, Kevin" , "alsa-devel@alsa-project.org" , "linux-kernel@vger.kernel.org" , "Xu, Baojun" , "Gupta, Peeyush" , "Navada Kanyana, Mukund" , "gentuser@gmail.com" , "Ryan_Chu@wistron.com" , "Sam_Wu@wistron.com" Subject: Re: [EXTERNAL] Re: [PATCH v3 4/5] ALSA: hda/tas2781: Add tas2781 HDA driver In-Reply-To: <9daf95da47b540329aa9fbbd2df5e504@ti.com> References: <20230519080227.20224-1-13916275206@139.com> <871qjayuvv.wl-tiwai@suse.de> <9daf95da47b540329aa9fbbd2df5e504@ti.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,URIBL_BLOCKED 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 Tue, 23 May 2023 13:22:03 +0200, Ding, Shenghao wrote: > > > + [ALC287_FIXUP_TAS2781_I2C_2] = { > > + .type = HDA_FIXUP_FUNC, > > + .v.func = tas2781_fixup_i2c, > > + .chained = true, > > + .chain_id = ALC269_FIXUP_THINKPAD_ACPI, > > + }, > > + [ALC287_FIXUP_TAS2781_I2C_4] = { > > + .type = HDA_FIXUP_FUNC, > > + .v.func = tas2781_fixup_i2c, > > + .chained = true, > > + .chain_id = ALC269_FIXUP_THINKPAD_ACPI, > > + }, > > What's a difference between *_2 and *_4? > Combine them into ALC287_FIXUP_TAS2781_I2C Hm, so there is no difference in stereo and quad speakers? > > +static int tas2781_save_calibration(struct tasdevice_priv *tas_priv) > > +{ > > + efi_guid_t efi_guid = EFI_GUID(0x02f9af02, 0x7734, 0x4233, 0xb4, 0x3d, > > + 0x93, 0xfe, 0x5a, 0xa3, 0x5d, 0xb3); > > + static efi_char16_t efi_name[] = L"CALI_DATA"; > > + struct hda_codec *codec = tas_priv->codec; > > + unsigned int subid = codec->core.subsystem_id & 0xFFFF; > > + struct tm *tm = &tas_priv->tm; > > + unsigned int attr, crc; > > + unsigned int *tmp_val; > > + efi_status_t status; > > + int ret = 0; > > + > > + //Lenovo devices > > + if ((subid == 0x387d) || (subid == 0x387e) || (subid == 0x3881) > > + || (subid == 0x3884) || (subid == 0x3886) || (subid == 0x38a7) > > + || (subid == 0x38a8) || (subid == 0x38ba) || (subid == 0x38bb) > > + || (subid == 0x38be) || (subid == 0x38bf) || (subid == 0x38c3) > > + || (subid == 0x38cb) || (subid == 0x38cd)) > > + efi_guid = EFI_GUID(0x1f52d2a1, 0xbb3a, 0x457d, 0xbc, 0x09, > > + 0x43, 0xa3, 0xf4, 0x31, 0x0a, 0x92); > > Here can be a problem: the device ID is embedded here, and it's hard to find out. You'd better to make it some quirk flag that is set in a common place and check the flag here instead of checking ID at each place. > > Do you have example of the solution? I found some quirk flag is static in the patch_realtek.c, can't be accessed outside that file. You may store some values in struct hda_component, I suppose? BTW, please try to fix your mailer to do citation more correctly... thanks, Takashi