alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Benjamin Poirier <benjamin.poirier@gmail.com>
To: Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.de>
Cc: alsa-devel@alsa-project.org, Kailang Yang <kailang@realtek.com>,
	linux-kernel@vger.kernel.org
Subject: [alsa-devel] [PATCH 1/2] ALSA: hda/realtek - Fix Lenovo Thinkpad X1 Carbon 7th quirk subdevice id
Date: Tue, 11 Feb 2020 14:56:50 +0900	[thread overview]
Message-ID: <20200211055651.4405-1-benjamin.poirier@gmail.com> (raw)

fixes the pci subsystem device ids for the "Thinkpad X1 Carbon 7th" and
"Thinkpad X1 Yoga 7th" quirks.

My machine reports the following:
dmidecode -t system
        Manufacturer: LENOVO
        Product Name: 20QDCTO1WW
        Version: ThinkPad X1 Carbon 7th

lspci -s 1f.3 -vnn
00:1f.3 Audio device [0403]: Intel Corporation Cannon Point-LP High Definition Audio Controller [8086:9dc8] (rev 11) (prog-if 80)
        Subsystem: Lenovo Cannon Point-LP High Definition Audio Controller [17aa:2292]

/proc/asound/card0/codec#0
	Subsystem Id: 0x17aa2293

Notice the different subsystem device ids between pci info and codec info.

commit d2cd795c4ece ("ALSA: hda - fixup for the bass speaker on Lenovo
Carbon X1 7th gen") added a quirk meant for the X1 Carbon but used device
id 0x2293. Note that this does not match the PCI SSID but it matches the
codec SSID.
commit 54a6a7dc107d ("ALSA: hda/realtek - Add quirk for the bass speaker on
Lenovo Yoga X1 7th gen") added a quirk meant for the X1 Yoga but used
subdevice id 0x2292, the PCI SSID used on the X1 Carbon.

Given that in snd_hdac_device_init() quirks are first matched by PCI SSID
and then, if there is no match, by codec SSID, the net result is that the
quirk labelled "Thinkpad X1 Yoga 7th" now gets applied on the X1 Carbon.
Example from my machine (an X1 Carbon, not Yoga):
[   15.817637] snd_hda_codec_realtek hdaudioC0D0: ALC285: picked fixup Thinkpad X1 Yoga 7th (PCI SSID)

Therefore, fix the subdevice id for the "ThinkPad X1 Carbon 7th" quirk.

Note that looking through the lspci outputs collected at
https://github.com/linuxhw/LsPCI/tree/master/Notebook/Lenovo/ThinkPad
all X1 Carbon there have an Audio device with PCI SSID 0x2292, which
matches with the output from my machine.

This leaves the question of what to do with the quirk labelled "Thinkpad X1
Yoga 7th".

From email discussions, it seems that the author of commit 54a6a7dc107d
("ALSA: hda/realtek - Add quirk for the bass speaker on Lenovo Yoga X1 7th
gen") did not have a device to test the changes. I don't have an X1 Yoga
either and I did not find a sample lspci listing for it online. Therefore,
the best course of action seems to be to remove that quirk. In the best
case, the quirk for the X1 Carbon will match the X1 Yoga (via PCI SSID or
codec SSID). In the worst case, it will not and someone who actually has
such a machine should come forth with concrete data about subsystem ids and
needed quirks.

Fixes: d2cd795c4ece ("ALSA: hda - fixup for the bass speaker on Lenovo Carbon X1 7th gen")
Fixes: 54a6a7dc107d ("ALSA: hda/realtek - Add quirk for the bass speaker on Lenovo Yoga X1 7th gen")
Link: https://lore.kernel.org/alsa-devel/20200210025249.GA2700@f3/
Cc: Jaroslav Kysela <perex@perex.cz>
Cc: Kailang Yang <kailang@realtek.com>
Signed-off-by: Benjamin Poirier <benjamin.poirier@gmail.com>
---
 sound/pci/hda/patch_realtek.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 4770fb3f51fb..05d44df2008e 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -7268,8 +7268,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
 	SND_PCI_QUIRK(0x17aa, 0x224c, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
 	SND_PCI_QUIRK(0x17aa, 0x224d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
 	SND_PCI_QUIRK(0x17aa, 0x225d, "Thinkpad T480", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
-	SND_PCI_QUIRK(0x17aa, 0x2292, "Thinkpad X1 Yoga 7th", ALC285_FIXUP_SPEAKER2_TO_DAC1),
-	SND_PCI_QUIRK(0x17aa, 0x2293, "Thinkpad X1 Carbon 7th", ALC285_FIXUP_SPEAKER2_TO_DAC1),
+	SND_PCI_QUIRK(0x17aa, 0x2292, "Thinkpad X1 Carbon 7th", ALC285_FIXUP_SPEAKER2_TO_DAC1),
 	SND_PCI_QUIRK(0x17aa, 0x30bb, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY),
 	SND_PCI_QUIRK(0x17aa, 0x30e2, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY),
 	SND_PCI_QUIRK(0x17aa, 0x310c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
-- 
2.25.0

_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel

             reply	other threads:[~2020-02-11  5:58 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-11  5:56 Benjamin Poirier [this message]
2020-02-11  5:56 ` [alsa-devel] [PATCH 2/2] ALSA: hda/realtek - Fix Lenovo Thinkpad X1 Carbon 7th quirk value Benjamin Poirier
2020-02-11  7:40   ` Jaroslav Kysela
2020-02-11  8:16     ` Benjamin Poirier
2020-02-11  9:10       ` Kailang
2020-02-11  9:20         ` Takashi Iwai
2020-02-11  9:57           ` Kailang
2020-02-12  6:32           ` Kailang
2020-02-11  9:35       ` Jaroslav Kysela
2020-02-11 11:42         ` Benjamin Poirier
2020-02-11 13:56           ` Jaroslav Kysela

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200211055651.4405-1-benjamin.poirier@gmail.com \
    --to=benjamin.poirier@gmail.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=kailang@realtek.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=tiwai@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).