From patchwork Wed Jun 14 08:47:14 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masaki Ota <012nexus@gmail.com> X-Patchwork-Id: 9785823 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 81FA560384 for ; Wed, 14 Jun 2017 08:51:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 68A0B27FB6 for ; Wed, 14 Jun 2017 08:51:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5D41D2858F; Wed, 14 Jun 2017 08:51:30 +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.0 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,FROM_STARTS_WITH_NUMS,RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=unavailable 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 D434127FB6 for ; Wed, 14 Jun 2017 08:51:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754669AbdFNIso (ORCPT ); Wed, 14 Jun 2017 04:48:44 -0400 Received: from mail-pf0-f196.google.com ([209.85.192.196]:35764 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751971AbdFNIrU (ORCPT ); Wed, 14 Jun 2017 04:47:20 -0400 Received: by mail-pf0-f196.google.com with SMTP id s66so11112701pfs.2; Wed, 14 Jun 2017 01:47:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=DxNv7tctWrNAZCOT3t7fHrNuaxazCRDPeFnnQxAW7r4=; b=qJH4A0deksIENMPoRRJ2Ky/tPcwFBzAADYHPUcHeV0kKEBHidzXNkB2tw6parkLK00 zI0X5zbhDqI6spEgxTVLiIgpqJOCmrbZCHnWnPUZ0UNm/+c6sIxBSU1obWSZX0NUe4aJ gwaqTr+ZJPHMlHQd0/935R8xOUc5/0sUgNEu52dbERJzbgPfO4m9TtNmLHjmE+rsHICv nEdweS9Db2Ek9XDqDt6SrrVGbkvI2RHNzHFl9X+1ufn1fI/Aod6vNZWMW5p6zSsBtXTZ RofNJahIkk2fsqpDeJRGAznlInGGMAmgDsx53Q9ot5kzpv3oVm1AdlSucz/YzEuCwYXx Tudw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=DxNv7tctWrNAZCOT3t7fHrNuaxazCRDPeFnnQxAW7r4=; b=TODYFinGyfyiqQNE96Qw2TpcEslMvWR+mPh6OGW4MCODitDC7fRHaNDihjmCAxxJSu pdj9jLQyY7FNpJ/4uGb5CzXFAznfjvveQyvbLx8LrJoYmhEgndgpiWYns1uGIbMKkZVM ICCAz0oXrqdbqH945QQjppNRZF1HSvmuSWVU9TtQ1dq2g9hpx61arlzk+/KTiGUlpPCB 9fsHlhsppYDxLMHH9kqgI2U9E/V1qRchD8PakH7clg2TyG+lQLzpMwBd7rxR6tK0AxtZ s17C+mJ3YXd0pEsbqmXT5733Rm5zenYfkcCnT3vT2PHqpzh/YCN6EwxDBFz2TyPV+u2L 0tXg== X-Gm-Message-State: AKS2vOw+cmGxGQAJ8Irh/LPgPf7dCJO12fbtxZ8gMnzHhBrCiK0BydBI JIS6ygelS1EyO8si X-Received: by 10.84.143.70 with SMTP id 64mr3840194ply.36.1497430039380; Wed, 14 Jun 2017 01:47:19 -0700 (PDT) Received: from localhost (p2239-ipad303aobadori.miyagi.ocn.ne.jp. [123.216.73.239]) by smtp.gmail.com with ESMTPSA id a84sm940972pfe.19.2017.06.14.01.47.18 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 14 Jun 2017 01:47:18 -0700 (PDT) From: Masaki Ota <012nexus@gmail.com> X-Google-Original-From: Masaki Ota To: jikos@kernel.org, benjamin.tissoires@redhat.com Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, masaki.ota@jp.alps.com Subject: [PATCH 1/1] Support PTP Stick and Touchpad device Date: Wed, 14 Jun 2017 17:47:14 +0900 Message-Id: <20170614084714.18166-1-masaki.ota@jp.alps.com> X-Mailer: git-send-email 2.11.0 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From Masaki Ota Support PTP Stick and Touchpad device. This Touchpad is Precision Touchpad(PTP), and Stick Pointer data is the same as Mouse. So Stick Pointer works as Mouse. Signed-off-by: Masaki Ota --- drivers/hid/hid-ids.h | 2 ++ drivers/hid/hid-multitouch.c | 24 ++++++++++++++++++++++-- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h index 8ca1e8ce0af2..d36d4ac508f6 100644 --- a/drivers/hid/hid-ids.h +++ b/drivers/hid/hid-ids.h @@ -75,6 +75,8 @@ #define USB_VENDOR_ID_ALPS_JP 0x044E #define HID_DEVICE_ID_ALPS_U1_DUAL 0x120B +#define HID_DEVICE_ID_ALPS_U1_DUAL_PTP 0x121F +#define HID_DEVICE_ID_ALPS_U1_DUAL_3BTN_PTP 0x1220 #define USB_VENDOR_ID_AMI 0x046b #define USB_DEVICE_ID_AMI_VIRT_KEYBOARD_AND_MOUSE 0xff10 diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c index 24d5b6deb571..4ffdda9d80da 100644 --- a/drivers/hid/hid-multitouch.c +++ b/drivers/hid/hid-multitouch.c @@ -161,6 +161,7 @@ static void mt_post_parse(struct mt_device *td); #define MT_CLS_GENERALTOUCH_PWT_TENFINGERS 0x0109 #define MT_CLS_LG 0x010a #define MT_CLS_VTL 0x0110 +#define MT_CLS_WIN_8_DUAL 0x0111 #define MT_DEFAULT_MAXCONTACT 10 #define MT_MAX_MAXCONTACT 250 @@ -278,6 +279,13 @@ static struct mt_class mt_classes[] = { MT_QUIRK_CONTACT_CNT_ACCURATE | MT_QUIRK_FORCE_GET_FEATURE, }, + { .name = MT_CLS_WIN_8_DUAL, + .quirks = MT_QUIRK_ALWAYS_VALID | + MT_QUIRK_IGNORE_DUPLICATES | + MT_QUIRK_HOVERING | + MT_QUIRK_CONTACT_CNT_ACCURATE, + .export_all_inputs = true + }, { } }; @@ -512,7 +520,8 @@ static int mt_touch_input_mapping(struct hid_device *hdev, struct hid_input *hi, mt_store_field(usage, td, hi); return 1; case HID_DG_CONFIDENCE: - if (cls->name == MT_CLS_WIN_8 && + if ((cls->name == MT_CLS_WIN_8 || + cls->name == MT_CLS_WIN_8_DUAL) && field->application == HID_DG_TOUCHPAD) cls->quirks |= MT_QUIRK_CONFIDENCE; mt_store_field(usage, td, hi); @@ -579,7 +588,8 @@ static int mt_touch_input_mapping(struct hid_device *hdev, struct hid_input *hi, * MS PTP spec says that external buttons left and right have * usages 2 and 3. */ - if (cls->name == MT_CLS_WIN_8 && + if ((cls->name == MT_CLS_WIN_8 || + cls->name == MT_CLS_WIN_8_DUAL) && field->application == HID_DG_TOUCHPAD && (usage->hid & HID_USAGE) > 1) code--; @@ -1290,6 +1300,16 @@ static const struct hid_device_id mt_devices[] = { MT_USB_DEVICE(USB_VENDOR_ID_3M, USB_DEVICE_ID_3M3266) }, + /* Alps devices */ + { .driver_data = MT_CLS_WIN_8_DUAL, + HID_DEVICE(BUS_I2C, HID_GROUP_MULTITOUCH_WIN_8, + USB_VENDOR_ID_ALPS_JP, + HID_DEVICE_ID_ALPS_U1_DUAL_PTP) }, + { .driver_data = MT_CLS_WIN_8_DUAL, + HID_DEVICE(BUS_I2C, HID_GROUP_MULTITOUCH_WIN_8, + USB_VENDOR_ID_ALPS_JP, + HID_DEVICE_ID_ALPS_U1_DUAL_3BTN_PTP) }, + /* Anton devices */ { .driver_data = MT_CLS_EXPORT_ALL_INPUTS, MT_USB_DEVICE(USB_VENDOR_ID_ANTON,