Dear Nvidia!
I would like to connect an ADIS16475 to the AGX ORIN 40pin header and add it as an iio device to the device tree to be recognized by the kernel. I would like to use spi0.0 for the communication and have GPIO11 as a data ready pin and GPIO12 as a reset pin. I have created a device tree overlay based on the IMU’s specifications as follows:
//include <dt-bindings/pinctrl/pinctrl-tegra.h>
include <dt-bindings/gpio/tegra234-gpio.h>
include <dt-bindings/interrupt-controller/irq.h>
include <dt-bindings/gpio/gpio.h>
include <dt-common/jetson/tegra234-p3737-0000-p3701-0000.h>
include <dt-bindings/pinctrl/pinctrl-tegra.h>
/ {
overlay-name = “adis16475 IMU”;
jetson-header-name = “Jetson 40pin Header”;
compatible = JETSON_COMPATIBLE;
fragment@0 {
target-path = "/spi@3210000/spi@0";
__overlay__ {
status = "disabled";
};
};
fragment@1 {
target = <&spi0>;
__overlay__ {
status = "okay";
adis_imu: adis16475@0 {
compatible = "adi,adis16475-3";
reg = <0x00>;
spi-cpha;
spi-cpol;
spi-max-frequency = <2000000>;
interrupt-parent = <&tegra_main_gpio>;
interrupts = <TEGRA234_MAIN_GPIO(R, 4) IRQ_TYPE_EDGE_RISING>;
reset-gpios = <&tegra_main_gpio TEGRA234_MAIN_GPIO(H, 7) GPIO_ACTIVE_LOW>;
};
};
};
fragment@2 {
target = <&pinmux>;
__overlay__ {
pinctrl-names = "default";
pinctrl-0 = <&jetson_io_pinmux>;
jetson_io_pinmux: exp-header-pinmux {
hdr40-pin11 {
nvidia,pins = HDR40_PIN11;
#nvidia,function = "spi1";
nvidia,pin-label = "spi0_dr";
nvidia,tristate = <TEGRA_PIN_DISABLE>;
nvidia,enable-input = <TEGRA_PIN_ENABLE>;
};
hdr40-pin12 {
nvidia,pins = HDR40_PIN12;
#nvidia,function = "spi1";
nvidia,pin-label = "adis_reset";
nvidia,tristate = <TEGRA_PIN_DISABLE>;
nvidia,enable-input = <TEGRA_PIN_DISABLE>;
#nvidia,pull = <TEGRA_PIN_PULL_UP>;
};
hdr40-pin19 {
nvidia,pins = "spi1_mosi_pz5";
nvidia,function = "spi1";
nvidia,pin-label = "spi1_dout";
nvidia,tristate = <TEGRA_PIN_DISABLE>;
nvidia,enable-input = <TEGRA_PIN_ENABLE>;
};
hdr40-pin21 {
nvidia,pins = "spi1_miso_pz4";
nvidia,function = "spi1";
nvidia,pin-label = "spi1_din";
nvidia,tristate = <TEGRA_PIN_DISABLE>;
nvidia,enable-input = <TEGRA_PIN_ENABLE>;
};
hdr40-pin23 {
nvidia,pins = "spi1_sck_pz3";
nvidia,function = "spi1";
nvidia,pin-label = "spi1_sck";
nvidia,tristate = <TEGRA_PIN_DISABLE>;
nvidia,enable-input = <TEGRA_PIN_ENABLE>;
};
hdr40-pin24 {
nvidia,pins = "spi1_cs0_pz6";
nvidia,function = "spi1";
nvidia,pin-label = "spi1_cs0";
nvidia,tristate = <TEGRA_PIN_DISABLE>;
nvidia,enable-input = <TEGRA_PIN_ENABLE>;
};
hdr40-pin26 {
nvidia,pins = "spi1_cs1_pz7";
nvidia,function = "spi1";
nvidia,pin-label = "spi1_cs1";
nvidia,tristate = <TEGRA_PIN_DISABLE>;
nvidia,enable-input = <TEGRA_PIN_ENABLE>;
};
};
};
};
};
The device appears in /sys/bus/iio/devices/ however I get zeros in the measurement fields.
Can you help me solving this issue.
Thank you for your help.