From patchwork Fri Jun 16 00:29:39 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: 9790409 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 4AC1E60325 for ; Fri, 16 Jun 2017 00:30:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3C72F26E98 for ; Fri, 16 Jun 2017 00:30:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 30FE8284BB; Fri, 16 Jun 2017 00:30:04 +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=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 8D2572843F for ; Fri, 16 Jun 2017 00:30:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751803AbdFPAaB (ORCPT ); Thu, 15 Jun 2017 20:30:01 -0400 Received: from mail-pf0-f196.google.com ([209.85.192.196]:34330 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751852AbdFPA37 (ORCPT ); Thu, 15 Jun 2017 20:29:59 -0400 Received: by mail-pf0-f196.google.com with SMTP id d5so3353930pfe.1; Thu, 15 Jun 2017 17:29:49 -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=xA5xj4byS3xgCv/6dltCY9jA9owDwtVZUEVfVuxHKQM=; b=twYV0hBjTnOC4YCyYV8Ygnrz4GdBbho2R0cl8bY6p6JGxiRMKrMGmo3395inggZhQx 4vZAcW5BNb2D3OaWgtlukaKuTfa/hp5u025nR3iWf5VkobCoXGdem43fEeWlg/A0uMQ0 1oqw5K5OBO4B930cKc1ILQCxwTVs8na+KJ1YppAdy0XXOZJOVbOZqNzLOnz57gDkhohh q+4d2wW6RgTzMOx1xyq+GTchZfC0kFvJRGPZDTJy+KLX7gopULqUNK4KwpKn6I5Jfq6F 0PwFGDVHzLtuhloClPQQRVudg7DcDaoFvD2sBKNirczTM/VNcf+4XGiqSKDS9grNDqMr Fbog== 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=xA5xj4byS3xgCv/6dltCY9jA9owDwtVZUEVfVuxHKQM=; b=bbpupVgTcCdk3sknXiL2JNttV0qluz52l8eJLVk4RSHmcL6dvEq6by1bbZWLkXcpbm Y9/qEgTg/UeeG8QPEI92S+TrlouDZntqFRvBZ4LmTgTqRtuoEm1QR6wVvuwbcsumBMbL ai/kHw4L7SRtB3kCL6p4dYBe8oyEh756txNdGNOha2YDWhu78NTf40wJIQbox7syEcFt /28J5rHmM31Clf7tDndvDZcZ1Ky3yPqmYUzJScHsESGCOTTEmXE+8r5UKrjnMN+yCtay MjeA++/Lsn9KZONG7O8XewoWB00qtUwWGTrbn+RDAidRICQHnIDqYd57vUTVYiixR81n 93LQ== X-Gm-Message-State: AKS2vOysU8sU5n/+yoZiku1AIoIZ4ZSHyAw4Cdusen5KLdmEBMunuBRW mAiHOPXdnA/gNA== X-Received: by 10.99.111.194 with SMTP id k185mr8292219pgc.69.1497572984104; Thu, 15 Jun 2017 17:29:44 -0700 (PDT) Received: from localhost (p2239-ipad303aobadori.miyagi.ocn.ne.jp. [123.216.73.239]) by smtp.gmail.com with ESMTPSA id b82sm743515pfd.111.2017.06.15.17.29.43 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 15 Jun 2017 17:29:43 -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] Support PTP Stick and Touchpad device Date: Fri, 16 Jun 2017 09:29:39 +0900 Message-Id: <20170616002940.7279-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. - Stick Pointer works as Mouse. Signed-off-by: Masaki Ota Reviewed-by: Benjamin Tissoires --- drivers/hid/hid-ids.h | 2 ++ drivers/hid/hid-multitouch.c | 23 +++++++++++++++++++++-- 2 files changed, 23 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..ba9d9020f958 100644 --- a/drivers/hid/hid-multitouch.c +++ b/drivers/hid/hid-multitouch.c @@ -148,6 +148,7 @@ static void mt_post_parse(struct mt_device *td); /* reserved 0x0011 */ #define MT_CLS_WIN_8 0x0012 #define MT_CLS_EXPORT_ALL_INPUTS 0x0013 +#define MT_CLS_WIN_8_DUAL 0x0014 /* vendor specific classes */ #define MT_CLS_3M 0x0101 @@ -217,6 +218,12 @@ static struct mt_class mt_classes[] = { .quirks = MT_QUIRK_ALWAYS_VALID | MT_QUIRK_CONTACT_CNT_ACCURATE, .export_all_inputs = true }, + { .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 }, /* * vendor specific classes @@ -512,7 +519,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 +587,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 +1299,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,