Path: blob/main/sys/contrib/device-tree/Bindings/iio/iio-bindings.txt
48375 views
This binding is derived from clock bindings, and based on suggestions1from Lars-Peter Clausen [1].23Sources of IIO channels can be represented by any node in the device4tree. Those nodes are designated as IIO providers. IIO consumer5nodes use a phandle and IIO specifier pair to connect IIO provider6outputs to IIO inputs. Similar to the gpio specifiers, an IIO7specifier is an array of one or more cells identifying the IIO8output on a device. The length of an IIO specifier is defined by the9value of a #io-channel-cells property in the IIO provider node.1011[1] https://marc.info/?l=linux-iio&m=135902119507483&w=21213==IIO providers==1415Required properties:16#io-channel-cells: Number of cells in an IIO specifier; Typically 0 for nodes17with a single IIO output and 1 for nodes with multiple18IIO outputs.1920Optional properties:21label: A symbolic name for the device.222324Example for a simple configuration with no trigger:2526adc: voltage-sensor@35 {27compatible = "maxim,max1139";28reg = <0x35>;29#io-channel-cells = <1>;30label = "voltage_feedback_group1";31};3233Example for a configuration with trigger:3435adc@35 {36compatible = "some-vendor,some-adc";37reg = <0x35>;3839adc1: iio-device@0 {40#io-channel-cells = <1>;41/* other properties */42};43adc2: iio-device@1 {44#io-channel-cells = <1>;45/* other properties */46};47};4849==IIO consumers==5051Required properties:52io-channels: List of phandle and IIO specifier pairs, one pair53for each IIO input to the device. Note: if the54IIO provider specifies '0' for #io-channel-cells,55then only the phandle portion of the pair will appear.5657Optional properties:58io-channel-names:59List of IIO input name strings sorted in the same60order as the io-channels property. Consumers drivers61will use io-channel-names to match IIO input names62with IIO specifiers.63io-channel-ranges:64Empty property indicating that child nodes can inherit named65IIO channels from this node. Useful for bus nodes to provide66and IIO channel to their children.6768For example:6970device {71io-channels = <&adc 1>, <&ref 0>;72io-channel-names = "vcc", "vdd";73};7475This represents a device with two IIO inputs, named "vcc" and "vdd".76The vcc channel is connected to output 1 of the &adc device, and the77vdd channel is connected to output 0 of the &ref device.7879==Example==8081adc: max1139@35 {82compatible = "maxim,max1139";83reg = <0x35>;84#io-channel-cells = <1>;85};8687...8889iio-hwmon {90compatible = "iio-hwmon";91io-channels = <&adc 0>, <&adc 1>, <&adc 2>,92<&adc 3>, <&adc 4>, <&adc 5>,93<&adc 6>, <&adc 7>, <&adc 8>,94<&adc 9>;95};9697some_consumer {98compatible = "some-consumer";99io-channels = <&adc 10>, <&adc 11>;100io-channel-names = "adc1", "adc2";101};102103104