Path: blob/master/Documentation/devicetree/bindings/input/adc-joystick.yaml
26308 views
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)1# Copyright 2019-2020 Artur Rojek2%YAML 1.23---4$id: http://devicetree.org/schemas/input/adc-joystick.yaml#5$schema: http://devicetree.org/meta-schemas/core.yaml#67title: ADC attached joystick89maintainers:10- Artur Rojek <contact@artur-rojek.eu>1112description: >13Bindings for joystick devices connected to ADC controllers supporting14the Industrial I/O subsystem.1516allOf:17- $ref: input.yaml#1819properties:20compatible:21const: adc-joystick2223io-channels:24minItems: 125maxItems: 102426description: >27List of phandle and IIO specifier pairs.28Each pair defines one ADC channel to which a joystick axis is connected.29See30https://github.com/devicetree-org/dt-schema/blob/master/schemas/iio/iio-consumer.yaml31for details.3233poll-interval: true3435'#address-cells':36const: 13738'#size-cells':39const: 04041required:42- compatible43- io-channels44- '#address-cells'45- '#size-cells'4647additionalProperties: false4849patternProperties:50"^axis@[0-9a-f]+$":51type: object52$ref: input.yaml#53description: >54Represents a joystick axis bound to the given ADC channel.55For each entry in the io-channels list, one axis subnode with a matching56reg property must be specified.5758properties:59reg:60minimum: 061maximum: 102362description: Index of an io-channels list entry bound to this axis.6364linux,code:65description: EV_ABS specific event code generated by the axis.6667abs-range:68$ref: /schemas/types.yaml#/definitions/uint32-array69items:70- description: minimum value71- description: maximum value72description: >73Minimum and maximum values produced by the axis.74For an ABS_X axis this will be the left-most and right-most75inclination of the joystick. If min > max, it is left to userspace to76treat the axis as inverted.77This property is interpreted as two signed 32 bit values.7879abs-fuzz:80$ref: /schemas/types.yaml#/definitions/uint3281description: >82Amount of noise in the input value.83Omitting this property indicates the axis is precise.8485abs-flat:86$ref: /schemas/types.yaml#/definitions/uint3287description: >88Axial "deadzone", or area around the center position, where the axis89is considered to be at rest.90Omitting this property indicates the axis always returns to exactly91the center position.9293required:94- reg95- linux,code96- abs-range9798additionalProperties: false99100examples:101- |102#include <dt-bindings/iio/adc/ingenic,adc.h>103#include <dt-bindings/input/input.h>104105joystick: adc-joystick {106compatible = "adc-joystick";107io-channels = <&adc INGENIC_ADC_TOUCH_XP>,108<&adc INGENIC_ADC_TOUCH_YP>;109#address-cells = <1>;110#size-cells = <0>;111112axis@0 {113reg = <0>;114linux,code = <ABS_X>;115abs-range = <3300 0>;116abs-fuzz = <4>;117abs-flat = <200>;118};119axis@1 {120reg = <1>;121linux,code = <ABS_Y>;122abs-range = <0 3300>;123abs-fuzz = <4>;124abs-flat = <200>;125};126};127128129