External Interrupt for SPI

Hi,
I want to enable GPIO17 (in header J30) as an external hardware interrupt on the Xavier. I was wondering how to set the dtsi file such that it can be an interrupt. So far I have the following, but not sure how to set it as an interrupt.

This is in the sources/hardware/nvidia/platform/t19x/galen/kernel-dts/common/tegra194-p2888-0000-a00.dtsi

gpio@2200000 {
                soc_gpio_21 {
                        gpio-hog;
                        status = "okay";
                        input;
                        gpios = <TEGRA194_MAIN_GPIO(Q,1) 0>;
`                       label = "spi_host_intr_1";
                };
        };
  1. Am I modifying the wrong file?
  2. How do I set that pin as an external interrupt?

Thanks!

1 Like

You can reference to the touch driver. Should define the interrupt in the device scope like thermal sensor.

hardware/nvidia/platform/t19x/common/kernel-dts/t19x-common-platforms/tegra194-thermal.dtsi

bpmp_i2c {
                tegra_tmp451: temp-sensor@4c {
                        status = "okay";
                        #thermal-sensor-cells = <1>;
                        compatible = "ti,tmp451";
                        reg = <0x4c>;
                        sensor-name = "tmp451-ext";
                        supported-hwrev = <1>;
                        offset = <(-38)>;
                        conv-rate = <0x06>;
                        extended-rage = <1>;

                        interrupt-parent = <&tegra_main_gpio>;
                        interrupts = <TEMP_ALERT IRQ_TYPE_LEVEL_LOW>;
1 Like

Thanks Shane. so my spidev definition looks like this:

spidev@0{
                        compatible="spidev";
                        reg=<0x0>;
                        spi-max-frequency=<25000000>;

                        interrupt-parent = <&tegra_main_gpio>;
                        interrupts = <STEGRA194_MAIN_GPIO(Q,1) IRQ_TYPE_LEVEL_LOW>;
                };
        };

It seems as though defining the GPIO in …/galen/kernel-dts/common/tegra194-p2888-0000-a00.dtsi is incorrect. Is there anywhere else I need to define the pin as a GPIO such that it can be set as an interrupt?