Re: [ibm-acpi-devel] ThinkPad T480s & LED_MUTE, LED_MICMUTE

2018-06-21 Thread Pali Rohár
On Thursday 21 June 2018 13:35:21 Damjan Georgievski wrote:
> > I applied them to Debian's kernel (with slightly modification) and they
> > are working fine. Via "alsamixer -c 0" I can change "Mic Mute-LED Mode"
> > to "Follow Capture" and then led is ON only when microphone is ON.
> > Recording from microphone is working in both configurations.
> 
> hm this is the opposite of how it works on my T450s and X1, where the
> led is ON when microphone is muted.

Purpose of this patch it to allow user to configure that LED. As I wrote
above, when I *changed* "Mic Mute-LED Mode" to "Follow Capture" in
alsamixer, then led is ON when mic is ON. Default configuration (prior
changing anything) in alsamixer is "Follow Mute" when led is ON when mic
is OFF. That patch allows you to change how LED behave.

> (I do wish the led would be ON when the microphone is not muted ie. listening)

-- 
Pali Rohár
pali.ro...@gmail.com

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
ibm-acpi-devel mailing list
ibm-acpi-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ibm-acpi-devel


Re: [ibm-acpi-devel] ThinkPad T480s & LED_MUTE, LED_MICMUTE

2018-06-21 Thread Takashi Iwai
On Thu, 21 Jun 2018 13:35:21 +0200,
Damjan Georgievski wrote:
> 
> > I applied them to Debian's kernel (with slightly modification) and they
> > are working fine. Via "alsamixer -c 0" I can change "Mic Mute-LED Mode"
> > to "Follow Capture" and then led is ON only when microphone is ON.
> > Recording from microphone is working in both configurations.
> 
> hm this is the opposite of how it works on my T450s and X1, where the
> led is ON when microphone is muted.
> (I do wish the led would be ON when the microphone is not muted ie. listening)

Don't worry, it's still the default behavior ("Follow Mute").
Only when user chooses another mode (e.g. "Follow Capture"), the
behavior changes.


Takashi

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
ibm-acpi-devel mailing list
ibm-acpi-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ibm-acpi-devel


Re: [ibm-acpi-devel] ThinkPad T480s & LED_MUTE, LED_MICMUTE

2018-06-21 Thread Pali Rohár
On Monday 18 June 2018 12:11:44 Pali Rohár wrote:
> On Friday 15 June 2018 20:36:28 Henrique de Moraes Holschuh wrote:
> > On Fri, 15 Jun 2018, Pali Rohár wrote:
> > > means set. What is SHDA doing, I have not figured out. It does not
> > 
> > Look at the HDA mixer state, SHDA is likely to be directly messing with
> > it.
> 
> Now I found following email thread between you and Alex with patch which
> configures HDA mixer via that SHDA method:
> 
> https://www.spinics.net/lists/platform-driver-x86/msg03206.html
> 
> But looks like that patch was never included into mainline kernel...
> 
> Seems it would be needed in some part (to not break older Thinkpads) for
> that LED support in alsa mixer about which Takashi Iwai wrote.

Hi Alex, do you have other details or documentation for your patch
"thinkpad_acpi: added BIOS mute interfaces for volume" (linked above)
which you sent to platform-driver-x86 list 6 years ago?

It calls SHDA thinkpad ACPI function and I would like to know more what
is this function doing...

-- 
Pali Rohár
pali.ro...@gmail.com

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
ibm-acpi-devel mailing list
ibm-acpi-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ibm-acpi-devel


Re: [ibm-acpi-devel] ThinkPad T480s & LED_MUTE, LED_MICMUTE

2018-06-21 Thread Damjan Georgievski
> I applied them to Debian's kernel (with slightly modification) and they
> are working fine. Via "alsamixer -c 0" I can change "Mic Mute-LED Mode"
> to "Follow Capture" and then led is ON only when microphone is ON.
> Recording from microphone is working in both configurations.

hm this is the opposite of how it works on my T450s and X1, where the
led is ON when microphone is muted.
(I do wish the led would be ON when the microphone is not muted ie. listening)



-- 
damjan

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
ibm-acpi-devel mailing list
ibm-acpi-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ibm-acpi-devel


Re: [ibm-acpi-devel] ThinkPad T480s & LED_MUTE, LED_MICMUTE

2018-06-21 Thread Pali Rohár
On Monday 18 June 2018 17:35:18 Takashi Iwai wrote:
> On Mon, 18 Jun 2018 13:26:18 +0200,
> Pali Rohár wrote:
> > 
> > On Monday 18 June 2018 13:21:21 Pali Rohár wrote:
> > > Now I see that in Debian backports is some 4.16.12 kernel version. I can
> > > try this one (and later compile one from Linus tree).
> > 
> > Tested, this version is working fine and leds works as expected. And now
> > also snd_hda_codec_realtek is loaded.
> 
> Good to hear :)
> 
> Below are test patches to allow user choosing the mic mute LED
> behavior on Thinkpad, too.  Note: totally untested!
> 
> Let me know if these work for you.

I applied them to Debian's kernel (with slightly modification) and they
are working fine. Via "alsamixer -c 0" I can change "Mic Mute-LED Mode"
to "Follow Capture" and then led is ON only when microphone is ON.
Recording from microphone is working in both configurations.

If testing with Debian's kernel is enough, you can add my:

Tested-by: Pali Rohár 

Anyway, (this question is also for Henrique), what can we do with MUTE
led to work? Support for controlling it was there, but was revered in
commit 3530febb5c7636f6b26d15637f68296804d26491.

-- 
Pali Rohár
pali.ro...@gmail.com

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
ibm-acpi-devel mailing list
ibm-acpi-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ibm-acpi-devel


Re: [ibm-acpi-devel] ThinkPad T480s & LED_MUTE, LED_MICMUTE

2018-06-21 Thread Takashi Iwai
On Thu, 21 Jun 2018 13:24:07 +0200,
Pali Rohár wrote:
> 
> On Tuesday 19 June 2018 10:42:12 Takashi Iwai wrote:
> > On Tue, 19 Jun 2018 10:37:12 +0200,
> > Pali Rohár wrote:
> > > 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: 0x11
> > > 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?
> > 
> > It has already a Cc-to-stable, so it should have been backported.
> > Maybe it wasn't applicable at that time due to lack of other dependent
> > patches...
> > 
> > In anyway, feel free to ping Greg for including it to 4.9.x if it
> > works for you now.
> 
> I sent email to Greg, but it was eaten by "email-bot of Greg
> Kroah-Hartman's inbox". So I sent another patch email to stable ML.

Better to put '[PATCH 4.9.y]' prefix in the subject to make clear that
it's only for 4.9.y.

Also, the line indicating the upstream commit id is:

  commit $ID upstream.

Last but not least, if you resubmit the patch, you must give your own
sign-off, too.


thanks,

Takashi

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
ibm-acpi-devel mailing list
ibm-acpi-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ibm-acpi-devel


Re: [ibm-acpi-devel] ThinkPad T480s & LED_MUTE, LED_MICMUTE

2018-06-21 Thread Pali Rohár
On Tuesday 19 June 2018 10:42:12 Takashi Iwai wrote:
> On Tue, 19 Jun 2018 10:37:12 +0200,
> Pali Rohár wrote:
> > 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: 0x11
> > 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?
> 
> It has already a Cc-to-stable, so it should have been backported.
> Maybe it wasn't applicable at that time due to lack of other dependent
> patches...
> 
> In anyway, feel free to ping Greg for including it to 4.9.x if it
> works for you now.

I sent email to Greg, but it was eaten by "email-bot of Greg
Kroah-Hartman's inbox". So I sent another patch email to stable ML.

-- 
Pali Rohár
pali.ro...@gmail.com

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
ibm-acpi-devel mailing list
ibm-acpi-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ibm-acpi-devel