ad5592r.txt 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. Analog Devices AD5592R/AD5593R DAC/ADC device driver
  2. Required properties for the AD5592R:
  3. - compatible: Must be "adi,ad5592r"
  4. - reg: SPI chip select number for the device
  5. - spi-max-frequency: Max SPI frequency to use (< 30000000)
  6. - spi-cpol: The AD5592R requires inverse clock polarity (CPOL) mode
  7. Required properties for the AD5593R:
  8. - compatible: Must be "adi,ad5593r"
  9. - reg: I2C address of the device
  10. Required properties for all supported chips:
  11. - #address-cells: Should be 1.
  12. - #size-cells: Should be 0.
  13. - channel nodes:
  14. Each child node represents one channel and has the following
  15. Required properties:
  16. * reg: Pin on which this channel is connected to.
  17. * adi,mode: Mode or function of this channel.
  18. Macros specifying the valid values
  19. can be found in <dt-bindings/iio/adi,ad5592r.h>.
  20. The following values are currently supported:
  21. * CH_MODE_UNUSED (the pin is unused)
  22. * CH_MODE_ADC (the pin is ADC input)
  23. * CH_MODE_DAC (the pin is DAC output)
  24. * CH_MODE_DAC_AND_ADC (the pin is DAC output
  25. but can be monitored by an ADC, since
  26. there is no disadvantage this
  27. this should be considered as the
  28. preferred DAC mode)
  29. * CH_MODE_GPIO (the pin is registered
  30. with GPIOLIB)
  31. Optional properties:
  32. * adi,off-state: State of this channel when unused or the
  33. device gets removed. Macros specifying the
  34. valid values can be found in
  35. <dt-bindings/iio/adi,ad5592r.h>.
  36. * CH_OFFSTATE_PULLDOWN (the pin is pulled down)
  37. * CH_OFFSTATE_OUT_LOW (the pin is output low)
  38. * CH_OFFSTATE_OUT_HIGH (the pin is output high)
  39. * CH_OFFSTATE_OUT_TRISTATE (the pin is
  40. tristated output)
  41. Optional properties:
  42. - vref-supply: Phandle to the external reference voltage supply. This should
  43. only be set if there is an external reference voltage connected to the VREF
  44. pin. If the property is not set the internal 2.5V reference is used.
  45. - reset-gpios : GPIO spec for the RESET pin. If specified, it will be
  46. asserted during driver probe.
  47. - gpio-controller: Marks the device node as a GPIO controller.
  48. - #gpio-cells: Should be 2. The first cell is the GPIO number and the second
  49. cell specifies GPIO flags, as defined in <dt-bindings/gpio/gpio.h>.
  50. AD5592R Example:
  51. #include <dt-bindings/iio/adi,ad5592r.h>
  52. vref: regulator-vref {
  53. compatible = "regulator-fixed";
  54. regulator-name = "vref-ad559x";
  55. regulator-min-microvolt = <3300000>;
  56. regulator-max-microvolt = <3300000>;
  57. regulator-always-on;
  58. };
  59. ad5592r@0 {
  60. #size-cells = <0>;
  61. #address-cells = <1>;
  62. #gpio-cells = <2>;
  63. compatible = "adi,ad5592r";
  64. reg = <0>;
  65. spi-max-frequency = <1000000>;
  66. spi-cpol;
  67. vref-supply = <&vref>; /* optional */
  68. reset-gpios = <&gpio0 86 0>; /* optional */
  69. gpio-controller;
  70. channel@0 {
  71. reg = <0>;
  72. adi,mode = <CH_MODE_DAC>;
  73. };
  74. channel@1 {
  75. reg = <1>;
  76. adi,mode = <CH_MODE_ADC>;
  77. };
  78. channel@2 {
  79. reg = <2>;
  80. adi,mode = <CH_MODE_DAC_AND_ADC>;
  81. };
  82. channel@3 {
  83. reg = <3>;
  84. adi,mode = <CH_MODE_DAC_AND_ADC>;
  85. adi,off-state = <CH_OFFSTATE_PULLDOWN>;
  86. };
  87. channel@4 {
  88. reg = <4>;
  89. adi,mode = <CH_MODE_UNUSED>;
  90. adi,off-state = <CH_OFFSTATE_PULLDOWN>;
  91. };
  92. channel@5 {
  93. reg = <5>;
  94. adi,mode = <CH_MODE_GPIO>;
  95. adi,off-state = <CH_OFFSTATE_PULLDOWN>;
  96. };
  97. channel@6 {
  98. reg = <6>;
  99. adi,mode = <CH_MODE_GPIO>;
  100. adi,off-state = <CH_OFFSTATE_PULLDOWN>;
  101. };
  102. channel@7 {
  103. reg = <7>;
  104. adi,mode = <CH_MODE_GPIO>;
  105. adi,off-state = <CH_OFFSTATE_PULLDOWN>;
  106. };
  107. };
  108. AD5593R Example:
  109. #include <dt-bindings/iio/adi,ad5592r.h>
  110. ad5593r@10 {
  111. #size-cells = <0>;
  112. #address-cells = <1>;
  113. #gpio-cells = <2>;
  114. compatible = "adi,ad5593r";
  115. reg = <0x10>;
  116. gpio-controller;
  117. channel@0 {
  118. reg = <0>;
  119. adi,mode = <CH_MODE_DAC>;
  120. adi,off-state = <CH_OFFSTATE_PULLDOWN>;
  121. };
  122. channel@1 {
  123. reg = <1>;
  124. adi,mode = <CH_MODE_ADC>;
  125. adi,off-state = <CH_OFFSTATE_PULLDOWN>;
  126. };
  127. channel@2 {
  128. reg = <2>;
  129. adi,mode = <CH_MODE_DAC_AND_ADC>;
  130. adi,off-state = <CH_OFFSTATE_PULLDOWN>;
  131. };
  132. channel@6 {
  133. reg = <6>;
  134. adi,mode = <CH_MODE_GPIO>;
  135. adi,off-state = <CH_OFFSTATE_PULLDOWN>;
  136. };
  137. };