From patchwork Fri Dec 19 22:45:42 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Duggan X-Patchwork-Id: 5521661 X-Patchwork-Delegate: jikos@jikos.cz Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 37D79BEEA8 for ; Fri, 19 Dec 2014 22:47:49 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5F5CA20148 for ; Fri, 19 Dec 2014 22:47:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 81C1E20154 for ; Fri, 19 Dec 2014 22:47:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752746AbaLSWr2 (ORCPT ); Fri, 19 Dec 2014 17:47:28 -0500 Received: from us-mx2.synaptics.com ([192.147.44.131]:64859 "EHLO us-mx1.synaptics.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752724AbaLSWr1 (ORCPT ); Fri, 19 Dec 2014 17:47:27 -0500 Received: from unknown (HELO securemail.synaptics.com) ([172.20.21.135]) by us-mx1.synaptics.com with ESMTP; 19 Dec 2014 15:20:35 -0800 Received: from USW-OWA1.synaptics-inc.local ([10.20.24.16]) by securemail.synaptics.com (PGP Universal service); Fri, 19 Dec 2014 15:12:44 -0800 X-PGP-Universal: processed; by securemail.synaptics.com on Fri, 19 Dec 2014 15:12:44 -0800 Received: from noble.synaptics-inc.local (10.4.10.98) by USW-OWA1.synaptics-inc.local (10.20.24.15) with Microsoft SMTP Server (TLS) id 14.3.195.1; Fri, 19 Dec 2014 14:47:27 -0800 From: Andrew Duggan To: , CC: Andrew Duggan , Jiri Kosina , Benjamin Tissoires Subject: [PATCH 2/3] HID: rmi: Support touchpads with external buttons Date: Fri, 19 Dec 2014 14:45:42 -0800 Message-ID: <1419029143-20484-2-git-send-email-aduggan@synaptics.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1419029143-20484-1-git-send-email-aduggan@synaptics.com> References: <1419029143-20484-1-git-send-email-aduggan@synaptics.com> MIME-Version: 1.0 X-Originating-IP: [10.4.10.98] X-Brightmail-Tracker: AAAAAQAAAWE= Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, 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 The external buttons on HID touchpads are connected as pass through devices and button events are not reported in the rmi registers. As a result on these devices we need to allow the HID generic desktop button events to be processed by hid-input. Signed-off-by: Andrew Duggan --- drivers/hid/hid-rmi.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/hid/hid-rmi.c b/drivers/hid/hid-rmi.c index 018f80f..cdfe165 100644 --- a/drivers/hid/hid-rmi.c +++ b/drivers/hid/hid-rmi.c @@ -35,6 +35,7 @@ /* device flags */ #define RMI_DEVICE BIT(0) +#define RMI_DEVICE_HAS_PHYS_BUTTONS BIT(1) enum rmi_mode_type { RMI_MODE_OFF = 0, @@ -472,6 +473,9 @@ static int rmi_event(struct hid_device *hdev, struct hid_field *field, if ((data->device_flags & RMI_DEVICE) && (field->application == HID_GD_POINTER || field->application == HID_GD_MOUSE)) { + if ((usage->hid & HID_USAGE_PAGE) == HID_UP_BUTTON) + return 0; + rmi_schedule_reset(hdev); return 1; } @@ -942,6 +946,10 @@ static int rmi_input_mapping(struct hid_device *hdev, * we want to make HID ignore the advertised HID collection * for RMI deivces */ + if ((data->device_flags & RMI_DEVICE_HAS_PHYS_BUTTONS) && + ((usage->hid & HID_USAGE_PAGE) == HID_UP_BUTTON)) + return 0; + if (data->device_flags & RMI_DEVICE) return -1;