From patchwork Mon Oct 2 03:56:00 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kai-Heng Feng X-Patchwork-Id: 9980211 X-Patchwork-Delegate: andy.shevchenko@gmail.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 891EA6029B for ; Mon, 2 Oct 2017 03:56:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 78AD328372 for ; Mon, 2 Oct 2017 03:56:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6D59A28576; Mon, 2 Oct 2017 03:56:10 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E4F5C28372 for ; Mon, 2 Oct 2017 03:56:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750943AbdJBD4J (ORCPT ); Sun, 1 Oct 2017 23:56:09 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:38078 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751994AbdJBD4I (ORCPT ); Sun, 1 Oct 2017 23:56:08 -0400 Received: from 114-32-108-117.hinet-ip.hinet.net ([114.32.108.117] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1dyrpu-0001IJ-Pl; Mon, 02 Oct 2017 03:56:07 +0000 From: Kai-Heng Feng To: dvhart@infradead.org, andy@infradead.org Cc: platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, Kai-Heng Feng Subject: [PATCH] platform/x86: peaq-wmi: Blacklist Lenovo ideapad 700-15ISK Date: Mon, 2 Oct 2017 11:56:00 +0800 Message-Id: <20171002035600.9617-1-kai.heng.feng@canonical.com> X-Mailer: git-send-email 2.14.1 Sender: platform-driver-x86-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP peaq-wmi on Lenovo ideapad 700-15ISK keeps sending KEY_SOUND, which makes user's repeated keys gets interrupted. The system does not have Dolby button, let's blacklist it. BugLink: https://bugs.launchpad.net/bugs/1720219 Signed-off-by: Kai-Heng Feng --- drivers/platform/x86/peaq-wmi.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/drivers/platform/x86/peaq-wmi.c b/drivers/platform/x86/peaq-wmi.c index bc98ef95514a..5673d5daebc3 100644 --- a/drivers/platform/x86/peaq-wmi.c +++ b/drivers/platform/x86/peaq-wmi.c @@ -11,6 +11,7 @@ #include #include #include +#include #define PEAQ_DOLBY_BUTTON_GUID "ABBC0F6F-8EA1-11D1-00A0-C90629100000" #define PEAQ_DOLBY_BUTTON_METHOD_ID 5 @@ -64,9 +65,22 @@ static void peaq_wmi_poll(struct input_polled_dev *dev) } } +static const struct dmi_system_id peaq_blacklist[] __initconst = { + { + /* Lenovo ideapad 700-15ISK does not have Dolby button */ + .ident = "Lenovo ideapad 700-15ISK", + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), + DMI_MATCH(DMI_PRODUCT_NAME, "80RU"), + }, + }, + {} +}; + static int __init peaq_wmi_init(void) { - if (!wmi_has_guid(PEAQ_DOLBY_BUTTON_GUID)) + if (!wmi_has_guid(PEAQ_DOLBY_BUTTON_GUID) || + dmi_check_system(peaq_blacklist)) return -ENODEV; peaq_poll_dev = input_allocate_polled_device(); @@ -86,7 +100,8 @@ static int __init peaq_wmi_init(void) static void __exit peaq_wmi_exit(void) { - if (!wmi_has_guid(PEAQ_DOLBY_BUTTON_GUID)) + if (!wmi_has_guid(PEAQ_DOLBY_BUTTON_GUID) || + dmi_check_system(peaq_blacklist)) return; input_unregister_polled_device(peaq_poll_dev);