From patchwork Wed Mar 19 01:03:49 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christopher Heiny X-Patchwork-Id: 3856971 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 0397C9F369 for ; Wed, 19 Mar 2014 18:01:42 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1EE4020120 for ; Wed, 19 Mar 2014 18:01:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4665D20131 for ; Wed, 19 Mar 2014 18:01:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758013AbaCSBE1 (ORCPT ); Tue, 18 Mar 2014 21:04:27 -0400 Received: from [192.147.44.131] ([192.147.44.131]:23255 "EHLO us-mx2.synaptics.com" rhost-flags-FAIL-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1758366AbaCSBE0 (ORCPT ); Tue, 18 Mar 2014 21:04:26 -0400 Received: from unknown (HELO securemail.synaptics.com) ([172.20.21.135]) by us-mx2.synaptics.com with ESMTP; 18 Mar 2014 18:03:55 -0700 Received: from USW-OWA1.synaptics-inc.local ([10.20.24.16]) by securemail.synaptics.com (PGP Universal service); Tue, 18 Mar 2014 17:49:19 -0700 X-PGP-Universal: processed; by securemail.synaptics.com on Tue, 18 Mar 2014 17:49:19 -0700 Received: from brontomerus.synaptics.com (10.3.20.103) by USW-OWA1.synaptics-inc.local (10.20.24.15) with Microsoft SMTP Server (TLS) id 14.3.123.3; Tue, 18 Mar 2014 18:03:54 -0700 From: Christopher Heiny To: Dmitry Torokhov CC: Linux Input , Christopher Heiny , Andrew Duggan , Vincent Huang , Vivian Ly , Daniel Rosenberg , Linus Walleij , Benjamin Tissoires , David Herrmann , Jiri Kosina Subject: [PATCH 1/3] Input: synaptics-rmi4 - add capabilities for touchpads Date: Tue, 18 Mar 2014 18:03:49 -0700 Message-ID: <1395191031-3144-1-git-send-email-cheiny@synaptics.com> X-Mailer: git-send-email 1.8.3.1 MIME-Version: 1.0 X-Originating-IP: [10.3.20.103] 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 When the device is a touchpad additional capabilities need to be set and reported. Signed-off-by: Andrew Duggan Acked-by: Christopher Heiny Cc: Dmitry Torokhov Cc: Benjamin Tissoires Cc: Linux Walleij Cc: David Herrmann Cc: Jiri Kosina --- drivers/input/rmi4/rmi_f11.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/drivers/input/rmi4/rmi_f11.c b/drivers/input/rmi4/rmi_f11.c index 8709abe..07044d79 100644 --- a/drivers/input/rmi4/rmi_f11.c +++ b/drivers/input/rmi4/rmi_f11.c @@ -688,6 +688,9 @@ static void rmi_f11_abs_pos_report(struct f11_data *f11, /* MT sync between fingers */ if (sensor->type_a) input_mt_sync(sensor->input); + + if (sensor->sensor_type == rmi_f11_sensor_touchpad) + input_mt_report_pointer_emulation(sensor->input, true); } static void rmi_f11_finger_handler(struct f11_data *f11, @@ -717,7 +720,7 @@ static void rmi_f11_finger_handler(struct f11_data *f11, if (sensor->data.rel_pos) rmi_f11_rel_pos_report(sensor, i); } - input_mt_sync(sensor->input); + input_report_key(sensor->input, BTN_TOUCH, finger_pressed_count); input_sync(sensor->input); } @@ -1137,6 +1140,9 @@ static void f11_set_abs_params(struct rmi_function *fn, struct f11_data *f11) dev_dbg(&fn->dev, "Set ranges X=[%d..%d] Y=[%d..%d].", x_min, x_max, y_min, y_max); + input_set_abs_params(input, ABS_X, x_min, x_max, 0, 0); + input_set_abs_params(input, ABS_Y, y_min, y_max, 0, 0); + input_set_abs_params(input, ABS_MT_PRESSURE, 0, DEFAULT_MAX_ABS_MT_PRESSURE, 0, 0); input_set_abs_params(input, ABS_MT_TOUCH_MAJOR, @@ -1374,6 +1380,15 @@ static int rmi_f11_register_devices(struct rmi_function *fn) set_bit(BTN_RIGHT, input_dev_mouse->keybit); } + if (sensor->sensor_type == rmi_f11_sensor_touchpad) { + set_bit(BTN_TOOL_FINGER, input_dev->keybit); + set_bit(BTN_TOOL_DOUBLETAP, input_dev->keybit); + set_bit(BTN_TOOL_TRIPLETAP, input_dev->keybit); + set_bit(BTN_TOOL_QUADTAP, input_dev->keybit); + set_bit(BTN_TOOL_QUINTTAP, input_dev->keybit); + } + + return 0; error_unregister: