Re: [PATCH] ASoC: hda/realtek: Add support for Lenovo Hudson
From: Marco Giunta
Date: Wed Nov 11 2026 - 09:50:39 EST
Hi Tao,
Thank you for your contribution, it's amazing to see Awinic use our
driver.
The changes in aw88399_hda.c are fine, but the rest deserves some comment.
Mandatory fixes:
----------------
* Typo in the title: it should be "ALSA: hda/realtek", not "ASoC".
* As sashiko pointed out, both entries map to the same fixup, so one is
redundant and should be removed.
You didn't specify whether 17aa:3814 is the codec or PCI SSID, but given
that this value is also the ACPI SSID, and that all currently supported
Lenovo models have matching codec and ACPI SSIDs, I'd guess it's the
former. In this case, I would recommend just keeping the HDA_CODEC_QUIRK
entry: by matching based on the codec ID, the connection between the
corresponding bits of code in alc269.c and aw88399_hda.c is immediately
obvious, and using HDA_CODEC_QUIRK() makes the code self-documenting
that this isn't a PCI SSID, which is useful if in the future ID
collisions pop up.
Also, statistically speaking, these Lenovo laptops tend to share PCI
SSIDs more often than they do codec ones, so it should be safer overall
to use the latter. Or at least, this is the rationale behind my past
commits. Therefore, overall, I'd argue in favor of sticking to this one
convention for all AW88399 HDA devices' realtek quirks.
Alternatively, if you have arguments in favor of keeping the
SND_PCI_QUIRK() entry instead, of course it's also fine to keep that
one, possibly with the PCI SSID instead if needed (see below).
The important part is to fix the duplicated entries.
* Again as sashiko said, new quirks shouldn't mess with the sorting of the
quirk table. Exceptions are allowed if this is done to prevent SSID
collisions; unless your device's PCI SSID is already taken and its
value comes before the codec ID in the sorted table, please move the
quirk entry accordingly.
If you do need to avoid a collision, you can take a look at
commit 494978ae8243 ("ALSA: hda/realtek: enable AW88399 on Lenovo Legion
Pro") for reference.
Optional fixes:
---------------
* I would suggest explicitly mentioning the AW88399 in the title of the
commit message, so that it's immediately obvious from the commit history
that this isn't simply one of the usual realtek quirks, i.e. this commit
touches the AW88399 HDA driver as well despite being labelled as
"ALSA: hda/realtek".
More generally, "add support for device x" feels a bit generic; in the
past, I used something explicit like "ALSA: hda/realtek: enable AW88399
on Lenovo Legion R9000P AFR10". It's not strictly necessary that you
change the title to something with this style, but I suggest you do.
* Related to the previous point, naming the device as "Lenovo Hudson" in
the quirk entry feels a bit generic and unclear. I'd suggest appending
the product_family ID after the commercial name. This is also useful
to distinguish future products in the same family that may need quirks
as well.
Again, this isn't strictly mandatory, but I think it makes the code
clearer and more self-documenting, so I recommend it.
With these changes, a v2 gets:
Reviewed-by: Marco Giunta <marco_giunta@xxxxxxxxxx>
Thanks again for your contribution.
Best regards,
Marco