From patchwork Sun Dec 27 17:29:49 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Weng Xuetian X-Patchwork-Id: 7923941 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 9CD3BBEEE5 for ; Sun, 27 Dec 2015 17:31:05 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5B22C20279 for ; Sun, 27 Dec 2015 17:31:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E325120272 for ; Sun, 27 Dec 2015 17:31:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750918AbbL0RaT (ORCPT ); Sun, 27 Dec 2015 12:30:19 -0500 Received: from mail-wm0-f50.google.com ([74.125.82.50]:36939 "EHLO mail-wm0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750807AbbL0RaS (ORCPT ); Sun, 27 Dec 2015 12:30:18 -0500 Received: by mail-wm0-f50.google.com with SMTP id p187so245524975wmp.0; Sun, 27 Dec 2015 09:30:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=fLWmSdzykGPWkbHuEuODbAwOMX/eXsByNoWFxvpi63Y=; b=wswZ+Y8lGZGWKyv/X5+lLyhXKfBLqTDXWgX6KB8MBSRZ7uAUKGgMhpY4qhb6XBw9Hd QMq16H+LpgxAVbDSGElhr8NN1YlCDWj9usInRcW9Du3k2ceNSroVkJuYl8mCKc9nyZV5 lTCq2T4wJk7oBD0DpQ2eQA9iUOVs8ltUzlij+qoWTMsB/C394bWPqhoIfwLfBv+LxO+m 0D8W+Sy5P1ua3yEmSeFKfRfnwAJ6mP3VyIEOmT8p1yTQ/2j/jDWgg+CIqeQYS+2tAbLu yBBvZZ9R9DcJiBpNVEg4jXE18pF3A63WA6P0kLKCEBjkXpIubtU5YS+7klaPilJCDKbG wKUA== X-Received: by 10.28.22.199 with SMTP id 190mr12167555wmw.54.1451237416816; Sun, 27 Dec 2015 09:30:16 -0800 (PST) Received: from csslayer.info ([2a02:2ca0:64:8e::3]) by smtp.gmail.com with ESMTPSA id 75sm5026070wmo.22.2015.12.27.09.30.15 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 27 Dec 2015 09:30:16 -0800 (PST) From: Weng Xuetian To: Chen Yu Cc: Darren Hart , linux-kernel@vger.kernel.org, platform-driver-x86@vger.kernel.org, Weng Xuetian Subject: [PATCH v2] surface pro 4: Add support for Surface Pro 4 Buttons Date: Sun, 27 Dec 2015 09:29:49 -0800 Message-Id: <1451237389-7993-1-git-send-email-wengxt@gmail.com> X-Mailer: git-send-email 2.6.4 In-Reply-To: <1450988919-945-1-git-send-email-wengxt@gmail.com> References: <1450988919-945-1-git-send-email-wengxt@gmail.com> 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=-6.8 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 Surface Pro 4 button is managed by a device with _HID "MSHW0040" different from Surface Pro 3. This commit adds MSHW0040 to id list to Support Surface Pro 4, and rename the driver to surfacepro_button accordingly. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=109871 Signed-off-by: Weng Xuetian --- v2: - Reformat patch with -M -C --- MAINTAINERS | 4 ++-- drivers/platform/x86/Kconfig | 6 +++--- drivers/platform/x86/Makefile | 2 +- .../x86/{surfacepro3_button.c => surfacepro_button.c} | 18 ++++++++++-------- 4 files changed, 16 insertions(+), 14 deletions(-) rename drivers/platform/x86/{surfacepro3_button.c => surfacepro_button.c} (93%) diff --git a/MAINTAINERS b/MAINTAINERS index 233f834..1c07436 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -7019,11 +7019,11 @@ T: git git://git.monstr.eu/linux-2.6-microblaze.git S: Supported F: arch/microblaze/ -MICROSOFT SURFACE PRO 3 BUTTON DRIVER +MICROSOFT SURFACE PRO SERIES BUTTON DRIVER M: Chen Yu L: platform-driver-x86@vger.kernel.org S: Supported -F: drivers/platform/x86/surfacepro3_button.c +F: drivers/platform/x86/surfacepro_button.c MICROTEK X6 SCANNER M: Oliver Neukum diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig index 1089eaa..3358fb0 100644 --- a/drivers/platform/x86/Kconfig +++ b/drivers/platform/x86/Kconfig @@ -939,9 +939,9 @@ config INTEL_PMC_IPC The PMC is an ARC processor which defines IPC commands for communication with other entities in the CPU. -config SURFACE_PRO3_BUTTON - tristate "Power/home/volume buttons driver for Microsoft Surface Pro 3 tablet" +config SURFACE_PRO_BUTTON + tristate "Power/home/volume buttons driver for Microsoft Surface Pro Series tablet" depends on ACPI && INPUT ---help--- - This driver handles the power/home/volume buttons on the Microsoft Surface Pro 3 tablet. + This driver handles the power/home/volume buttons on the Microsoft Surface Pro Series tablet. endif # X86_PLATFORM_DEVICES diff --git a/drivers/platform/x86/Makefile b/drivers/platform/x86/Makefile index 3ca78a3..b4ece33 100644 --- a/drivers/platform/x86/Makefile +++ b/drivers/platform/x86/Makefile @@ -61,4 +61,4 @@ obj-$(CONFIG_INTEL_SMARTCONNECT) += intel-smartconnect.o obj-$(CONFIG_PVPANIC) += pvpanic.o obj-$(CONFIG_ALIENWARE_WMI) += alienware-wmi.o obj-$(CONFIG_INTEL_PMC_IPC) += intel_pmc_ipc.o -obj-$(CONFIG_SURFACE_PRO3_BUTTON) += surfacepro3_button.o +obj-$(CONFIG_SURFACE_PRO_BUTTON) += surfacepro_button.o diff --git a/drivers/platform/x86/surfacepro3_button.c b/drivers/platform/x86/surfacepro_button.c similarity index 93% rename from drivers/platform/x86/surfacepro3_button.c rename to drivers/platform/x86/surfacepro_button.c index f7dade3..cda52b8 100644 --- a/drivers/platform/x86/surfacepro3_button.c +++ b/drivers/platform/x86/surfacepro_button.c @@ -1,6 +1,6 @@ /* * power/home/volume button support for - * Microsoft Surface Pro 3 tablet. + * Microsoft Surface Pro Series tablet. * * Copyright (c) 2015 Intel Corporation. * All rights reserved. @@ -19,9 +19,10 @@ #include #include -#define SURFACE_BUTTON_HID "MSHW0028" +#define SURFACE_PRO3_BUTTON_HID "MSHW0028" +#define SURFACE_PRO4_BUTTON_HID "MSHW0040" #define SURFACE_BUTTON_OBJ_NAME "VGBI" -#define SURFACE_BUTTON_DEVICE_NAME "Surface Pro 3 Buttons" +#define SURFACE_BUTTON_DEVICE_NAME "Surface Pro Series Buttons" #define SURFACE_BUTTON_NOTIFY_PRESS_POWER 0xc6 #define SURFACE_BUTTON_NOTIFY_RELEASE_POWER 0xc7 @@ -35,10 +36,10 @@ #define SURFACE_BUTTON_NOTIFY_PRESS_VOLUME_DOWN 0xc2 #define SURFACE_BUTTON_NOTIFY_RELEASE_VOLUME_DOWN 0xc3 -ACPI_MODULE_NAME("surface pro 3 button"); +ACPI_MODULE_NAME("surface pro series button"); MODULE_AUTHOR("Chen Yu"); -MODULE_DESCRIPTION("Surface Pro3 Button Driver"); +MODULE_DESCRIPTION("Surface Pro Series Button Driver"); MODULE_LICENSE("GPL v2"); /* @@ -54,7 +55,8 @@ MODULE_LICENSE("GPL v2"); * acpi_driver. */ static const struct acpi_device_id surface_button_device_ids[] = { - {SURFACE_BUTTON_HID, 0}, + {SURFACE_PRO3_BUTTON_HID, 0}, + {SURFACE_PRO4_BUTTON_HID, 0}, {"", 0}, }; MODULE_DEVICE_TABLE(acpi, surface_button_device_ids); @@ -202,8 +204,8 @@ static SIMPLE_DEV_PM_OPS(surface_button_pm, surface_button_suspend, surface_button_resume); static struct acpi_driver surface_button_driver = { - .name = "surface_pro3_button", - .class = "SurfacePro3", + .name = "surface_pro_button", + .class = "SurfacePro", .ids = surface_button_device_ids, .ops = { .add = surface_button_add,