[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87jztq9iqv.wl-tiwai@suse.de>
Date: Sun, 20 Aug 2023 11:16:08 +0200
From: Takashi Iwai <tiwai@...e.de>
To: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Cc: Pierre-Louis Bossart <pierre-louis.bossart@...ux.intel.com>,
Shenghao Ding <shenghao-ding@...com>, robh+dt@...nel.org,
lgirdwood@...il.com, perex@...ex.cz, kevin-lu@...com,
13916275206@....com, alsa-devel@...a-project.org,
linux-kernel@...r.kernel.org, liam.r.girdwood@...el.com,
mengdong.lin@...el.com, baojun.xu@...com,
thomas.gfeller@...rop.com, peeyush@...com, navada@...com,
broonie@...nel.org, gentuser@...il.com
Subject: Re: [PATCH v3 2/2] ALSA: hda/tas2781: Add tas2781 HDA driver
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
Powered by blists - more mailing lists