Wiki

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
resources:tools-software:linux-drivers:iio-adc:ad7606 [27 Apr 2016 17:10] – fix typo Lars-Peter Clausenresources:tools-software:linux-drivers:iio-adc:ad7606 [30 Sep 2019 09:03] (current) – Add 7616 to the list Beniamin Bia
Line 3: Line 3:
 ===== Supported Devices ===== ===== Supported Devices =====
  
 +  * [[adi>AD7605-4]]
   * [[adi>AD7606]]   * [[adi>AD7606]]
   * [[adi>AD7606-6]]   * [[adi>AD7606-6]]
   * [[adi>AD7606-4]]   * [[adi>AD7606-4]]
 +  * [[adi>AD7606B]]
 +  * [[adi>AD7616]]
  
 ===== Reference Circuits ===== ===== Reference Circuits =====
Line 13: Line 16:
 ===== Evaluation Boards ===== ===== Evaluation Boards =====
  
 +  * [[adi>EVAL-AD7605-4]]
   * [[adi>EVAL-AD7606EDZ]]   * [[adi>EVAL-AD7606EDZ]]
   * [[adi>EVAL-AD7606-4EDZ]]   * [[adi>EVAL-AD7606-4EDZ]]
   * [[adi>EVAL-AD7606-6EDZ]]   * [[adi>EVAL-AD7606-6EDZ]]
 +  * [[adi>EVAL-AD7606BFMCZ]]
 +  * [[adi>EVAL-AD7616]]
 ===== Description ===== ===== Description =====
  
Line 27: Line 33:
  
 ^ Source ^ Mainlined? ^ ^ Source ^ Mainlined? ^
-| [[git.linux.org>drivers/staging/iio/adc/ad7606_core.c|git]] | [[git.linux.org>drivers/staging/iio/adc/ad7606_core.c|Yes]] |+| [[git.linux.org>drivers/iio/adc/ad7606.c|git]] | [[git.linux.org>drivers/iio/adc/ad7606.c|Yes]] |
 ===== Files ===== ===== Files =====
  
 ^ Function ^ File ^ ^ Function ^ File ^
