From patchwork Mon Mar 31 21:11:05 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christopher Heiny X-Patchwork-Id: 3917871 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 32607BF540 for ; Mon, 31 Mar 2014 21:11:18 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4E1DA203AE for ; Mon, 31 Mar 2014 21:11:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 742E6201F4 for ; Mon, 31 Mar 2014 21:11:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750857AbaCaVLN (ORCPT ); Mon, 31 Mar 2014 17:11:13 -0400 Received: from us-mx2.synaptics.com ([192.147.44.131]:42348 "EHLO us-mx2.synaptics.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750946AbaCaVLM (ORCPT ); Mon, 31 Mar 2014 17:11:12 -0400 Received: from unknown (HELO securemail.synaptics.com) ([172.20.21.135]) by us-mx2.synaptics.com with ESMTP; 31 Mar 2014 14:11:12 -0700 Received: from USW-OWA1.synaptics-inc.local ([10.20.24.16]) by securemail.synaptics.com (PGP Universal service); Mon, 31 Mar 2014 13:55:51 -0700 X-PGP-Universal: processed; by securemail.synaptics.com on Mon, 31 Mar 2014 13:55:51 -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; Mon, 31 Mar 2014 14:11:11 -0700 From: Christopher Heiny To: Dmitry Torokhov CC: Linux Input , Christopher Heiny , Andrew Duggan , Vincent Huang , Vivian Ly , Linus Walleij , Benjamin Tissoires , David Herrmann , Jiri Kosina Subject: [PATCH v2 1/3] Input: synaptics-rmi4 - add F11 capabilities for touchpads Date: Mon, 31 Mar 2014 14:11:05 -0700 Message-ID: <1396300267-5108-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=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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 | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/drivers/input/rmi4/rmi_f11.c b/drivers/input/rmi4/rmi_f11.c index 8709abe..92eac8a 100644 --- a/drivers/input/rmi4/rmi_f11.c +++ b/drivers/input/rmi4/rmi_f11.c @@ -717,7 +717,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_mt_sync_frame(sensor->input); input_sync(sensor->input); } @@ -1104,13 +1104,10 @@ static void f11_set_abs_params(struct rmi_function *fn, struct f11_data *f11) /* We assume touchscreen unless demonstrably a touchpad or specified * as a touchpad in the platform data */ - if (sensor->sensor_type == rmi_f11_sensor_touchpad || - (sensor->sens_query.has_info2 && - !sensor->sens_query.is_clear)) - input_flags = INPUT_PROP_POINTER; + if (sensor->sensor_type == rmi_f11_sensor_touchpad) + input_flags = INPUT_MT_POINTER; else - input_flags = INPUT_PROP_DIRECT; - set_bit(input_flags, input->propbit); + input_flags = INPUT_MT_DIRECT; if (sensor->axis_align.swap_axes) { int temp = device_x_max; @@ -1220,11 +1217,20 @@ static int rmi_f11_initialize(struct rmi_function *fn) return rc; } + if (sensor->sens_query.has_info2) { + if (sensor->sens_query.is_clear) + sensor->sensor_type = rmi_f11_sensor_touchscreen; + else + sensor->sensor_type = rmi_f11_sensor_touchpad; + } + if (pdata->f11_sensor_data) { sensor->axis_align = pdata->f11_sensor_data->axis_align; sensor->type_a = pdata->f11_sensor_data->type_a; - sensor->sensor_type = + + if (sensor->sensor_type == rmi_f11_sensor_default) + sensor->sensor_type = pdata->f11_sensor_data->sensor_type; } @@ -1490,6 +1496,7 @@ static struct rmi_function_handler rmi_f11_handler = { module_rmi_driver(rmi_f11_handler); MODULE_AUTHOR("Christopher Heiny