]> asedeno.scripts.mit.edu Git - linux.git/commit
thinkpad-acpi: Try to use full software mute control
authorAndy Lutomirski <luto@MIT.EDU>
Sat, 18 Oct 2014 00:04:29 +0000 (17:04 -0700)
committerDarren Hart <dvhart@linux.intel.com>
Thu, 4 Dec 2014 12:03:22 +0000 (04:03 -0800)
commit9a417ec0c9d1f7af5394333411fc4d98adb8761b
treeb88a65fdd569cebf41a960647436328b82ef7f2b
parente4da91427fbe1dd425478d49fdabeb217945f776
thinkpad-acpi: Try to use full software mute control

ThinkPads have hardware volume controls and three buttons to control
them.  (These are separate from the standard mixer.)  By default,
the buttons are:

 - Mute: Mutes the hardware volume control and, on some models,
   generates KEY_MUTE.

 - Up: Unmutes, generates KEY_VOLUMEUP, and increases volume if
   applicable.  (Newer thinkpads only have hardware mute/unmute.)

 - Down: Unmutes, generates KEY_VOLUMEDOWN, and decreases volume
   if applicable.

This behavior is unfortunate, since modern userspace will also
handle the hotkeys and change the other mixer.  If the software
mixer is muted and the hardware mixer is unmuted and you push mute,
hilarity ensues as they both switch state.

Rather than adding a lot of complex ALSA integration to fix this,
just disable the special ThinkPad volume controls when possible.
This turns the mute and volume buttons into regular buttons, and
standard software controls will work as expected.

ALSA already knows about the mute light on models with a mute light,
so everything should just work.

This should also allow us to remove _OSI(Linux) for all ThinkPads.

For future reference: It turns out that we can ask ACPI for one of
three behaviors directly on very new models.  They are "latch" (the
default), "none" (no automatic control), and "toggle" (mute unmutes
when muted).  All of the modes besides "none" seem to be a bit
buggy, though, and there doesn't seem to be a consistent way to get
any notification when the HW mute state is changed.

Signed-off-by: Andy Lutomirski <luto@mit.edu>
Acked-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
drivers/platform/x86/thinkpad_acpi.c