-| driver  | [[git.linux.org>drivers/staging/iio/adc/ad7606_core.c]] | +| driver  | [[git.linux.org>drivers/iio/adc/ad7606.c]] | 
-| driver  | [[git.linux.org>drivers/staging/iio/adc/ad7606_ring.c]] | +| driver  | [[git.linux.org>drivers/iio/adc/ad7606_spi.c]] | 
-| driver  | [[git.linux.org>drivers/staging/iio/adc/ad7606_spi.c]] | +| driver  | [[git.linux.org>drivers/iio/adc/ad7606_par.c]] | 
-driver  | [[git.linux.org>drivers/staging/iio/adc/ad7606_par.c]] | +include | [[git.linux.org>drivers/iio/adc/ad7606.h]] | 
-include | [[git.linux.org>drivers/staging/iio/adc/ad7606.h]] |+documentation| [[git.linux.org>Documentation/devicetree/bindings/iio/adc/adi,ad7606.yaml]] |
  
 ====== Example platform device initialization ====== ====== Example platform device initialization ======
  
 {{page>software/linux/docs/platform_and_bus_model#Platform Data&noheader&firstseconly&noeditbtn}} {{page>software/linux/docs/platform_and_bus_model#Platform Data&noheader&firstseconly&noeditbtn}}
- 
-The reference voltage may vary between boards and models. The platform_data for the device's "struct device" holds this information. 
- 
-<code c> 
-/** 
- * struct ad7606_platform_data - platform/board specifc information 
- * @default_os: default oversampling value {0, 2, 4, 8, 16, 32, 64} 
- * @default_range: default range +/-{5000, 10000} mVolt 
- * @gpio_convst: number of gpio connected to the CONVST pin 
- * @gpio_reset: gpio connected to the RESET pin, if not used set to -1 
- * @gpio_range: gpio connected to the RANGE pin, if not used set to -1 
- * @gpio_os0: gpio connected to the OS0 pin, if not used set to -1 
- * @gpio_os1: gpio connected to the OS1 pin, if not used set to -1 
- * @gpio_os2: gpio connected to the OS2 pin, if not used set to -1 
- * @gpio_frstdata: gpio connected to the FRSTDAT pin, if not used set to -1 
- * @gpio_stby: gpio connected to the STBY pin, if not used set to -1 
- */ 
-</code> 
- 
-<source trunk/drivers/staging/iio/adc/ad7606.h:ad7606_platform_data{} c linux-kernel> 
- 
-<code c> 
-static struct ad7606_platform_data ad7606_pdata = { 
- .default_os = 0, 
- .default_range = 10000, 
- .gpio_convst = GPIO_PF9, 
- .gpio_reset = GPIO_PF10, 
- .gpio_range = GPIO_PH0, 
- .gpio_os0 = GPIO_PH1, 
- .gpio_os1 = GPIO_PH2, 
- .gpio_os2 = GPIO_PH3, 
- .gpio_frstdata = -1, 
- .gpio_stby = GPIO_PF12, 
-}; 
-</code> 
- 
 ====== Example platform_device initialization / parallel interface ====== ====== Example platform_device initialization / parallel interface ======
  
Line 81: Line 51:
  
 ^ ADI part number ^ platform_device name ^ ^ ADI part number ^ platform_device name ^
 +| AD7605-4 | ad7605-4 |
 | AD7606 | ad7606-8 | | AD7606 | ad7606-8 |
 | AD7606-6 | ad7606-6 | | AD7606-6 | ad7606-6 |
 | AD7606-4 | ad7606-4 | | AD7606-4 | ad7606-4 |
 +| AD7606B | ad7606b |
 +| AD7616 | ad7616 |
  
 <code c> <code c>
Line 143: Line 116:
  
 ^ ADI part number ^ spi_board_info modalias ^ ^ ADI part number ^ spi_board_info modalias ^
 +| AD7605-4 | ad7605-4 |
 | AD7606 | ad7606-8 | | AD7606 | ad7606-8 |
 | AD7606-6 | ad7606-6 | | AD7606-6 | ad7606-6 |
Line 157: Line 131:
  .bus_num = 0, /* Framework bus number */  .bus_num = 0, /* Framework bus number */
  .chip_select = 3, /* Framework chip select */  .chip_select = 3, /* Framework chip select */
- .platform_data = &ad7606_pdata, 
  .controller_data = &ad7606_chip_info, /* Blackfin only */  .controller_data = &ad7606_chip_info, /* Blackfin only */
  .irq = IRQ_PH6,  .irq = IRQ_PH6,
Line 188: Line 161:
 Linux Kernel Configuration Linux Kernel Configuration
  Device Drivers  --->  Device Drivers  --->
- [*] Staging drivers  ---> + <*>     Industrial I/O support ---> 
- <*>     Industrial I/O support ---> + --- Industrial I/O support
-     --- Industrial I/O support +
-     -*-   Enable ring buffer support within IIO +
-     -*-     Industrial I/O lock free software ring +
-     -*-   Enable triggered sampling support +
            *** Analog to digital converters ***            *** Analog to digital converters ***
      [--snip--]      [--snip--]
  
- <*>   Analog Devices AD7606 ADC driver + <*>     Analog Devices AD7606 ADC driver with parallel interface support 
- <*>     parallel interface support + <*>     Analog Devices AD7606 ADC driver with spi interface support
- <*>     spi interface support+
  
      [--snip--]      [--snip--]
  
 </code> </code>
 +
 +===== Devicetree =====
 +
 +Analog Devices AD7606 Simultaneous Sampling ADC
 +
 +Required properties for the AD7606:
 +
 +- compatible: Must be one of
 + * "adi,ad7605-4"
 + * "adi,ad7606-8"
 + * "adi,ad7606-6"
 + * "adi,ad7606-4"
 + * "adi,ad7606b"
 + * "adi,ad7616"
 +- reg: SPI chip select number for the device
 +- spi-max-frequency: Max SPI frequency to use.
 +        see: Documentation/devicetree/bindings/spi/spi-bus.txt
 +- spi-cpha: See Documentation/devicetree/bindings/spi/spi-bus.txt
 +- avcc-supply: phandle to the Avcc power supply
 +- interrupts: IRQ line for the ADC
 +        see: Documentation/devicetree/bindings/interrupt-controller/interrupts.txt
 +- adi,conversion-start-gpios: must be the device tree identifier of the CONVST pin. This logic input is used to initiate conversions on the analog input channels. As the line is active high, it should be marked GPIO_ACTIVE_HIGH.
 +
 +Optional properties:
 +
 +- reset-gpios: must be the device tree identifier of the RESET pin. If specified, it will be asserted during driver probe. As the line is active high, it should be marked GPIO_ACTIVE_HIGH.
 +
 +- standby-gpios: must be the device tree identifier of the STBY pin. This pin is used to place the AD7606 into one of two power-down modes, Standby mode or Shutdown mode. As the line is active low, it should be marked GPIO_ACTIVE_LOW.
 +
 +- adi,first-data-gpios: must be the device tree identifier of the FRSTDATA pin. The FRSTDATA output indicates when the first channel, V1, is being read back on either the parallel, byte or serial interface. As the line is active high, it should be marked GPIO_ACTIVE_HIGH.
 +
 +- adi,range-gpios: must be the device tree identifier of the RANGE pin. The polarity on this pin determines the input range of the analog input channels. If this pin is tied to a logic high, the analog input range is ±10V for all channels. If this pin is tied to a logic low, the analog input range is ±5V for all channels. As the line is active high, it should be marked GPIO_ACTIVE_HIGH.
 +
 +- adi,oversampling-ratio-gpios: must be the device tree identifier of the over-sampling mode pins. As the line is active high, it should be marked GPIO_ACTIVE_HIGH.
 +
 +- adi,sw-mode: Boolean, software mode of operation, so far available only for ad7606b. Software mode is enabled when all three oversampling mode pins are connected to high level. The AD7606B is configured by the corresponding registers. If the adi,oversampling-ratio-gpios property is defined, then the driver will set the oversampling gpios to high. Otherwise, it is assumed that the pins are hardwired to VDD.
 +
 +Example:
 +
 + adc@0 {
 + compatible = "adi,ad7606-8";
 + reg = <0>;
 + spi-max-frequency = <1000000>;
 + spi-cpol;
 + avcc-supply = <&adc_vref>;
 + interrupts = <25 IRQ_TYPE_EDGE_FALLING>;
 + interrupt-parent = <&gpio>;
 + adi,conversion-start-gpios = <&gpio 17 GPIO_ACTIVE_HIGH>;
 + reset-gpios = <&gpio 27 GPIO_ACTIVE_HIGH>;
 + adi,first-data-gpios = <&gpio 22 GPIO_ACTIVE_HIGH>;
 + adi,oversampling-ratio-gpios = <&gpio 18 GPIO_ACTIVE_HIGH
 + &gpio 23 GPIO_ACTIVE_HIGH
 + &gpio 26 GPIO_ACTIVE_HIGH>;
 + standby-gpios = <&gpio 24 GPIO_ACTIVE_LOW>;
 + adi,sw-mode;
 + };
  
 ====== Hardware configuration ====== ====== Hardware configuration ======
resources/tools-software/linux-drivers/iio-adc/ad7606.1461769810.txt.gz · Last modified: 27 Apr 2016 17:10 by Lars-Peter Clausen