* [PATCH 1/1] dt-bindings: adc-keys.txt: clarify description
@ 2020-12-22 11:08 Heinrich Schuchardt
2021-01-03 16:38 ` Rob Herring
2021-01-05 22:21 ` Dmitry Torokhov
0 siblings, 2 replies; 3+ messages in thread
From: Heinrich Schuchardt @ 2020-12-22 11:08 UTC (permalink / raw)
To: Dmitry Torokhov, Rob Herring
Cc: linux-input, devicetree, linux-kernel, Heinrich Schuchardt
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 <xypron.glpk@gmx.de>
---
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(-)
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 |
++--------------------------------+------------------------+
--
2.29.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 1/1] dt-bindings: adc-keys.txt: clarify description
2020-12-22 11:08 [PATCH 1/1] dt-bindings: adc-keys.txt: clarify description Heinrich Schuchardt
@ 2021-01-03 16:38 ` Rob Herring
2021-01-05 22:21 ` Dmitry Torokhov
1 sibling, 0 replies; 3+ messages in thread
From: Rob Herring @ 2021-01-03 16:38 UTC (permalink / raw)
To: Heinrich Schuchardt
Cc: devicetree, linux-input, linux-kernel, Dmitry Torokhov, Rob Herring
On Tue, 22 Dec 2020 12:08:15 +0100, Heinrich Schuchardt wrote:
> 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 <xypron.glpk@gmx.de>
> ---
> 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(-)
>
Acked-by: Rob Herring <robh@kernel.org>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 1/1] dt-bindings: adc-keys.txt: clarify description
2020-12-22 11:08 [PATCH 1/1] dt-bindings: adc-keys.txt: clarify description Heinrich Schuchardt
2021-01-03 16:38 ` Rob Herring
@ 2021-01-05 22:21 ` Dmitry Torokhov
1 sibling, 0 replies; 3+ messages in thread
From: Dmitry Torokhov @ 2021-01-05 22:21 UTC (permalink / raw)
To: Heinrich Schuchardt; +Cc: Rob Herring, linux-input, devicetree, linux-kernel
On Tue, Dec 22, 2020 at 12:08:15PM +0100, Heinrich Schuchardt wrote:
> 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 <xypron.glpk@gmx.de>
Applied, thank you.
--
Dmitry
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-01-05 22:22 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-22 11:08 [PATCH 1/1] dt-bindings: adc-keys.txt: clarify description Heinrich Schuchardt
2021-01-03 16:38 ` Rob Herring
2021-01-05 22:21 ` Dmitry Torokhov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).