brintos

brintos / linux-shallow public Read only

0
0
Text · 3.3 KiB · 6c244d6 Raw
128 lines · yaml
1# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)2# Copyright 2019-2020 Artur Rojek3%YAML 1.24---5$id: http://devicetree.org/schemas/input/adc-joystick.yaml#6$schema: http://devicetree.org/meta-schemas/core.yaml#7 8title: ADC attached joystick9 10maintainers:11  - Artur Rojek <contact@artur-rojek.eu>12 13description: >14  Bindings for joystick devices connected to ADC controllers supporting15  the Industrial I/O subsystem.16 17allOf:18  - $ref: input.yaml#19 20properties:21  compatible:22    const: adc-joystick23 24  io-channels:25    minItems: 126    maxItems: 102427    description: >28      List of phandle and IIO specifier pairs.29      Each pair defines one ADC channel to which a joystick axis is connected.30      See31      https://github.com/devicetree-org/dt-schema/blob/master/schemas/iio/iio-consumer.yaml32      for details.33 34  poll-interval: true35 36  '#address-cells':37    const: 138 39  '#size-cells':40    const: 041 42required:43  - compatible44  - io-channels45  - '#address-cells'46  - '#size-cells'47 48additionalProperties: false49 50patternProperties:51  "^axis@[0-9a-f]+$":52    type: object53    $ref: input.yaml#54    description: >55      Represents a joystick axis bound to the given ADC channel.56      For each entry in the io-channels list, one axis subnode with a matching57      reg property must be specified.58 59    properties:60      reg:61        minimum: 062        maximum: 102363        description: Index of an io-channels list entry bound to this axis.64 65      linux,code:66        description: EV_ABS specific event code generated by the axis.67 68      abs-range:69        $ref: /schemas/types.yaml#/definitions/uint32-array70        items:71          - description: minimum value72          - description: maximum value73        description: >74          Minimum and maximum values produced by the axis.75          For an ABS_X axis this will be the left-most and right-most76          inclination of the joystick. If min > max, it is left to userspace to77          treat the axis as inverted.78          This property is interpreted as two signed 32 bit values.79 80      abs-fuzz:81        $ref: /schemas/types.yaml#/definitions/uint3282        description: >83          Amount of noise in the input value.84          Omitting this property indicates the axis is precise.85 86      abs-flat:87        $ref: /schemas/types.yaml#/definitions/uint3288        description: >89          Axial "deadzone", or area around the center position, where the axis90          is considered to be at rest.91          Omitting this property indicates the axis always returns to exactly92          the center position.93 94    required:95      - reg96      - linux,code97      - abs-range98 99    additionalProperties: false100 101examples:102  - |103    #include <dt-bindings/iio/adc/ingenic,adc.h>104    #include <dt-bindings/input/input.h>105 106    joystick: adc-joystick {107      compatible = "adc-joystick";108      io-channels = <&adc INGENIC_ADC_TOUCH_XP>,109                    <&adc INGENIC_ADC_TOUCH_YP>;110      #address-cells = <1>;111      #size-cells = <0>;112 113      axis@0 {114              reg = <0>;115              linux,code = <ABS_X>;116              abs-range = <3300 0>;117              abs-fuzz = <4>;118              abs-flat = <200>;119      };120      axis@1 {121              reg = <1>;122              linux,code = <ABS_Y>;123              abs-range = <0 3300>;124              abs-fuzz = <4>;125              abs-flat = <200>;126      };127    };128