[Letux-kernel] no interrupts from touchscreen

H. Nikolaus Schaller hns at goldelico.com
Thu Aug 23 09:33:01 CEST 2018


Hi,

> Am 23.08.2018 um 07:22 schrieb Andreas Kemnade <andreas at kemnade.info>:
> 
> Hi,
> 
> On Wed, 22 Aug 2018 23:31:29 +0200
> "H. Nikolaus Schaller" <hns at goldelico.com> wrote:
> 
>> Hi,
>> 
>>> Am 20.08.2018 um 20:05 schrieb Andreas Kemnade <andreas at kemnade.info>:
>>> 
>>> Hi,
>>> 
>>> at the moment I do not get interrupts from touchscreen.
>>> I am working with 4.17. It seems to have stopped working after suspend.
>>> This happens randomly, seen it with different kernels. At this time I have
>>> a working usb connection and investigated.
>>> via iio I could read out x/y and pressure. They seem to behave same.
>>> Pressure can go up to > 1000
>>> 
>>> But I do not get interrupts.
>>> Nothing happens in /proc/interrupts.
>> 
>> strange. I have just tested with 4.18.4 on a GTA04A4:
>> 
>> root at letux:~# cat /proc/interrupts |fgrep tsc2007
>> 168:       2369  49058000.gpio   0 Edge      tsc2007
>> root at letux:~# cat /proc/interrupts |fgrep tsc2007
>> 168:       2369  49058000.gpio   0 Edge      tsc2007
>> root at letux:~# cat /proc/interrupts |fgrep tsc2007
>> 168:       2369  49058000.gpio   0 Edge      tsc2007
>> root at letux:~# cat /proc/interrupts |fgrep tsc2007
>> 168:       2383  49058000.gpio   0 Edge      tsc2007
>> root at letux:~# cat /proc/interrupts |fgrep tsc2007
>> 168:       2383  49058000.gpio   0 Edge      tsc2007
>> root at letux:~# cat /proc/interrupts |fgrep tsc2007
>> 168:       2397  49058000.gpio   0 Edge      tsc2007
>> root at letux:~# cat /proc/interrupts |fgrep tsc2007
>> 168:       2408  49058000.gpio   0 Edge      tsc2007
>> root at letux:~#
>> 
> Well, most of the time it works, I did not find a clear pattern
> for this problem. It usually only happens when I am not in a situation
> so that I can debug that or want to debug something else.
> Suspend seems to be involved.

Hm. Ok.

Well, AFAIR the tsc2007 has no special suspend/resume code.
It also does not need it since it is powered from 1.8V which
is always on.

So the chip should not change state with suspend/no suspend.

The only thing is that it is still active to some extent.
It may react on touch pressures while suspended. And collect
data. This may wake up the device if the interrupt is an
active wakeup source.

> I have seen it running the weather monitor for long times.
> 
> What puzzles me is that I can get the raw values using iio,
> so i2c seems not to be stuck.

This means the interrupt mechanism gets stuck.

> 
> [...]
>>> 
>>> 
>>> This stays the same regards if I touch or not
>> 
>> same for me
>> 
>>> root at gta04:~# devmem2 0x49058038 w
>>> /dev/mem opened.
>>> Memory mapped at address 0xb6f4b000.
>>> Value at address 0x49058038 (0xb6f4b038): 0xB001
>> 
> So GPIO_DATAIN does not change for you?

I have not seen it at this address.

> 
>>> root at gta04:~# devmem2 0x49058034 w
>>> /dev/mem opened.
>>> Memory mapped at address 0xb6f77000.
>>> Value at address 0x49058034 (0xb6f77034): 0xFBFFBFFF
>> 
>> root at letux:~# /usr/bin/arm-linux-gnueabihf/devmem2 devmem2 0x49058034 w
>> /dev/mem opened.
>> Memory mapped at address 0xb6fd6000.
>> Illegal data type '0'.
>> root at letux:~#
>> 
> devmem2 is duplicated in your commandline.

Ah yes. I have to repeat

> 
>>> 
>>> Any hints? reboot doen not help.
>>> Power cycle helps.
>> 
>> Maybe you can add some printk to tsc2007.c?
>> 
> Hmm, just sending
>  /* Prepare for touch readings - power down ADC and enable PENIRQ */
>        err = tsc2007_xfer(ts, PWRDOWN);
> 
> should be enough to get interrupts (or at least changing values in GPIO_DATAIN), shouldn't it?

Yes. The chip should wake up on first touch pressureand send an interrupt.

> So in doubt an i2cset should be enough.
> Just another strange thing: Why is TSC2007_SETUP never used?

Because 50 kOhm vs. 90 kOhm makes 16 µA difference and only if
interrupt is active. And we use the onchip MAV filter which
is enabled by default. So there is no big need to send an
TSC2007_SETUP command to set the defaults.

BR,
Nikolaus

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.goldelico.com/pipermail/letux-kernel/attachments/20180823/d1432c15/attachment.asc>


More information about the Letux-kernel mailing list