This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

PROCESSOR-SDK-AM62X: Touch screen interrupt issue

Part Number: PROCESSOR-SDK-AM62X
Other Parts Discussed in Thread: ADS7843, AM625, ADS7846

Hi TI,

we are using ADS7843 touch screen controller for our resistive touch LCD.

The Interrupt line of ADS7843 is connected to the one of the input port of IO expander.

on touch, the ADS7843 is interrupting the IO expander port as expected, how ever we see an error message on the debug console.

The message is as follows:

[ 1208.870828] ---[ end trace 3c8fa06a3e51791a ]---
[ 1404.961822] ------------[ cut here ]------------
[ 1404.966468] WARNING: CPU: 2 PID: 153 at drivers/gpio/gpiolib.c:2791 gpiod_get_raw_value+0x7c/0x98
[ 1404.975317] Modules linked in: md5 cbc crct10dif_ce pvrsrvkm(O) mcrc sa2ul sha512_generic authenc cryptodev(O)
[ 1404.985331] CPU: 2 PID: 153 Comm: irq/305-1-0022 Tainted: G W O 5.10.168-g2c23e6c538 #2
[ 1404.994440] Hardware name: Texas Instruments AM625 SK (DT)
[ 1404.999912] pstate: 20000005 (nzCv daif -PAN -UAO -TCO BTYPE=--)
[ 1405.005904] pc : gpiod_get_raw_value+0x7c/0x98
[ 1405.010334] lr : gpiod_get_raw_value+0x24/0x98
[ 1405.014763] sp : ffff80001215bc00
[ 1405.018065] x29: ffff80001215bc00 x28: ffff8000100bb000
[ 1405.023365] x27: ffff000001881c80 x26: ffff000001881c80
[ 1405.028665] x25: ffff0000017ead30 x24: 0000000000001ea5
[ 1405.033965] x23: ffff80001215bd48 x22: ffff0000018eb8dc
[ 1405.039264] x21: ffff0000018eb800 x20: 0000000000000000
[ 1405.044564] x19: ffff0000018f0a40 x18: ffff0000035e2800
[ 1405.049864] x17: 0000000000000000 x16: 0000000000000000
[ 1405.055165] x15: 000000523336af88 x14: 0000004b599ccb92
[ 1405.060464] x13: 0000000000000000 x12: 0000000000000001
[ 1405.065764] x11: 0000000000000062 x10: 00000000000009f0
[ 1405.071064] x9 : ffff80001215bac0 x8 : ffff00007fbb1e40
[ 1405.076363] x7 : ffff80006ebd7000 x6 : ffff00007fbb75c0
[ 1405.081662] x5 : 00000000410fd030 x4 : ffff8000111cfc88
[ 1405.086962] x3 : ffff00000039c800 x2 : ffff00000039c800
[ 1405.092261] x1 : 0000000000000001 x0 : ffff0000018f0220
[ 1405.097563] Call trace:
[ 1405.100001] gpiod_get_raw_value+0x7c/0x98
[ 1405.104089] get_pendown_state.isra.0.part.0+0x18/0x30
[ 1405.109213] ads7846_irq+0x310/0x418
[ 1405.112780] handle_nested_irq+0xb8/0x138
[ 1405.116781] pca953x_irq_handler+0x28c/0x308
[ 1405.121037] irq_thread_fn+0x2c/0xb0
[ 1405.124600] irq_thread+0x164/0x2e0
[ 1405.128080] kthread+0x140/0x160
[ 1405.131299] ret_from_fork+0x10/0x30
[ 1405.134864] ---[ end trace 3c8fa06a3e51791b ]---
[ 1405.149833] ------------[ cut here ]------------
[ 1405.154462] WARNING: CPU: 2 PID: 153 at drivers/gpio/gpiolib.c:2791 gpiod_get_raw_value+0x7c/0x98
[ 1405.163311] Modules linked in: md5 cbc crct10dif_ce pvrsrvkm(O) mcrc sa2ul sha512_generic authenc cryptodev(O)
[ 1405.173319] CPU: 2 PID: 153 Comm: irq/305-1-0022 Tainted: G W O 5.10.168-g2c23e6c538 #2
[ 1405.182428] Hardware name: Texas Instruments AM625 SK (DT)
[ 1405.187902] pstate: 20000005 (nzCv daif -PAN -UAO -TCO BTYPE=--)
[ 1405.193893] pc : gpiod_get_raw_value+0x7c/0x98
[ 1405.198323] lr : gpiod_get_raw_value+0x24/0x98
[ 1405.202752] sp : ffff80001215bc00
[ 1405.206054] x29: ffff80001215bc00 x28: ffff0000017eab68
[ 1405.211355] x27: 0000000000000fa0 x26: ffff000001881c80
[ 1405.216654] x25: ffff0000017ead30 x24: 0000000000001ea5
[ 1405.221954] x23: ffff0000018f1000 x22: ffff0000017eaca8
[ 1405.227253] x21: 0000000000000000 x20: 0000000000000001
[ 1405.232553] x19: ffff0000018f0a40 x18: 0000000033f989cf
[ 1405.237852] x17: 00000000b88bd8e6 x16: 00000000d7d91e46
[ 1405.243152] x15: 0000000000000000 x14: 0000000000000000
[ 1405.248451] x13: 0000000000000000 x12: 0000000000000049
[ 1405.253750] x11: 00000000000002c3 x10: 00000000000009f0
[ 1405.259050] x9 : ffff80001215bae0 x8 : ffff00007fbb1e40
[ 1405.264350] x7 : ffff80006ebd7000 x6 : ffff00007fbb75c0
[ 1405.269649] x5 : 00000000410fd030 x4 : ffff8000111cfc88
[ 1405.274949] x3 : ffff00000039c800 x2 : ffff00000039c800
[ 1405.280248] x1 : 0000000000000001 x0 : ffff0000018f0220
[ 1405.285548] Call trace:
[ 1405.287986] gpiod_get_raw_value+0x7c/0x98
[ 1405.292074] get_pendown_state.isra.0.part.0+0x18/0x30
[ 1405.297198] ads7846_irq+0x310/0x418
[ 1405.300765] handle_nested_irq+0xb8/0x138
[ 1405.304765] pca953x_irq_handler+0x28c/0x308
[ 1405.309022] irq_thread_fn+0x2c/0xb0
[ 1405.312585] irq_thread+0x164/0x2e0
[ 1405.316065] kthread+0x140/0x160
[ 1405.319285] ret_from_fork+0x10/0x30
[ 1405.322849] ---[ end trace 3c8fa06a3e51791c ]---

