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:ad7192 [08 Feb 2019 14:24] – [Example platform device initialization] Mircea Caprioruresources:tools-software:linux-drivers:iio-adc:ad7192 [08 Feb 2019 14:51] (current) – [Device tree support] Mircea Caprioru
Line 131: Line 131:
 } }
 arch_initcall(board_init); arch_initcall(board_init);
-</code> 
- 
-====== Adding Linux driver support ====== 
- 
-Configure kernel with "make menuconfig" (alternatively use "make xconfig" or 
-"make qconfig") 
- 
-<WRAP round help> 
-The AD7192 Driver depends on **CONFIG_SPI** 
-</WRAP> 
- 
-<code> 
-Linux Kernel Configuration 
- Device Drivers  ---> 
- [*] Staging drivers  ---> 
- <*>     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 *** 
-     [--snip--] 
- 
-     <*>   Analog Devices AD7190 AD7192 AD7195 ADC driver 
- 
-     [--snip--] 
- 
 </code> </code>
  
Line 169: Line 141:
  
 / { / {
- compatible = "brcm,bcm2835", "brcm,bcm2708", "brcm,bcm2709"; 
  
  fragment@0 {  fragment@0 {
  target-path = "/";  target-path = "/";
- __overlay__ { + dvdd: fixedregulator@0 { 
- dvdd: fixedregulator@0 { + compatible = "regulator-fixed"; 
- compatible = "regulator-fixed"; + regulator-name = "fixed-supply"; 
- regulator-name = "fixed-supply"; + regulator-min-microvolt = <3300000>; 
- regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; 
- regulator-max-microvolt = <3300000>; + regulator-boot-on;
- regulator-boot-on+
- };+
  };  };
  };  };
Line 186: Line 155:
  fragment@1 {  fragment@1 {
  target-path = "/";  target-path = "/";
- __overlay__ { + avdd: fixedregulator@1 { 
- avdd: fixedregulator@1 { + compatible = "regulator-fixed"; 
- compatible = "regulator-fixed"; + regulator-name = "fixed-supply2"; 
- regulator-name = "fixed-supply2"; + regulator-min-microvolt = <3300000>; 
- regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; 
- regulator-max-microvolt = <3300000>; + regulator-boot-on;
- regulator-boot-on+
- };+
  };  };
  };  };
Line 199: Line 166:
  fragment@3 {  fragment@3 {
  target = <&spi0>;  target = <&spi0>;
- __overlay__ { 
  #address-cells = <1>;  #address-cells = <1>;
  #size-cells = <0>;  #size-cells = <0>;
  status = "okay";  status = "okay";
  
- ad7190@0 { + ad7190@0 { 
- compatible = "adi,ad7190"; + compatible = "adi,ad7190"; 
- reg = <0>; + reg = <0>; 
- spi-max-frequency = <1000000>; + spi-max-frequency = <1000000>; 
- spi-cpol; + spi-cpol; 
- spi-cpha; + spi-cpha; 
- #interrupt-cells = <2>; + #interrupt-cells = <2>; 
- interrupts = <25 0x2>; + interrupts = <25 0x2>; 
- interrupt-parent = <&gpio>; + interrupt-parent = <&gpio>; 
- dvdd-supply = <&dvdd>; + dvdd-supply = <&dvdd>; 
- avdd-supply = <&avdd>;+ avdd-supply = <&avdd>;
  
- adi,reference-voltage-mv = /bits/ 16  <3300>; + adi,reference-voltage-mv = /bits/ 16  <3300>; 
- adi,clock-source-select = [02]; + adi,clock-source-select = [02]; 
- adi,refin2-pins-enable; + adi,refin2-pins-enable; 
- adi,rejection-60-Hz-enable; + adi,rejection-60-Hz-enable; 
- adi,chop-enable; + adi,chop-enable; 
- adi,buffer-enable; + adi,buffer-enable; 
- adi,burnout-currents-enable; + adi,burnout-currents-enable; 
- adi,sinc3-filter-enable; + adi,sinc3-filter-enable; 
- adi,unipolar-enable+ adi,unipolar-enable;
- };+
  };  };
  };  };
 }; };
 </code> </code>
 +
 +<note important> Interrupt pin connection - interrupts = <25 0x2>; this line means that gpio pin 25 is used for the interrupt and it must be connect to the DOUT/RDY pin of AD7192 along with the SPI MISO.  
 + </note>
 +====== Adding Linux driver support ======
 +
 +Configure kernel with "make menuconfig" (alternatively use "make xconfig" or
 +"make qconfig")
 +
 +<WRAP round help>
 +The AD7192 Driver depends on **CONFIG_SPI**
 +</WRAP>
 +
 +<code>
 +Linux Kernel Configuration
 + Device Drivers  --->
 + [*] Staging drivers  --->
 + <*>     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 ***
 +     [--snip--]
 +
 +     <*>   Analog Devices AD7190 AD7192 AD7195 ADC driver
 +
 +     [--snip--]
 +
 +</code>
 +
  
 ====== Hardware configuration ====== ====== Hardware configuration ======
resources/tools-software/linux-drivers/iio-adc/ad7192.1549632283.txt.gz · Last modified: 08 Feb 2019 14:24 by Mircea Caprioru