|
| 1 | +This binding is derived from clock bindings, and based on suggestions |
| 2 | +from Lars-Peter Clausen [1]. |
| 3 | + |
| 4 | +Sources of IIO channels can be represented by any node in the device |
| 5 | +tree. Those nodes are designated as IIO providers. IIO consumer |
| 6 | +nodes use a phandle and IIO specifier pair to connect IIO provider |
| 7 | +outputs to IIO inputs. Similar to the gpio specifiers, an IIO |
| 8 | +specifier is an array of one or more cells identifying the IIO |
| 9 | +output on a device. The length of an IIO specifier is defined by the |
| 10 | +value of a #io-channel-cells property in the IIO provider node. |
| 11 | + |
| 12 | +[1] http://marc.info/?l=linux-iio&m=135902119507483&w=2 |
| 13 | + |
| 14 | +==IIO providers== |
| 15 | + |
| 16 | +Required properties: |
| 17 | +#io-channel-cells: Number of cells in an IIO specifier; Typically 0 for nodes |
| 18 | + with a single IIO output and 1 for nodes with multiple |
| 19 | + IIO outputs. |
| 20 | + |
| 21 | +Example for a simple configuration with no trigger: |
| 22 | + |
| 23 | + adc: voltage-sensor@35 { |
| 24 | + compatible = "maxim,max1139"; |
| 25 | + reg = <0x35>; |
| 26 | + #io-channel-cells = <1>; |
| 27 | + }; |
| 28 | + |
| 29 | +Example for a configuration with trigger: |
| 30 | + |
| 31 | + adc@35 { |
| 32 | + compatible = "some-vendor,some-adc"; |
| 33 | + reg = <0x35>; |
| 34 | + |
| 35 | + adc1: iio-device@0 { |
| 36 | + #io-channel-cells = <1>; |
| 37 | + /* other properties */ |
| 38 | + }; |
| 39 | + adc2: iio-device@1 { |
| 40 | + #io-channel-cells = <1>; |
| 41 | + /* other properties */ |
| 42 | + }; |
| 43 | + }; |
| 44 | + |
| 45 | +==IIO consumers== |
| 46 | + |
| 47 | +Required properties: |
| 48 | +io-channels: List of phandle and IIO specifier pairs, one pair |
| 49 | + for each IIO input to the device. Note: if the |
| 50 | + IIO provider specifies '0' for #io-channel-cells, |
| 51 | + then only the phandle portion of the pair will appear. |
| 52 | + |
| 53 | +Optional properties: |
| 54 | +io-channel-names: |
| 55 | + List of IIO input name strings sorted in the same |
| 56 | + order as the io-channels property. Consumers drivers |
| 57 | + will use io-channel-names to match IIO input names |
| 58 | + with IIO specifiers. |
| 59 | +io-channel-ranges: |
| 60 | + Empty property indicating that child nodes can inherit named |
| 61 | + IIO channels from this node. Useful for bus nodes to provide |
| 62 | + and IIO channel to their children. |
| 63 | + |
| 64 | +For example: |
| 65 | + |
| 66 | + device { |
| 67 | + io-channels = <&adc 1>, <&ref 0>; |
| 68 | + io-channel-names = "vcc", "vdd"; |
| 69 | + }; |
| 70 | + |
| 71 | +This represents a device with two IIO inputs, named "vcc" and "vdd". |
| 72 | +The vcc channel is connected to output 1 of the &adc device, and the |
| 73 | +vdd channel is connected to output 0 of the &ref device. |
| 74 | + |
| 75 | +==Example== |
| 76 | + |
| 77 | + adc: max1139@35 { |
| 78 | + compatible = "maxim,max1139"; |
| 79 | + reg = <0x35>; |
| 80 | + #io-channel-cells = <1>; |
| 81 | + }; |
| 82 | + |
| 83 | + ... |
| 84 | + |
| 85 | + iio_hwmon { |
| 86 | + compatible = "iio-hwmon"; |
| 87 | + io-channels = <&adc 0>, <&adc 1>, <&adc 2>, |
| 88 | + <&adc 3>, <&adc 4>, <&adc 5>, |
| 89 | + <&adc 6>, <&adc 7>, <&adc 8>, |
| 90 | + <&adc 9>; |
| 91 | + }; |
| 92 | + |
| 93 | + some_consumer { |
| 94 | + compatible = "some-consumer"; |
| 95 | + io-channels = <&adc 10>, <&adc 11>; |
| 96 | + io-channel-names = "adc1", "adc2"; |
| 97 | + }; |
0 commit comments