Some new Thinkpad has a mute button with led. This mute led can out-of-sync
with mute in user interface. This kernel parameter disables the hardware
mute and led to avoid confusion. The hotkey will only issue scancode to UI.

Signed-off-by: Alex Hung <alex.h...@canonical.com>
---
 drivers/platform/x86/thinkpad_acpi.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/drivers/platform/x86/thinkpad_acpi.c 
b/drivers/platform/x86/thinkpad_acpi.c
index 03ca6c1..adb3a4e 100644
--- a/drivers/platform/x86/thinkpad_acpi.c
+++ b/drivers/platform/x86/thinkpad_acpi.c
@@ -253,6 +253,9 @@ enum tpacpi_hkey_event_t {
 #define strlencmp(a, b) (strncmp((a), (b), strlen(b)))
 
 
+static bool use_hardware_mute = 1;
+module_param(use_hardware_mute, bool, 0644);
+
 /****************************************************************************
  * Driver-wide structs and misc. variables
  */
@@ -3327,6 +3330,17 @@ static int __init hotkey_init(struct ibm_init_struct 
*iibm)
        if (res)
                goto err_exit;
 
+       if (!use_hardware_mute) {
+               acpi_handle temp;
+
+               if (!ACPI_SUCCESS(acpi_get_handle(hkey_handle, "SHDA", &temp)))
+                       pr_info("hardware mute interface is not supported\n");
+               else {
+                       if (!acpi_evalf(hkey_handle, &status, "SHDA", "dd", 1))
+                               pr_info("failed to disable hardware mute\n");
+               }
+       }
+
        /* Set up key map */
        hotkey_keycode_map = kmalloc(TPACPI_HOTKEY_MAP_SIZE,
                                        GFP_KERNEL);
-- 
1.8.1.2


------------------------------------------------------------------------------
LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99!
1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint
2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes
Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/20/13. 
http://pubads.g.doubleclick.net/gampad/clk?id=58041151&iu=/4140/ostg.clktrk
_______________________________________________
ibm-acpi-devel mailing list
ibm-acpi-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ibm-acpi-devel

Reply via email to