Path: blob/master/Documentation/devicetree/bindings/input/adc-keys.yaml
26308 views
# SPDX-License-Identifier: GPL-2.01%YAML 1.22---3$id: http://devicetree.org/schemas/input/adc-keys.yaml#4$schema: http://devicetree.org/meta-schemas/core.yaml#56title: ADC attached resistor ladder buttons78maintainers:9- Alexandre Belloni <alexandre.belloni@bootlin.com>1011allOf:12- $ref: input.yaml#1314properties:15compatible:16const: adc-keys1718io-channels:19maxItems: 12021io-channel-names:22const: buttons2324keyup-threshold-microvolt:25description:26Voltage above or equal to which all the keys are considered up.2728poll-interval: true29autorepeat: true3031patternProperties:32'^button-':33type: object34$ref: input.yaml#35additionalProperties: false36description:37Each button (key) is represented as a sub-node.3839properties:40label: true4142linux,code: true4344press-threshold-microvolt:45description:46Voltage above or equal to which this key is considered pressed. No47two values of press-threshold-microvolt may be the same. All values48of press-threshold-microvolt must be less than49keyup-threshold-microvolt.5051required:52- linux,code53- press-threshold-microvolt5455required:56- compatible57- io-channels58- io-channel-names59- keyup-threshold-microvolt6061additionalProperties: false6263examples:64- |65#include <dt-bindings/input/input.h>66// +--------------------------------+------------------------+67// | 2.000.000 <= value | no key pressed |68// +--------------------------------+------------------------+69// | 1.500.000 <= value < 2.000.000 | KEY_VOLUMEUP pressed |70// +--------------------------------+------------------------+71// | 1.000.000 <= value < 1.500.000 | KEY_VOLUMEDOWN pressed |72// +--------------------------------+------------------------+73// | 500.000 <= value < 1.000.000 | KEY_ENTER pressed |74// +--------------------------------+------------------------+75// | value < 500.000 | no key pressed |76// +--------------------------------+------------------------+7778adc-keys {79compatible = "adc-keys";80io-channels = <&lradc 0>;81io-channel-names = "buttons";82keyup-threshold-microvolt = <2000000>;8384button-up {85label = "Volume Up";86linux,code = <KEY_VOLUMEUP>;87press-threshold-microvolt = <1500000>;88};8990button-down {91label = "Volume Down";92linux,code = <KEY_VOLUMEDOWN>;93press-threshold-microvolt = <1000000>;94};9596button-enter {97label = "Enter";98linux,code = <KEY_ENTER>;99press-threshold-microvolt = <500000>;100};101};102...103104105