I have devkit b01 with Jetson Nano.
I would like to configure system for I2C touchpanel based on ILI251x. I connected touchscreen via I2C0 and PY.02 (INT) and PBB.00 (RST).
I added driver to Kernel modules - I event on list in evtest tool. But I have errors with configuration reset and interrupt pin. Log from dmesg: dmesg_log.txt (62.4 KB)
DTS file which I modify: tegra210-porg-p3448-common.dtsi (20.9 KB) tegra210-porg-pinmux-p3448-0000-b00.dtsi (38.2 KB)
Can you verify my definition of gpio and interrupt?
...
[ 1.184540] [ILITEK][ERR][ilitek_get_gpio_num:1557] reset_gpio = -22
[ 1.184561] OF: /i2c@7000c000/ilitek@41: could not get #gpio-cells for /pinmux@700008d4
[ 1.192589] [ILITEK][ERR][ilitek_get_gpio_num:1560] irq_gpio = -22
[ 1.192593] [ILITEK][MSG][ilitek_get_gpio_num:1567] reset_gpio = -22 irq_gpio = -22
[ 1.192599] [ILITEK][MSG][ilitek_reset:454] delay: 1000
[ 1.192602] [ILITEK][ERR][ilitek_reset:494] reset pin is invalid...
for narrow down the issue,
could you please follow below formula to calculate the GPIO number, and using the GPIO number directly in the kernel APIs to access the pin,
for example,
I wrote pins number directly to dts, where driver is described:tegra210-porg-p3448-common.dtsi (20.8 KB)
PY.02 = 24 * 8 + 2 = 194
PBB.00 = 27 * 8 + 0 = 216
But problem is the same as previous. Dmesg:Jetson_dmesg.txt (62.3 KB)
Do you have any idea what is wrong?
I changed to:
interrupt-parent = <&gpio>;
interrupts = <194 IRQ_TYPE_EDGE_FALLING>;
ilitek,irq-gpio = <&gpio 194 GPIO_ACTIVE_HIGH>;
ilitek,reset-gpio = <&gpio 216 GPIO_ACTIVE_HIGH>;
It resolved my problem. Thank you for this advice.
Can you show me where is declaration about parent &gpio ? In tegra210-porg-pinmux-p3448-0000-b00.dtsi are only &pinmux.
please refer to tegra210-soc-base.dtsi for t210 node definition, (i.e. Nano and TX1 series platforms)
you may check below for GPIO definition, $L4T_Sources/r32.6.1/Linux_for_Tegra/source/public/hardware/nvidia/soc/t210/kernel-dts/tegra210-soc/tegra210-soc-base.dtsi
you should also check below for reference driver for using gpio interrupt. $L4T_Sources/r32.6.1/Linux_for_Tegra/source/public/hardware/nvidia/platform/t210/common/kernel-dts/t210-common-platforms/tegra210-platform-common-sensor.dtsi
It is necessary to change something in tegra210-platform-common-sensor.dtsi and tegra210-soc-base.dtsi ? Or do you sent me this fo reference to my question?
I checked again on oscilloscope my hardware and for example, INT change when I touch the touchscreen. But in /proc/interrupts the number of interrupts is constant. cat_proc_interrupts.txt (8.3 KB)
Could you check my device tree which I sent above?
Change the line: interrupts = <194 0x01> doesn’t help. I changed gpio int to PS.05:
interrupts = <149 0x01>;
ilitek,irq-gpio = <&gpio 149 GPIO_ACTIVE_HIGH>;
But this doesn’t help too.
In $dmesg --follow containt disturbing information on the end of file:
23.019041] [ILITEK][MSG][ilitek_irq_disable:284]
Do you know why ilitek_irq is disable?
Thank you for reference but this topic is for user space. I want to use driver which need device tree.
I have questions about below line in gpio definition in device tree:
nvidia,function = “rsvd1”;
rsvd means reserved?
What I must set in nvidia.function when I want to use as gpio?
please also refer to [3.3 GPIO Pins] of Nano datasheets. GPIO01/ GPIO3_PS.05, it has alternate function as Camera MCLK #2 (CLK).
please consider the pin without “Alternate Function”.
thanks