From patchwork Tue Jan 21 07:33:13 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Reyad Attiyat X-Patchwork-Id: 3515571 X-Patchwork-Delegate: jikos@jikos.cz Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id BF0AA9F2E9 for ; Tue, 21 Jan 2014 07:33:38 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C9B2E20145 for ; Tue, 21 Jan 2014 07:33:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D98E620138 for ; Tue, 21 Jan 2014 07:33:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752440AbaAUHdf (ORCPT ); Tue, 21 Jan 2014 02:33:35 -0500 Received: from mail-we0-f175.google.com ([74.125.82.175]:33921 "EHLO mail-we0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750943AbaAUHde (ORCPT ); Tue, 21 Jan 2014 02:33:34 -0500 Received: by mail-we0-f175.google.com with SMTP id p61so7596475wes.6 for ; Mon, 20 Jan 2014 23:33:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=RCencLXZSNQ+2FJygiupoCzu1VY+RSkJZrVaAoLFQwE=; b=NdsAqIY8o+EdAvBCF9WbXrpcD/hBN+bmw1XzwFqDhzndbuD9/GreN0W7sVtHqsYVa7 bTNeC7hUQ5Aob94k/mM0f1Fr5l2keE5Eg3HhKAmyFD95jQmvjma1d1gsiPOORMSobO8B HiZg4zJyqhtxrJswkvCByEc6PNwYJgeul4y/Vp3FqjkSOSXZ2Dvdn7eCG8RrHPyt5MO+ 9W6k6Pt983TFpwWTAXCq2CE2fbEPUhSvS1rGigka4cz6ILTgci+PY0MojbY3znFsF0yV ZcYdi+TxvYjrSgEGEhjQ/EbFO4GMQWaZxTPLwCYeVYIjcC6aGpDkRJSy6h3/PYcrz4ho 25Mg== X-Received: by 10.194.93.67 with SMTP id cs3mr17998140wjb.26.1390289613423; Mon, 20 Jan 2014 23:33:33 -0800 (PST) MIME-Version: 1.0 Received: by 10.216.27.72 with HTTP; Mon, 20 Jan 2014 23:33:13 -0800 (PST) In-Reply-To: References: From: Reyad Attiyat Date: Tue, 21 Jan 2014 01:33:13 -0600 Message-ID: Subject: Re: [PATCH] Add HID's to hid-microsoft driver of Surface Type/Touch Cover 2 to fix bug To: Jiri Kosina Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Spam-Status: No, score=-7.3 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 On Tue, Jan 21, 2014 at 12:47 AM, Jiri Kosina wrote: > On Mon, 20 Jan 2014, Reyad Attiyat wrote: > >> The below patch fixes a bug 64811 >> (https://bugzilla.kernel.org/show_bug.cgi?id=64811) of the Microsoft >> Surface Type/Touch cover 2 devices being detected as a multitouch >> device. >> The fix adds the HID of the two devices to hid-microsoft driver. This >> ensures that hid-input will eventually be used for the device and not >> hid-multitouch. > > Hi, > > your patch is missing hid_have_special_driver[] entry, therefore correct > driver binding is not guaranteed. > > -- > Jiri Kosina > SUSE Labs > Hi, Thanks for reminding me of hid_have_special_driver[]. I noticed that this device has the HID_DG_CONTACTID and in the comment of the hid_have_sepcial_driver[] * Please note that for multitouch devices (driven by hid-multitouch driver), * there is a proper autodetection and autoloading in place (based on presence * of HID_DG_CONTACTID), so those devices don't need to be added to this list, * as we are doing the right thing in hid_scan_usage(). This device should not be driven by hid-multitouch as it does not handle keyboard/mouse input devices. I submitted a new patch below with it added. I believe it should still be part of this array, in case this kind of implementation is fixed/updated. From 291742873dcf181faf9657b41279487f31302c73 Mon Sep 17 00:00:00 2001 From: Reyad Attiyat Date: Tue, 21 Jan 2014 01:22:25 -0600 Subject: [PATCH 1/1] Added in HID's for Microsoft Surface Type/Touch cover 2. This is to fix bug 64811 where this device is detected as a multitouch device Reviewed-by: Benjamin Tissoires --- drivers/hid/hid-core.c | 3 +++ drivers/hid/hid-ids.h | 4 +++- drivers/hid/hid-microsoft.c | 4 ++++ 3 files changed, 10 insertions(+), 1 deletion(-) USB_DEVICE_ID_MS_PRESENTER_8K_BT), .driver_data = MS_PRESENTER }, diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c index 253fe23..88eb4a6 100644 --- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c @@ -1778,6 +1778,9 @@ static const struct hid_device_id hid_have_special_driver[] = { { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_PRESENTER_8K_USB) }, { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_DIGITAL_MEDIA_3K) }, { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_WIRELESS_OPTICAL_DESKTOP_3_0) }, + { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_TYPE_COVER_2) }, + { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_TOUCH_COVER_2) }, + { HID_USB_DEVICE(USB_VENDOR_ID_MONTEREY, USB_DEVICE_ID_GENIUS_KB29E) }, { HID_USB_DEVICE(USB_VENDOR_ID_NTRIG, USB_DEVICE_ID_NTRIG_TOUCH_SCREEN) }, { HID_USB_DEVICE(USB_VENDOR_ID_NTRIG, USB_DEVICE_ID_NTRIG_TOUCH_SCREEN_1) }, diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h index f9304cb..b523a8b 100644 --- a/drivers/hid/hid-ids.h +++ b/drivers/hid/hid-ids.h @@ -611,7 +611,9 @@ #define USB_DEVICE_ID_MS_PRESENTER_8K_USB 0x0713 #define USB_DEVICE_ID_MS_DIGITAL_MEDIA_3K 0x0730 #define USB_DEVICE_ID_MS_COMFORT_MOUSE_4500 0x076c - +#define USB_DEVICE_ID_MS_TOUCH_COVER_2 0x07a7 +#define USB_DEVICE_ID_MS_TYPE_COVER_2 0x07a9 + #define USB_VENDOR_ID_MOJO 0x8282 #define USB_DEVICE_ID_RETRO_ADAPTER 0x3201 diff --git a/drivers/hid/hid-microsoft.c b/drivers/hid/hid-microsoft.c index 551795b..2599de8 100644 --- a/drivers/hid/hid-microsoft.c +++ b/drivers/hid/hid-microsoft.c @@ -207,6 +207,10 @@ static const struct hid_device_id ms_devices[] = { .driver_data = MS_NOGET }, { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_COMFORT_MOUSE_4500), .driver_data = MS_DUPLICATE_USAGES }, + { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_TYPE_COVER_2), + .driver_data = 0 }, + { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_TOUCH_COVER_2), + .driver_data = 0 }, { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_MICROSOFT,