From patchwork Tue Dec 22 11:08:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heinrich Schuchardt X-Patchwork-Id: 346707 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 443D7C433E0 for ; Tue, 22 Dec 2020 11:09:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1145C23124 for ; Tue, 22 Dec 2020 11:09:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725897AbgLVLJ4 (ORCPT ); Tue, 22 Dec 2020 06:09:56 -0500 Received: from mout.gmx.net ([212.227.15.15]:39793 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725847AbgLVLJ4 (ORCPT ); Tue, 22 Dec 2020 06:09:56 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1608635300; bh=w3eF+si7e98IAYsFaPGDgdO3+FGxhhiRKm/JCEsQt9c=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date; b=VN5NKVL6axuhBcpBY5CpatnyuAFi8vs0AyHQZ5NSf+FnSTgyujP3eTn5PYaW4VdWc aQnW2SKMIdO/ERI/ROme1V2Z4wtbsQ338nIjjMgPyy1b+O1pU2nrAxK5taOR416gTo s9snhap9UOLCQ4NyFs4x/NuZlZzwP1BBjvT8N1TM= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from LT02.fritz.box ([62.143.246.89]) by mail.gmx.com (mrgmx004 [212.227.17.184]) with ESMTPSA (Nemesis) id 1N5GDv-1jsjEf1R25-011E7m; Tue, 22 Dec 2020 12:08:20 +0100 From: Heinrich Schuchardt To: Dmitry Torokhov , Rob Herring Cc: linux-input@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Heinrich Schuchardt Subject: [PATCH 1/1] dt-bindings: adc-keys.txt: clarify description Date: Tue, 22 Dec 2020 12:08:15 +0100 Message-Id: <20201222110815.24121-1-xypron.glpk@gmx.de> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 X-Provags-ID: V03:K1:T38j14BVNR123t6GreLXV8CdLOXYQXkS20/t6TpFp9eD1nXX81+ VROophO1u084jvi68NSWgY5pmoIj0Cj7qfrNKOzu1mr425XhIk0R0wsT6tdR2xi4VFhL4YE jLs9HWBU62cBB7Eb7JWFfJaHEltKxgpAiB9357UtI+xr2Ye/FOJuNyqqeHAxZsQGJhhKEIH BjV9NXXyoTC/TH2R1+xoA== X-UI-Out-Filterresults: notjunk:1; V03:K0:iYz9xFU/6DE=:Kqj9JaHSVuDM58CIrnF0R0 /u7fUe8WrAOTZC2v7tRR8BX6HdFKu5+Jp49FH+1EGkiEQ6R1qXXYqD6zsnU1/H3XwVDiRcR0v +/xm/vc16BCVx7VK5xrhsSrHlLIh9NjmdAW2TtUokzquqlgPgG0CJWKdps8g56r8ho18A5MhL /OctsokZH7q5WjQzEzrxsC9znf+xTynXxYs2wq2MlmZceS/dWzfNYfODpp+e0pDUA5Te+vc30 lpVmjPQUgKXllXveZA0PaGyEjTiQ3T/UxZoCqGWgfya0GCAbdWZrhJBCcDGhowOvfEb2M+QoH lxIGmybBXLjxctNhVpOW06z0Ipt5a5q/dWx216BER3A71yZ0ieaSscrlZz4wm1DqFY1j9hqWP ujIDkahZTgvFL8p/FiI7VNExIBz6g8S5VQq4PZmOUvsjm/IuxHxkcctXx5VBNzKPjr2QYbKUq zvPbZ3/9pdajEbry6X9l+0QWJ94Ajw0omeITm99oUE8ugzY8E4X1d3dhNJFdQhE217OYD9eV0 yAsYSQeOqIOXyFZ9iX7+mPA8zMy7EAaPZenZ7t5/MILXOBJxsPB+T6L53ljGH1P2B6fsC3cMn 5qEL4E1ILDDRc2pusB6G8m+6bRUoO/4ZGo3SqIJ1CtD0USzWXY74MQxKNVt22rdXGIupnomS2 RY9NA4GWuQ5Zf0jI0nJqpn0YVRdmTWmgyRYjmZKyBjHi/2mKchbp4XvXI3jU1gsl5DDB8gHm2 fsEFEn2C3cdyFDEAesiwyfKY6LdKABc+0olaMJBFOZBaCYqEctbsfNX7+5K45htIjEYqgl0RM NOQtvLCjts4woj/see8sGn5kOajOhzyb8MM+qxiFMvuIBh8ZnJHYy2tTiEOnBGKjqKv3zNq2x aLHcRo3nyv/C9cOSQLcg== Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org The current description of ADC keys is not precise enough. "when this key is pressed" leaves it open if a key is considered pressed below or above the threshold. This has led to confusion: drivers/input/keyboard/adc-keys.c ignores the meaning of thresholds and sets the key that is closest to press-threshold-microvolt. This patch nails down the definitions and provides an interpretation of the supplied example. Signed-off-by: Heinrich Schuchardt Acked-by: Rob Herring --- I know that this file needs to be converted to YAML. But lets first get the text right. --- .../devicetree/bindings/input/adc-keys.txt | 22 +++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) -- 2.29.2 diff --git a/Documentation/devicetree/bindings/input/adc-keys.txt b/Documentation/devicetree/bindings/input/adc-keys.txt index e551814629b4..6c8be6a9ace2 100644 --- a/Documentation/devicetree/bindings/input/adc-keys.txt +++ b/Documentation/devicetree/bindings/input/adc-keys.txt @@ -5,7 +5,8 @@ Required properties: - compatible: "adc-keys" - io-channels: Phandle to an ADC channel - io-channel-names = "buttons"; - - keyup-threshold-microvolt: Voltage at which all the keys are considered up. + - keyup-threshold-microvolt: Voltage above or equal to which all the keys are + considered up. Optional properties: - poll-interval: Poll interval time in milliseconds @@ -17,7 +18,12 @@ Each button (key) is represented as a sub-node of "adc-keys": Required subnode-properties: - label: Descriptive name of the key. - linux,code: Keycode to emit. - - press-threshold-microvolt: Voltage ADC input when this key is pressed. + - press-threshold-microvolt: voltage above or equal to which this key is + considered pressed. + +No two values of press-threshold-microvolt may be the same. +All values of press-threshold-microvolt must be less than +keyup-threshold-microvolt. Example: @@ -47,3 +53,15 @@ Example: press-threshold-microvolt = <500000>; }; }; + ++--------------------------------+------------------------+ +| 2.000.000 <= value | no key pressed | ++--------------------------------+------------------------+ +| 1.500.000 <= value < 2.000.000 | KEY_VOLUMEUP pressed | ++--------------------------------+------------------------+ +| 1.000.000 <= value < 1.500.000 | KEY_VOLUMEDOWN pressed | ++--------------------------------+------------------------+ +| 500.000 <= value < 1.000.000 | KEY_ENTER pressed | ++--------------------------------+------------------------+ +| value < 500.000 | no key pressed | ++--------------------------------+------------------------+