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:ad7476a [03 Jan 2013 20:42] – external edit resources:tools-software:linux-drivers:iio-adc:ad7476a [11 Sep 2021 20:17] (current) – [Supported Devices] Robin Getz
Line 3: Line 3:
 ===== Supported Devices ===== ===== Supported Devices =====
  
 +
 +  * [[adi>AD7091R]]
   * [[adi>AD7273]]   * [[adi>AD7273]]
   * [[adi>AD7274]]   * [[adi>AD7274]]
Line 41: Line 43:
   * [[adi>AD7988-1]]   * [[adi>AD7988-1]]
   * [[adi>AD7988-5]]   * [[adi>AD7988-5]]
 +  * [[adi>LTC2314-14]]
  
 ===== Reference Circuits ===== ===== Reference Circuits =====
  
-  * [[adi>CN0008]] 
-  * [[adi>CN0012]] 
-  * [[adi>CN0013]] 
-  * [[adi>CN0015]] 
-  * [[adi>CN0030]] 
-  * [[adi>CN0032]] 
-  * [[adi>CN0033]] 
   * [[adi>CN0104]]   * [[adi>CN0104]]
   * [[adi>CN0130]]   * [[adi>CN0130]]
-  * [[adi>CN0165]] 
   * [[adi>CN0178]]   * [[adi>CN0178]]
   * [[adi>CN0180]]   * [[adi>CN0180]]
Line 61: Line 56:
   * [[adi>CN0237]]   * [[adi>CN0237]]
   * [[adi>CN0241]]   * [[adi>CN0241]]
 +  * [[adi>CN0247]]
   * [[adi>CN0255]]   * [[adi>CN0255]]
   * [[adi>CN0260]]   * [[adi>CN0260]]
   * [[adi>CN0261]]   * [[adi>CN0261]]
   * [[adi>CN0269]]   * [[adi>CN0269]]
-  * [[adi>CN0293]] 
   * [[adi>CN0305]]   * [[adi>CN0305]]
   * [[adi>CN0306]]   * [[adi>CN0306]]
 +  * [[adi>CN0335]] 
 +  * [[adi>CN0336]] 
 +  * [[adi>CN0337]] 
 +  * [[adi>CN0350]] 
 +  * [[adi>CN0366]]
 ===== Evaluation Boards ===== ===== Evaluation Boards =====
  
 +  * [[adi>EVAL-AD7091RSDZ]]
   * [[adi>EVAL-AD7276SDZ]]   * [[adi>EVAL-AD7276SDZ]]
-  * [[adi>EVAL-AD7466CBZ]] +  * [[adi>EVAL-AD7466]] 
-  * [[adi>EVAL-AD7476ACBZ]] +  * [[adi>EVAL-AD7476A]] 
-  * [[adi>EVAL-AD7476ACBZ]] +  * [[adi>EVAL-AD7477]]
-  * [[adi>EVAL-AD7477CBZ]]+
   * [[adi>EVAL-AD7910]]   * [[adi>EVAL-AD7910]]
   * [[adi>EVAL-AD7920]]   * [[adi>EVAL-AD7920]]
-  * [[adi>EVAL-AD7940]]+  * [[adi>EVAL-AD7942]]
   * [[adi>EVAL-AD7683SDZ]]   * [[adi>EVAL-AD7683SDZ]]
   * [[adi>EVAL-AD7684SDZ]]   * [[adi>EVAL-AD7684SDZ]]
Line 106: Line 105:
 ===== Status ===== ===== Status =====
  
- Source   Mainlined?  +^ Source ^ Mainlined? ^ 
-| [[git.linux.org>drivers/staging/iio/adc/ad7476_core.c|git]] |  [[git.linux.org>drivers/staging/iio/adc/ad7476_core.c|Yes]]  |+| [[git.linux.org>drivers/iio/adc/ad7476.c|git]] | [[git.linux.org>drivers/iio/adc/ad7476.c|Yes]] | 
 ===== Files ===== ===== Files =====
  
 ^ Function ^ File ^ ^ Function ^ File ^
-| driver  | [[git.linux.org>drivers/staging/iio/adc/ad7476_core.c]] | +| driver  | [[git.linux.org>drivers/iio/adc/ad7476.c]] |
-| driver  | [[git.linux.org>drivers/staging/iio/adc/ad7476_ring.c]] | +
-| include | [[git.linux.org>drivers/staging/iio/adc/ad7476.h]] |+
  
 ====== Example platform device initialization ====== ====== Example platform device initialization ======
