From patchwork Thu Jul 14 06:08:42 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Duggan X-Patchwork-Id: 9229041 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 58DA660574 for ; Thu, 14 Jul 2016 06:08:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 48AD52810E for ; Thu, 14 Jul 2016 06:08:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3D3BB28119; Thu, 14 Jul 2016 06:08:56 +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.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI 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 D52D92810E for ; Thu, 14 Jul 2016 06:08:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751772AbcGNGIv (ORCPT ); Thu, 14 Jul 2016 02:08:51 -0400 Received: from us-mx1.synaptics.com ([192.147.44.131]:35348 "EHLO us-mx1.synaptics.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751768AbcGNGIu (ORCPT ); Thu, 14 Jul 2016 02:08:50 -0400 Received: from unknown (HELO USW-OWA1.synaptics-inc.local) ([10.20.24.16]) by us-mx1.synaptics.com with ESMTP; 13 Jul 2016 23:08:50 -0700 Received: from noble.synaptics-inc.local (10.4.10.103) by USW-OWA1.synaptics-inc.local (10.20.24.16) with Microsoft SMTP Server (TLS) id 14.3.248.2; Wed, 13 Jul 2016 23:08:49 -0700 From: Andrew Duggan To: , CC: Andrew Duggan , Dmitry Torokhov , Linus Walleij , Jiri Kosina , Benjamin Tissoires , Vincent Huang , Nick Dyer , Chris Healy , , Mark Rutland , Rob Herring Subject: [PATCH v3 3/8] Input: synaptics-rmi4: Add dribble and palm gesture parameters to device tree Date: Wed, 13 Jul 2016 23:08:42 -0700 Message-ID: <1468476522-8032-1-git-send-email-aduggan@synaptics.com> X-Mailer: git-send-email 2.5.0 MIME-Version: 1.0 X-Originating-IP: [10.4.10.103] 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 Signed-off-by: Andrew Duggan Acked-by: Rob Herring Reviewed-by: Linus Walleij --- This version includes Nick's suggestion of adding force to the device tree parameters so make it obvious that these parameters overwrite the default values set in the firware config. .../devicetree/bindings/input/rmi4/rmi_2d_sensor.txt | 10 ++++++++++ drivers/input/rmi4/rmi_2d_sensor.c | 13 +++++++++++++ 2 files changed, 23 insertions(+) diff --git a/Documentation/devicetree/bindings/input/rmi4/rmi_2d_sensor.txt b/Documentation/devicetree/bindings/input/rmi4/rmi_2d_sensor.txt index f2c30c8..c00665d 100644 --- a/Documentation/devicetree/bindings/input/rmi4/rmi_2d_sensor.txt +++ b/Documentation/devicetree/bindings/input/rmi4/rmi_2d_sensor.txt @@ -37,6 +37,16 @@ Optional Properties: disable reporing absolute position data. - syna,rezero-wait-ms: Time in miliseconds to wait after issuing a rezero command. +- syna,dribble-force-enable: Enable reporting of dribble packets in the firmware + (overwrites default value in firmware config). +- syna,dribble-force-disable: Disable reporting of dribble packets in the firmware. + (overwrites default value in firmware config). +- syna,palm-detect-force-enable: Enable reporting the palm detect gesture in the + firmware. (overwrites default value in firmware + config). +- syna,palm-detect-force-disable: Disable reporting the palm detect gesture in + the firmware. (overwrites default value in + firmware config). Example of a RMI4 I2C device with F11: diff --git a/drivers/input/rmi4/rmi_2d_sensor.c b/drivers/input/rmi4/rmi_2d_sensor.c index e97bd7f..a092f6a 100644 --- a/drivers/input/rmi4/rmi_2d_sensor.c +++ b/drivers/input/rmi4/rmi_2d_sensor.c @@ -317,6 +317,19 @@ int rmi_2d_sensor_of_probe(struct device *dev, pdata->rezero_wait = val; + if (of_property_read_bool(dev->of_node, "syna,dribble-force-enable")) + pdata->dribble = RMI_REG_STATE_ON; + else if (of_property_read_bool(dev->of_node, + "syna,dribble-force-disable")) + pdata->dribble = RMI_REG_STATE_OFF; + + if (of_property_read_bool(dev->of_node, + "syna,palm-detect-force-enable")) + pdata->palm_detect = RMI_REG_STATE_ON; + else if (of_property_read_bool(dev->of_node, + "syna,palm-detect-force-disable")) + pdata->palm_detect = RMI_REG_STATE_OFF; + return 0; } #else