From patchwork Thu Jul 16 23:38:57 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Azael Avalos X-Patchwork-Id: 6812001 Return-Path: X-Original-To: patchwork-platform-driver-x86@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 0D767C05AC for ; Thu, 16 Jul 2015 23:39:12 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 31F63205DC for ; Thu, 16 Jul 2015 23:39:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 43651205C6 for ; Thu, 16 Jul 2015 23:39:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756241AbbGPXjJ (ORCPT ); Thu, 16 Jul 2015 19:39:09 -0400 Received: from mail-oi0-f54.google.com ([209.85.218.54]:33943 "EHLO mail-oi0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756228AbbGPXjI (ORCPT ); Thu, 16 Jul 2015 19:39:08 -0400 Received: by oigd21 with SMTP id d21so18545770oig.1; Thu, 16 Jul 2015 16:39:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=2PPJNvd5waBp8Oo/wLJviIZhdtDtkRSwYLNF4Z/hbKQ=; b=EkRDP7RSklOH0j88G+zGWlC0v2NuS4VTTcdRrVTQo0mMMNzdRlMfaRuMnHJSWnCS0L bcIhai2+uZQdQXG9NBHfw1qmma3CuAR416HU8IdyvnlIx3R1SYVO6Hz0NIM5HUDm5A/T HKp/kaxFP44ngQADJvMVp6R8sZomFZqcTvJ14Y8l07KV7BW5yUNv7p2sIQP6OeNS1fY1 kc19a0t8qUesq9S6x60KSsycEM2/JANYVpnB2t4b1c3X5iQ4j4n7MiAqReBtsm/2b9qe LAgCOPjLtk/alJyEt7iUUj9RRgVGXH8c0wLS2jzEJitwsTbW7h9++AmkP201mGKnaj0P KWMg== X-Received: by 10.182.240.135 with SMTP id wa7mr11337715obc.63.1437089948148; Thu, 16 Jul 2015 16:39:08 -0700 (PDT) Received: from Shakuras.scurra.org (189.202.54.212.cable.dyn.cableonline.com.mx. [189.202.54.212]) by smtp.gmail.com with ESMTPSA id y131sm5301800oig.28.2015.07.16.16.39.05 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 16 Jul 2015 16:39:07 -0700 (PDT) From: Azael Avalos To: Darren Hart , platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Azael Avalos Subject: [PATCH] toshiba_acpi: Avoid registering input device on WMI event laptops Date: Thu, 16 Jul 2015 17:38:57 -0600 Message-Id: <1437089937-4383-1-git-send-email-coproscefalo@gmail.com> X-Mailer: git-send-email 2.4.5 Sender: platform-driver-x86-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org X-Spam-Status: No, score=-8.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Commit f11f999e9890 ("toshiba_acpi: Refuse to load on machines with buggy INFO implementations") denied loading on laptops with a WMI Event GUID given that such laptops manage the hotkeys via that interface, however, such laptops have a working Toshiba Configuration Interface (TCI), and thus, such commit denied several supported features. This patch avoids registering the input device and ignores all hotkey events on laptops with such WMI Event GUI, making the supported features found in those laptops to work. Signed-off-by: Azael Avalos --- drivers/platform/x86/toshiba_acpi.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/drivers/platform/x86/toshiba_acpi.c b/drivers/platform/x86/toshiba_acpi.c index 15d8f0d..a3c6ea2 100644 --- a/drivers/platform/x86/toshiba_acpi.c +++ b/drivers/platform/x86/toshiba_acpi.c @@ -2397,6 +2397,11 @@ static int toshiba_acpi_setup_keyboard(struct toshiba_acpi_dev *dev) u32 hci_result; int error; + if (wmi_has_guid(TOSHIBA_WMI_EVENT_GUID)) { + pr_info("WMI event detected, hotkeys won't be monitored\n"); + return 0; + } + error = toshiba_acpi_enable_hotkeys(dev); if (error) return error; @@ -2730,6 +2735,14 @@ static void toshiba_acpi_notify(struct acpi_device *acpi_dev, u32 event) switch (event) { case 0x80: /* Hotkeys and some system events */ + /* + * Machines with this WMI guid aren't supported due to bugs in + * their AML. + * + * Return silently to avoid triggering a netlink event. + */ + if (wmi_has_guid(TOSHIBA_WMI_EVENT_GUID)) + return; toshiba_acpi_process_hotkeys(dev); break; case 0x81: /* Dock events */ @@ -2816,14 +2829,6 @@ static int __init toshiba_acpi_init(void) { int ret; - /* - * Machines with this WMI guid aren't supported due to bugs in - * their AML. This check relies on wmi initializing before - * toshiba_acpi to guarantee guids have been identified. - */ - if (wmi_has_guid(TOSHIBA_WMI_EVENT_GUID)) - return -ENODEV; - toshiba_proc_dir = proc_mkdir(PROC_TOSHIBA, acpi_root_dir); if (!toshiba_proc_dir) { pr_err("Unable to create proc dir " PROC_TOSHIBA "\n");