# ADC attached joystick

_Peios Kernel / Hardware and drivers / Device-tree binding reference / Input bindings_

> Device-tree binding reference for ADC attached joystick.

<!-- SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) -->


<a id="dt-root"></a>

**Schema identifier (<code>&#36;id</code>):** <span id="dt-09f478f44eb202ea573e"><code>&#34;http&#58;&#47;&#47;devicetree&#46;org&#47;schemas&#47;input&#47;adc&#45;joystick&#46;yaml&#35;&#34;</code></span>

**Schema dialect (<code>&#36;schema</code>):** <span id="dt-dcb375baab6014763a68"><code>&#34;http&#58;&#47;&#47;devicetree&#46;org&#47;meta&#45;schemas&#47;core&#46;yaml&#35;&#34;</code></span>

<a id="dt-e46b5a5dd81dbd751c9f"></a>

**Maintainers (<code>maintainers</code>):** <a id="dt-fbc39820abb8bb999095"></a> <span id="dt-fb78ddfc22abfc6fe56d"><code>&#34;Artur Rojek &#60;contact&#64;artur&#45;rojek&#46;eu&#62;&#34;</code></span>

<div id="dt-6d1c5ef59f0239d38c02">
<p style="white-space: pre-wrap">Bindings for joystick devices connected to ADC controllers supporting the Industrial I/O subsystem.</p>
</div>

<a id="dt-935ee547587f3e75de61"></a>

## All of these rules must match (<code>allOf</code>)

<a id="dt-d33de94ac1d3652cd22a"></a>

### Rule 1

> **Shared schema rule (<code>&#36;ref</code>):** <span id="dt-95c8874f25311f4b1ab1">[<code>input&#46;yaml&#35;</code>](</kernel/hardware/devicetree-bindings/dt-input/input.md#dt-root>)</span>

<a id="dt-e1f655ed0ff4d595dadc"></a>

## Properties and child nodes (<code>properties</code>)

<a id="dt-5c1d81699dcbe840de83"></a>

### <code>compatible</code> — required here

**Exact value (<code>const</code>):** <span id="dt-1765195bf8e86c3ccec6"><code>&#34;adc&#45;joystick&#34;</code></span>

<a id="dt-e11e74a4fd8058c71a77"></a>

### <code>io&#45;channels</code> — required here

**Minimum number of items (<code>minItems</code>):** <span id="dt-0350e4fe024bda6fb981"><code>1</code></span>

**Maximum number of items (<code>maxItems</code>):** <span id="dt-b9221b1187f40eb0f40e"><code>1024</code></span>

<div id="dt-00f0389e57ab952e1ac1">
<p style="white-space: pre-wrap">List of phandle and IIO specifier pairs. Each pair defines one ADC channel to which a joystick axis is connected. See https://github.com/devicetree-org/dt-schema/blob/master/schemas/iio/iio-consumer.yaml for details.</p>
</div>

<a id="dt-014743e3c59fc92ab9b6"></a>

### <code>poll&#45;interval</code> — not listed as required here

<code>true</code> — No constraints added by this property rule.

<a id="dt-2efe70314a961a652abe"></a>

### <code>&#35;address&#45;cells</code> — required here

**Exact value (<code>const</code>):** <span id="dt-e6e6af09ab617572731b"><code>1</code></span>

<a id="dt-ee0e5bf71366d312f1dc"></a>

### <code>&#35;size&#45;cells</code> — required here

**Exact value (<code>const</code>):** <span id="dt-793e842f88ef513a8f93"><code>0</code></span>

**Required in this object (<code>required</code>):** <a id="dt-8313173ff1c9b300d560"></a> <span id="dt-048b70ee865d6847aa3d"><code>&#34;compatible&#34;</code></span>, <span id="dt-ee7433925c1528c16b99"><code>&#34;io&#45;channels&#34;</code></span>, <span id="dt-f3765998c4e103e45f2f"><code>&#34;&#35;address&#45;cells&#34;</code></span>, <span id="dt-329d9b3604d5b98bc19d"><code>&#34;&#35;size&#45;cells&#34;</code></span>

<a id="dt-738c4b4f9e483441138b"></a>

## Properties not matched by properties or patternProperties in this schema (<code>additionalProperties</code>)

<code>false</code>

Not allowed by this rule.

<a id="dt-e92215bd3c2f5373b164"></a>

## Properties matching a name pattern (<code>patternProperties</code>)

<a id="dt-ff5374405fb05054a24e"></a>

### <code>&#94;axis&#64;&#91;0&#45;9a&#45;f&#93;&#43;&#36;</code> — name matches this regular expression

**Value type (<code>type</code>):** <span id="dt-ea03245d2b433d0ea064"><code>&#34;object&#34;</code></span>

**Shared schema rule (<code>&#36;ref</code>):** <span id="dt-0bf5c989bca51d40cc26">[<code>input&#46;yaml&#35;</code>](</kernel/hardware/devicetree-bindings/dt-input/input.md#dt-root>)</span>

<div id="dt-a0d66e60cfc21fe6121a">
<p style="white-space: pre-wrap">Represents a joystick axis bound to the given ADC channel. For each entry in the io-channels list, one axis subnode with a matching reg property must be specified.</p>
</div>

<a id="dt-cab3cb9ed18992706491"></a>

#### Properties and child nodes (<code>properties</code>)

<a id="dt-8e71e89a951b5b84108c"></a>

**<code>reg</code> — required here**

**Minimum value (<code>minimum</code>):** <span id="dt-0cd3bde399a59b1067b3"><code>0</code></span>

**Maximum value (<code>maximum</code>):** <span id="dt-62cf6087a56e5f257d68"><code>1023</code></span>

<div id="dt-aef730413fc12953862e">
<p style="white-space: pre-wrap">Index of an io-channels list entry bound to this axis.</p>
</div>

<a id="dt-88bf43cf77e299952b27"></a>

**<code>linux&#44;code</code> — required here**

<div id="dt-55249635d8a77858f114">
<p style="white-space: pre-wrap">EV_ABS specific event code generated by the axis.</p>
</div>

<a id="dt-12e2556d3fa7d4582a31"></a>

**<code>abs&#45;range</code> — required here**

**Shared schema rule (<code>&#36;ref</code>):** <span id="dt-f5e3122ba542a17993cd">[<code>&#47;schemas&#47;types&#46;yaml&#35;&#47;definitions&#47;uint32&#45;array</code>](</kernel/hardware/devicetree-bindings/dt-shared/types.md#dt-03a03f95a666fe4b033c>)</span>

<a id="dt-975a7f073700e1c72d6b"></a>

**Array item rules (<code>items</code>)**

<a id="dt-e5ee29dcd05357e505b7"></a>

**Item 1**

> <div id="dt-dc0fb800f3308ffc444b">
> <p style="white-space: pre-wrap">minimum value</p>
> </div>

<a id="dt-490295e3b7d3bc46f998"></a>

**Item 2**

> <div id="dt-42d91601cb0b0b4e5872">
> <p style="white-space: pre-wrap">maximum value</p>
> </div>

<div id="dt-893eb668268da8cd15b4">
<p style="white-space: pre-wrap">Minimum and maximum values produced by the axis. For an ABS_X axis this will be the left-most and right-most inclination of the joystick. If min &gt; max, it is left to userspace to treat the axis as inverted. This property is interpreted as two signed 32 bit values.</p>
</div>

<a id="dt-e70db921b0f21f409f6e"></a>

**<code>abs&#45;fuzz</code> — not listed as required here**

**Shared schema rule (<code>&#36;ref</code>):** <span id="dt-476b5a6f08f445d3f5bb">[<code>&#47;schemas&#47;types&#46;yaml&#35;&#47;definitions&#47;uint32</code>](</kernel/hardware/devicetree-bindings/dt-shared/types.md#dt-d57795d6573ee5d67d37>)</span>

<div id="dt-159faee8a9df0d5968b6">
<p style="white-space: pre-wrap">Amount of noise in the input value. Omitting this property indicates the axis is precise.</p>
</div>

<a id="dt-4ab9277ad061af6f2628"></a>

**<code>abs&#45;flat</code> — not listed as required here**

**Shared schema rule (<code>&#36;ref</code>):** <span id="dt-23d571c0de1ccef4baec">[<code>&#47;schemas&#47;types&#46;yaml&#35;&#47;definitions&#47;uint32</code>](</kernel/hardware/devicetree-bindings/dt-shared/types.md#dt-d57795d6573ee5d67d37>)</span>

<div id="dt-8334fe5e98fdcbb70df1">
<p style="white-space: pre-wrap">Axial "deadzone", or area around the center position, where the axis is considered to be at rest. Omitting this property indicates the axis always returns to exactly the center position.</p>
</div>

**Required in this object (<code>required</code>):** <a id="dt-0483de498a8d7954e8d5"></a> <span id="dt-8de5bba0b4a8e977d19a"><code>&#34;reg&#34;</code></span>, <span id="dt-8a3a8062a086aa5d0f3b"><code>&#34;linux&#44;code&#34;</code></span>, <span id="dt-9f0f065f9fce3b1f8f6f"><code>&#34;abs&#45;range&#34;</code></span>

<a id="dt-ba7f193f270666ea6312"></a>

#### Properties not matched by properties or patternProperties in this schema (<code>additionalProperties</code>)

<code>false</code>

Not allowed by this rule.

<a id="dt-1a130cabaa8a47b058bf"></a>

## Examples (<code>examples</code>)

<pre id="dt-0bd6510295af0c95ff2d"><code class="language-dts">#include &lt;dt-bindings/iio/adc/ingenic,adc.h&gt;
#include &lt;dt-bindings/input/input.h&gt;

joystick: adc-joystick {
  compatible = "adc-joystick";
  io-channels = &lt;&amp;adc INGENIC_ADC_TOUCH_XP&gt;,
                &lt;&amp;adc INGENIC_ADC_TOUCH_YP&gt;;
  #address-cells = &lt;1&gt;;
  #size-cells = &lt;0&gt;;

  axis@0 {
          reg = &lt;0&gt;;
          linux,code = &lt;ABS_X&gt;;
          abs-range = &lt;3300 0&gt;;
          abs-fuzz = &lt;4&gt;;
          abs-flat = &lt;200&gt;;
  };
  axis@1 {
          reg = &lt;1&gt;;
          linux,code = &lt;ABS_Y&gt;;
          abs-range = &lt;0 3300&gt;;
          abs-fuzz = &lt;4&gt;;
          abs-flat = &lt;200&gt;;
  };
};
</code></pre>

## Source notes

<details>
<summary>Annotations retained from the schema source</summary>

<p id="dt-comment-0"><strong>Line 1:</strong> <span> SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)</span></p>

<p id="dt-comment-1"><strong>Line 2:</strong> <span> Copyright 2019-2020 Artur Rojek</span></p>

</details>