we are bit confused if its related to some conflict between touch screen controller and sha512_generic authenc cryptodev(O).

our dts configuration is as follows:

&main_spi2 {
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&spitouch_pins_default>;

ti,pindir-d0-out-d1-in;


ads7843: ads7843@0 {
reg = <0>; /* CS0 */
compatible = "ti,ads7843";
interrupt-parent = <&exp1>;
interrupts = <12 IRQ_TYPE_EDGE_FALLING>; /* BOOT6 / GPIO 8 */
spi-max-frequency = <1000000>;
pendown-gpio = <&exp1 12 IRQ_TYPE_EDGE_FALLING>;
//vcc-supply = <&vcc_3v3_sys>;

ti,x-min = /bits/ 16 <0>;
ti,x-max = /bits/ 16 <8000>;
ti,y-min = /bits/ 16 <0>;
ti,y-max = /bits/ 16 <4800>;
ti,x-plate-ohms = /bits/ 16 <40>;
ti,pressure-max = /bits/ 16 <255>;

wakeup-source;
};
};

spitouch_pins_default: spitouch-pins-default {
pinctrl-single,pins = <
AM62X_IOPAD(0x01b0, PIN_OUTPUT_PULLUP, 1) /* (A20) MCASP0_ACLKR.SPI2_CLK */
AM62X_IOPAD(0x0194, PIN_OUTPUT_PULLUP, 1) /* (B19) MCASP0_AXR3.SPI2_D0 */
AM62X_IOPAD(0x0198, PIN_INPUT_PULLUP, 1) /* (A19) MCASP0_AXR2.SPI2_D1 */
AM62X_IOPAD(0x01ac, PIN_OUTPUT_PULLUP, 1) /* (E19) MCASP0_AFSR.SPI2_CS0 */
>;
};

Thanks and Regards,

Swapna

  • Hi Swapna,

    Despite the kernel warning message, does the IO expander interrupt for the touch screen works as expected?

  • Yes Bin.

    we can see the interrupt whenever we tap the LCD, but we dont see any request from processor to get the x,y coordinates through SPI of ADS7843.

    we ran the command "cat /proc/interrupts" and see that interrupt count increments whenever we tap LCD.

    Thanks and Regards,

    Swapna

  • Hi Swapna,

    Let's step back, why do you connect the touch screen interrupt to the I/O expander not directly to an AM62x GPIO pin? It would simplify the software.

    ads7843: ads7843@0 {
    reg = <0>; /* CS0 */
    compatible = "ti,ads7843";
    interrupt-parent = <&exp1>;
    interrupts = <12 IRQ_TYPE_EDGE_FALLING>; /* BOOT6 / GPIO 8 */
    spi-max-frequency = <1000000>;
    pendown-gpio = <&exp1 12 IRQ_TYPE_EDGE_FALLING>;

    I support AM62x but I am not familar with ads7843, but does this interrupt configuration correct with both "interrupts" and "pendown-gpio"? 

  • Hi Bin,

    Now we are directly connected to processor GPIO instead of going through IO expander. Now we can see Interrupt getting generated upon a tap and processor issuing a command to ADS7843 and intern ADS7843 responding to it. (We can see some data through scope)

    However, the application is not responding to button press.

    The X and Y pixel values as below when we touch the panel corners:

    Is there anything we are missing, please let us know.

    Thanks and regards,

    Swapna

  • Hi Swapna,

    I am glad to see the GPIO is configured properly now. I am routing your query to our touchscreen expert, but he is out of office until end of October. Please expect delayed response.

  • Hi,

    The latest update from our side is, after deleting the  ws-calibrate.rules.

    rm /etc/udev/rules.d/ws-calibrate.rules
    rm /run/media/mmcblk0p1/ws-calibrate.rules
    reboot

    The touch is getting detected and UI is moving to next screen. However the problem is, the coordinates are not aligned properly.
    I've to press a bit to the right and a bit down of the button.

    I calibrated multiple times thinking it will correct itself, but the result s the same (misaligned coordinates).

    Could you please guide us, on how to correct this issue.

    Thanks and regards,
    Swapna
  • Hello Swapna,

    Glad to hear that you are making progress. Assuming that you got past the interrupt issues, we can continue discussing the touchscreen coordinates on your other thread https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1285661/processor-sdk-am62x-touch-screen-coordinates-mismatch

    Regards,

    Nick