iio-bindings.txt 2.6 KB

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