Line 212: Line 210:
 </code> </code>
  
 +===== Devicetree =====
 +
 +Required devicetree properties:
 +  * compatible: Needs to be "adi," followed by the name of the device. E.g. "adi,ad7476a"
 +  * reg: The chipselect number used for the device
 +  * spi-max-frequency: Maximum SPI clock frequency.
 +  * spi-cpha: Needs to be set for the correct SPI mode
 +  * spi-cpol: Needs to be set for the correct SPI mode
 +  * vcc-supply: Phandle to the supply regulator
 +
 +<code>
 +       adc_supply: fixedregulator {
 +               compatible = "regulator-fixed";
 +               regulator-name = "fixed-supply";
 +               regulator-min-microvolt = <3300000>;
 +               regulator-max-microvolt = <3300000>;
 +       };
 +
 +       spi: spi@e0007000 {
 +               #address-cells = <1>;
 +               #size-cells = <0>;
 +               compatible = "xlnx,ps7-spi-1.00.a";
 +               ...
 +
 +               ad7476@0 {
 +                       compatible = "adi,ad7476a";
 +                       reg = <0>;
 +                       spi-max-frequency = <1000000>;
 +                       spi-cpha;
 +                       spi-cpol;
 +                       vcc-supply = <&adc_supply>;
 +               };
 +        };
 +</code>
 ====== Adding Linux driver support ====== ====== Adding Linux driver support ======
  
Line 223: Line 255:
 <code> <code>
 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 +            Analog to digital converters  --- 
-     -*-   Enable triggered sampling support +                ... 
- +                <*>  Analog Devices AD7476 and similar 1-channel ADCs driver 
-           *** Analog to digital converters *** +                ... 
-     [--snip--] +            ... 
- +        ...
-     <*>   Analog Devices AD7475/6/7/8 AD7466/7/and AD7495 ADC driver +
- +
-     [--snip--] +
 </code> </code>
  
Line 257: Line 285:
  
 root:/sys/devices/platform/bfin-spi.0/spi0.3/device0> **ls -l** root:/sys/devices/platform/bfin-spi.0/spi0.3/device0> **ls -l**
-drwxr-xr-x    5 root     root             0 Jan  1 00:00 device0:buffer0 +drwxr-xr-x    5 root     root             0 Jan  1 00:00 buffer 
--r--r--r--    1 root     root          4096 Jan  1 00:00 in0_raw +-r--r--r--    1 root     root          4096 Jan  1 00:00 in_voltage0_raw 
--r--r--r--    1 root     root          4096 Jan  1 00:00 in_scale+-r--r--r--    1 root     root          4096 Jan  1 00:00 in_voltage_scale
 -r--r--r--    1 root     root          4096 Jan  1 00:00 name -r--r--r--    1 root     root          4096 Jan  1 00:00 name
 lrwxrwxrwx    1 root     root             0 Jan  1 00:00 subsystem -> ../../../../../bus/iio lrwxrwxrwx    1 root     root             0 Jan  1 00:00 subsystem -> ../../../../../bus/iio
Line 265: Line 293:
 -rw-r--r--    1 root     root          4096 Jan  1 00:00 uevent -rw-r--r--    1 root     root          4096 Jan  1 00:00 uevent
 </xterm></WRAP> </xterm></WRAP>
- 
  
 === Show device name === === Show device name ===
Line 280: Line 307:
  
 **Description:**\\ **Description:**\\
-scale to be applied to in0_raw in order to obtain the measured voltage in millivolts.+scale to be applied to in_voltage0_raw in order to obtain the measured voltage in millivolts.
  
 <WRAP box bggreen><wrap info>This specifies any shell prompt running on the target</wrap> <WRAP box bggreen><wrap info>This specifies any shell prompt running on the target</wrap>
 <xterm> <xterm>
-root:/sys/devices/platform/bfin-spi.0/spi0.3/device0> **cat in_scale**+root:/sys/devices/platform/bfin-spi.0/spi0.3/device0> **cat in_voltage_scale**
 0.805 0.805
 </xterm></WRAP> </xterm></WRAP>
Line 295: Line 322:
 <WRAP box bggreen><wrap info>This specifies any shell prompt running on the target</wrap> <WRAP box bggreen><wrap info>This specifies any shell prompt running on the target</wrap>
 <xterm> <xterm>
-root:/sys/devices/platform/bfin-spi.0/spi0.3/device0> **cat in0_raw**+root:/sys/devices/platform/bfin-spi.0/spi0.3/device0> **cat in_voltage0_raw**
 2001 2001
 </xterm></WRAP> </xterm></WRAP>
  
-**U** = //in0_raw in_scale// = 2001 * 0.805 = **1610,805 //mV//**+**U** = //in_voltage0_raw in_voltage_scale// = 2001 * 0.805 = **1610,805 //mV//**
  
 ===== Trigger management ===== ===== Trigger management =====
resources/tools-software/linux-drivers/iio-adc/ad7476a.1357242154.txt.gz · Last modified: 10 Jan 2013 13:19 (external edit)