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 DBA16EE49A5 for ; Sun, 20 Aug 2023 09:16:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230186AbjHTJQX (ORCPT ); Sun, 20 Aug 2023 05:16:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34314 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230202AbjHTJQT (ORCPT ); Sun, 20 Aug 2023 05:16:19 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B92134EE7 for ; Sun, 20 Aug 2023 02:16:10 -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 595F121862; Sun, 20 Aug 2023 09:16:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1692522969; 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=/TF6kVTX6ebBQDIHld1IKl2lO7dkwxnRa+fdMooao6M=; b=n0NuEUOqFdzE0K7Jgy0vnbuuGIMWkQ/g6b3cCzdJLZcplQTHTMQJ04Bm01cBk2/uEkejhW WPyFHvs/vj4XpX9bvLdruRN7+T6zbh+0e0lrLVA3R1iqzv16LoNm7xM1u4mIX1fgyhhG/P Df9fZrj4779uiGPqM8TGLEbbbzn2hYY= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1692522969; 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=/TF6kVTX6ebBQDIHld1IKl2lO7dkwxnRa+fdMooao6M=; b=dbteixOI0KFb2auoIq/LlURJ2+K1vBlg0pr+QpyLjUlzQCTnL8RAFkePDA7App0/WVBdpM pXOrntkNE5cC48Dg== 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 F1F311348E; Sun, 20 Aug 2023 09:16:08 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id ZqCjOdjZ4WSwMgAAMHmgww (envelope-from ); Sun, 20 Aug 2023 09:16:08 +0000 Date: Sun, 20 Aug 2023 11:16:08 +0200 Message-ID: <87jztq9iqv.wl-tiwai@suse.de> From: Takashi Iwai To: Andy Shevchenko Cc: Pierre-Louis Bossart , Shenghao Ding , robh+dt@kernel.org, lgirdwood@gmail.com, perex@perex.cz, 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 v3 2/2] ALSA: hda/tas2781: Add tas2781 HDA driver In-Reply-To: References: <20230818085558.1431-1-shenghao-ding@ti.com> <20230818085558.1431-2-shenghao-ding@ti.com> <4c1b44b5-995a-fac7-a72b-89b8bf816dd2@linux.intel.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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 18 Aug 2023 19:01:16 +0200, Andy Shevchenko wrote: > > On Fri, Aug 18, 2023 at 11:00:34AM -0500, Pierre-Louis Bossart wrote: > > ... > > > > +static int comp_match_tas2781_dev_name(struct device *dev, > > > + void *data) > > > +{ > > > + struct scodec_dev_name *p = data; > > > + const char *d = dev_name(dev); > > > + int n = strlen(p->bus); > > > + char tmp[32]; > > > + > > > + /* check the bus name */ > > > + if (strncmp(d, p->bus, n)) > > > + return 0; > > > > + /* skip the bus number */ > > > + if (isdigit(d[n])) > > > + n++; > > Why do you think it can't be two or more digits? > > > > + /* the rest must be exact matching */ > > > + snprintf(tmp, sizeof(tmp), "-%s:00", p->hid); > > > > ACPI can sometimes add :01 suffixes, this looks like the re-invention of > > an ACPI helper? > > > > Adding Andy for the ACPI review. > > > > > + return !strcmp(d + n, tmp); > > > +} > > Yes, this looks like reinventing a wheel. > Just compare dev_name() against what is in p->.... Note that comp_match_tas7281_dev_name() is a copy of comp_patch_cs35l41_dev_name() and it was implemented in a hackish way to be applicable to both I2C and SPI device names that have slightly different naming rules. > ... > > > > +static void tas2781_fixup_i2c(struct hda_codec *cdc, > > > + const struct hda_fixup *fix, int action) > > > +{ > > > + tas2781_generic_fixup(cdc, action, "i2c", "TIAS2781"); > > > > TI ACPI ID is TXNW > > > > https://uefi.org/ACPI_ID_List?search=TEXAS > > > > There's also a PNP ID PXN > > > > https://uefi.org/PNP_ID_List?search=TEXAS > > > > "TIAS" looks like an invented identifier. It's not uncommon but should > > be recorded with a comment if I am not mistaken. > > > > > +} > > Thank you, but actually it's a strong NAK to this even with the comment. > We have to teach people to follow the specification (may be even hard way). > > So where did you get the ill-formed ACPI ID? > Is Texas Instrument aware of this? > Can we have a confirmation letter from TI for this ID, please? This is used already for products that have been long in the market, so it's way too late to correct it, I'm afraid. What we can do is to get the confirmation from TI, complain it, and some verbose comment in the code, indeed. thanks, Takashi