From: "Pali Rohár" <pali.rohar@gmail.com>
To: Takashi Iwai <tiwai@suse.de>
Cc: Henrique de Moraes Holschuh <ibm-acpi@hmh.eng.br>,
ibm-acpi-devel@lists.sourceforge.net,
platform-driver-x86@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: ThinkPad T480s & LED_MUTE, LED_MICMUTE
Date: Tue, 19 Jun 2018 10:37:12 +0200 [thread overview]
Message-ID: <20180619083712.dwb4d357sfxcgrre@pali> (raw)
In-Reply-To: <20180618112121.cl76a3oozsbbbqnb@pali>
On Monday 18 June 2018 13:21:21 Pali Rohár wrote:
> On Monday 18 June 2018 12:36:31 Takashi Iwai wrote:
> > On Mon, 18 Jun 2018 12:28:06 +0200,
> > Pali Rohár wrote:
> > >
> > > On Saturday 16 June 2018 18:02:14 Takashi Iwai wrote:
> > > > On Sat, 16 Jun 2018 17:43:09 +0200,
> > > > Pali Rohár wrote:
> > > > >
> > > > > On Saturday 16 June 2018 09:05:41 Takashi Iwai wrote:
> > > > > > On Fri, 15 Jun 2018 21:09:59 +0200,
> > > > > > Pali Rohár wrote:
> > > > > > >
> > > > > > > On Friday 15 June 2018 14:51:47 Takashi Iwai wrote:
> > > > > > > > On Fri, 08 Jun 2018 13:10:57 +0200,
> > > > > > > > Pali Rohár wrote:
> > > > > > > > >
> > > > > > > > > Hi! With up-to-date thinkpad_acpi.ko driver on ThinkPad T480s I'm seeing
> > > > > > > > > a strange behavior of LEDs which are integrated into mic mute (Fn+F4)
> > > > > > > > > and mute (Fn+F1) keys.
> > > > > > > > >
> > > > > > > > > When thinkpad_acpi.ko is not loaded, then mute key is working fine. When
> > > > > > > > > pressed, it correctly generates KEY_MUTE on AT Translated Set 2 keyboard
> > > > > > > > > input device and also turn on/of mute led. But when micmute key is
> > > > > > > > > pressed then, nothing happen. No key event is reported and also led is
> > > > > > > > > not turned on/off.
> > > > > > > > >
> > > > > > > > > On the other hand, when thinkpad_acpi.ko is loaded, then both buttons
> > > > > > > > > mute and micmute correctly generates input events; mute via AT keyboard
> > > > > > > > > and micmute via ThinkPad Extra Buttons. But led is not changed. When
> > > > > > > > > thinkpad_acpi.ko is loaded it turn off both leds (mute and micmute) and
> > > > > > > > > leds after pressing any of those buttons, leds are not turned on again.
> > > > > > > > >
> > > > > > > > > When thinkpad_acpi.ko is unloaded, then pressing mute button again start
> > > > > > > > > switching led on/off.
> > > > > > > > >
> > > > > > > > > So it seems that some init sequence of thinkpad_acpi.ko breaks mute led.
> > > > > > > > > And fini sequence of thinkpad_acpi.ko makes mute led working again.
> > > > > > > >
> > > > > > > > Usually the mute LED on Thinkpad is triggered from HD-audio driver
> > > > > > > > (sound/pci/hda/thinkpad_helper.c), and it's a soft-bound via
> > > > > > > > symbol_request(tpacpi_led_set). I thought thinkpad_acpi is
> > > > > > > > auto-loaded when the module gets bound.
> > > > > > > >
> > > > > > > > A possible explanation would be that TPT480s has neither IBM0068,
> > > > > > > > LEN0068 nor LEN0268 ACPI HIDs, hence the driver is not auto-loaded.
> > > > > > >
> > > > > > > I have Debian Stretch kernel (4.9) which does not have LEN0268 alias for
> > > > > > > thinkpad_acpi.ko. So thinkpad_acpi.ko is not loaded automatically. But I
> > > > > > > have put thinkpad_acpi into /etc/modules and it is now automatically
> > > > > > > loaded at boot.
> > > > > >
> > > > > > That's odd. It's exposed via
> > > > > > MODULE_DEVICE_TABLE(acpi, ibm_htk_device_ids);
> > > > > >
> > > > > > It's been already in 4.9. At this point, something is fishy.
> > > > >
> > > > > $ /sbin/modinfo thinkpad_acpi | grep alias
> > > > > alias: dmi:bvnIBM:bvrI[MU]ET??WW*
> > > > > alias: tpacpi
> > > > > alias: acpi*:LEN0068:*
> > > > > alias: acpi*:IBM0068:*
> > > > >
> > > > > No there is no LEN0268 on 4.9.
> > > >
> > > > OK, that's the cause. It's really old.
> > > >
> > > > The commit a3c42a467a25 ("platform/x86: thinkpad_acpi: Adding new
> > > > hotkey ID for Lenovo thinkpad") has to be backported.
> > >
> > > This commit just autoloads thinkpad_acpi driver, right? So manual
> > > modprobe (for now) is OK too?
> >
> > Well, the manual modprobe is superfluous if it's properly bound with
> > HD-audio driver. The HD-audio driver calls symbol_request(), so it
> > should do modprobe by itself.
> >
> > > > Also, in the HD-audio side, the commit 2ecb704a1290 ("ALSA: hda - add
> > > > a new condition to check if it is thinkpad") is needed, too.
> > >
> > > This commit was introduced in 4.9 and Debian kernel has it. I looked
> > > into Debian source code and there is check for LEN0268 in file
> > > sound/pci/hda/thinkpad_helper.c
> >
> > Then check whether the function gets really called.
>
> Checked, no it is not called.
>
> Now I see that snd_hda_codec_generic is visible in lsmod and thinkpad
> helper is compiled only into snd-hda-codec-realtek and
> snd-hda-codec-conexant... Therefore nobody is even trying to use that
> function.
Interesting is this part:
$ head /proc/asound/card0/codec#0
Codec: Realtek ALC257
Address: 0
AFG Function Id: 0x1 (unsol 1)
Vendor Id: 0x10ec0257
Subsystem Id: 0x17aa2258
Revision Id: 0x100001
No Modem Function Group found
Default PCM:
rates [0x560]: 44100 48000 96000 192000
bits [0xe]: 16 20 24
It uses vendor id 0x10ec0257 and support for it was added into
snd-hda-codec-realtek in commit f429e7e494 which was introduced in
version v4.15.
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=f429e7e494afaded76e62c6f98211a635aa03098
I applied this patch to Debian's 4.9 kernel and mute & mic mute leds
started working. This one patch was enough.
Takashi, it is possible to backport this patch into -stable trees?
--
Pali Rohár
pali.rohar@gmail.com
next prev parent reply other threads:[~2018-06-19 8:38 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-08 11:10 ThinkPad T480s & LED_MUTE, LED_MICMUTE Pali Rohár
2018-06-15 11:26 ` Pavel Machek
2018-06-15 11:37 ` Pali Rohár
2018-06-15 12:30 ` Henrique de Moraes Holschuh
2018-06-15 19:09 ` Pali Rohár
2018-06-15 23:36 ` Henrique de Moraes Holschuh
2018-06-16 7:33 ` Pavel Machek
2018-06-16 14:12 ` Henrique de Moraes Holschuh
2018-06-16 15:58 ` Pavel Machek
2018-06-18 10:11 ` Pali Rohár
2018-06-21 11:37 ` Pali Rohár
2018-06-15 12:51 ` Takashi Iwai
2018-06-15 19:09 ` Pali Rohár
2018-06-16 7:05 ` Takashi Iwai
2018-06-16 15:43 ` Pali Rohár
2018-06-16 16:02 ` Takashi Iwai
2018-06-18 10:28 ` Pali Rohár
2018-06-18 10:36 ` Takashi Iwai
2018-06-18 11:21 ` Pali Rohár
2018-06-18 11:26 ` Pali Rohár
2018-06-18 15:35 ` Takashi Iwai
2018-06-21 11:30 ` Pali Rohár
2018-06-21 11:35 ` [ibm-acpi-devel] " Damjan Georgievski
2018-06-21 11:39 ` Takashi Iwai
2018-06-23 12:46 ` Damjan Georgievski
2018-06-21 11:40 ` Pali Rohár
2018-06-19 8:37 ` Pali Rohár [this message]
2018-06-19 8:42 ` Takashi Iwai
2018-06-21 11:24 ` Pali Rohár
2018-06-21 11:29 ` Takashi Iwai
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=20180619083712.dwb4d357sfxcgrre@pali \
--to=pali.rohar@gmail.com \
--cc=ibm-acpi-devel@lists.sourceforge.net \
--cc=ibm-acpi@hmh.eng.br \
--cc=linux-kernel@vger.kernel.org \
--cc=platform-driver-x86@vger.kernel.org \
--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