dt-bindings: Add devicetree bindings
Add snapshot of device tree bindings from keystone common kernel, branch "android-mainline-keystone-qcom-release" at c4c12103f9c0 ("Snap for 9228065 from e32903b9a63bb558df8b803b076619c53c16baad to android-mainline-keystone-qcom-release"). Change-Id: I7682079615cbd9f29340a5c1f2a1d84ec441a1f1 Signed-off-by: Melody Olvera <quic_molvera@quicinc.com>
This commit is contained in:
103
bindings/input/adc-keys.yaml
Normal file
103
bindings/input/adc-keys.yaml
Normal file
@@ -0,0 +1,103 @@
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
%YAML 1.2
|
||||
---
|
||||
$id: http://devicetree.org/schemas/input/adc-keys.yaml#
|
||||
$schema: http://devicetree.org/meta-schemas/core.yaml#
|
||||
|
||||
title: ADC attached resistor ladder buttons
|
||||
|
||||
maintainers:
|
||||
- Alexandre Belloni <alexandre.belloni@bootlin.com>
|
||||
|
||||
allOf:
|
||||
- $ref: input.yaml#
|
||||
|
||||
properties:
|
||||
compatible:
|
||||
const: adc-keys
|
||||
|
||||
io-channels:
|
||||
maxItems: 1
|
||||
|
||||
io-channel-names:
|
||||
const: buttons
|
||||
|
||||
keyup-threshold-microvolt:
|
||||
description:
|
||||
Voltage above or equal to which all the keys are considered up.
|
||||
|
||||
poll-interval: true
|
||||
autorepeat: true
|
||||
|
||||
patternProperties:
|
||||
'^button-':
|
||||
type: object
|
||||
$ref: input.yaml#
|
||||
additionalProperties: false
|
||||
description:
|
||||
Each button (key) is represented as a sub-node.
|
||||
|
||||
properties:
|
||||
label: true
|
||||
|
||||
linux,code: true
|
||||
|
||||
press-threshold-microvolt:
|
||||
description:
|
||||
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.
|
||||
|
||||
required:
|
||||
- linux,code
|
||||
- press-threshold-microvolt
|
||||
|
||||
required:
|
||||
- compatible
|
||||
- io-channels
|
||||
- io-channel-names
|
||||
- keyup-threshold-microvolt
|
||||
|
||||
additionalProperties: false
|
||||
|
||||
examples:
|
||||
- |
|
||||
#include <dt-bindings/input/input.h>
|
||||
// +--------------------------------+------------------------+
|
||||
// | 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 |
|
||||
// +--------------------------------+------------------------+
|
||||
|
||||
adc-keys {
|
||||
compatible = "adc-keys";
|
||||
io-channels = <&lradc 0>;
|
||||
io-channel-names = "buttons";
|
||||
keyup-threshold-microvolt = <2000000>;
|
||||
|
||||
button-up {
|
||||
label = "Volume Up";
|
||||
linux,code = <KEY_VOLUMEUP>;
|
||||
press-threshold-microvolt = <1500000>;
|
||||
};
|
||||
|
||||
button-down {
|
||||
label = "Volume Down";
|
||||
linux,code = <KEY_VOLUMEDOWN>;
|
||||
press-threshold-microvolt = <1000000>;
|
||||
};
|
||||
|
||||
button-enter {
|
||||
label = "Enter";
|
||||
linux,code = <KEY_ENTER>;
|
||||
press-threshold-microvolt = <500000>;
|
||||
};
|
||||
};
|
||||
...
|
Reference in New Issue
Block a user