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
Last revisionBoth sides next revision
resources:tools-software:linux-drivers:input-misc:adxl345 [16 Jan 2013 16:09] – [Example platform device initialization] Michael Hennerichresources:tools-software:linux-drivers:input-misc:adxl345 [07 Sep 2018 08:36] – [Evaluation Boards] add adx375 eval board Alexandru Ardelean
Line 5: Line 5:
   * [[adi>ADXL345]]   * [[adi>ADXL345]]
   * [[adi>ADXL346]]   * [[adi>ADXL346]]
 +  * [[adi>ADXL375]]
  
  
Line 13: Line 14:
 ===== Evaluation Boards ===== ===== Evaluation Boards =====
  
-  * [[adi>EVAL-ADXL345Z]]  +  * [[adi>EVAL-ADXL313-Z-M]] 
-  * [[adi>EVAL-ADXL346Z]] +  * [[adi>EVAL-ADXL345Z-DB]] 
 +  * [[adi>EVAL-ADXL346Z-DB]] 
 +  * [[adi>EVAL-ADXL375]]
  
 ===== Description ===== ===== Description =====
Line 96: Line 99:
 ===== Status ===== ===== Status =====
  
- Source   Mainlined?  +^ Source ^ Mainlined? ^ 
-| [[git.linux.org>drivers/input/misc/adxl34x.c|git]] |  [[git.linux.org>drivers/input/misc/adxl34x.c|Yes]]  |+| [[git.linux.org>drivers/input/misc/adxl34x.c|git]] | [[git.linux.org>drivers/input/misc/adxl34x.c|Yes]] |
  
  
Line 627: Line 630:
 </code> </code>
  
 +===== Devicetree =====
 +
 +Required devicetree properties:
 +  * compatible: Needs to be "adi," followed by the name of the device. E.g. "adi,adxl34x"
 +  * 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
 +  * interrupt-parent: Specifies which IRQ controller is used
 +  * interrupts: The interrupt associated with the INT2 pin
 +
 +<code>
 +       axi_spi_1: spi@42040000 {
 +               #address-cells = <1>;
 +               #size-cells = <0>;
 +               compatible = "xlnx,axi-spi-1.02.a", "xlnx,xps-spi-2.00.a";
 +               ...
 +               
 +               adxl345@0 {
 +                       compatible = "adi,adxl34x";
 +                       reg = <0>;
 +                       spi-max-frequency = <1000000>;
 +                       spi-cpha;
 +                       spi-cpol;
 +                       interrupt-parent = <&gic>;
 +                       interrupts = < 0 32 4 >;
 +               };
 +        };
 +</code>
  
 ===== Example Platform / Board file (I2C Interface Option) ===== ===== Example Platform / Board file (I2C Interface Option) =====
Line 659: Line 691:
 arch_initcall(board_init); arch_initcall(board_init);
 </code> </code>
 +
 +===== Devicetree =====
 +
 +Required devicetree properties:
 +  * compatible: Needs to be "adi," followed by the name of the device. E.g. "adi,adxl34x"
 +  * reg: The slave address of the device
 +  * interrupt-parent: Specifies which IRQ controller is used
 +  * interrupts: The interrupt associated with the INT2 pin
 +
 +<code>
 +       axi_iic_1: i2c@41640000 {
 +               #address-cells = <1>;
 +               #size-cells = <0>;
 +               compatible = "xlnx,axi-iic-1.02.a", "xlnx,xps-iic-2.00.a";
 +               ...
 +               
 +               adxl345@0 {
 +                       compatible = "adi,adxl34x";
 +                       reg = <0x53>;
 +                       interrupt-parent = <&gic>;
 +                       interrupts = < 0 32 4 >;
 +               };
 +        };
 +</code>
 +
 ====== Adding Linux driver support ====== ====== Adding Linux driver support ======
  
Line 765: Line 822:
 </xterm> </xterm>
  
-===== Use the event_test utility to test proper function =====+===== Use the evtest utility to test proper function =====
  
 <code> <code>
-root:/> event_test /dev/input/event1+root:/> evtest /dev/input/event1
 Input driver version is 1.0.0 Input driver version is 1.0.0
 Input device ID: bus 0x18 vendor 0x0 product 0x159 version 0x0 Input device ID: bus 0x18 vendor 0x0 product 0x159 version 0x0
resources/tools-software/linux-drivers/input-misc/adxl345.txt · Last modified: 07 Sep 2018 08:41 by Alexandru Ardelean