raspberrypi / linux

Kernel source tree for Raspberry Pi-provided kernel builds. Issues unrelated to the linux kernel should be posted on the community forum at https://forums.raspberrypi.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ADS7846 Touch controller does not work correctly after upgrade to kernel 6.6.20

hadrava opened this issue · comments

Describe the bug

ADS7846 Touch controller does not work anymore after upgrade to the latest kernel 6.6.20 on 64-bit Raspberry Pi OS Bookworm. It works well with the older kernel 6.1.0.

Tested on Raspberry Pi 4 Model B with Waveshare 10.1 Inch Resistive touch Screen (https://www.waveshare.com/wiki/10.1inch_HDMI_LCD https://www.waveshare.com/product/displays/lcd-oled/lcd-oled-1/10.1inch-hdmi-lcd.htm)

Touch event comes through only occasionally. If I keep finger on the display long enough, I eventually receive event with correct position. (Approximately once in a a few minutes.) So it looks a bit to me like there is something wrong with penirq signal and the SPI connection is fine. I could be wrong though.

Steps to reproduce the behaviour

  • Install fresh 64-bit Bookworm image Raspberry Pi OS Lite (tested with 2024-03-15-raspios-bookworm-arm64-lite.img)
  • Connect the Waveshare 10.1 Inch display and add dtoverlay configuration for ADS7846:
echo 'dtoverlay=ads7846,cs=1,penirq=25,penirq_pull=2,speed=50000,keep_vref_on=0,swapxy=0,pmax=255,xohms=150,xmin=200,xmax=3900,ymin=200,ymax=3900' >> /boot/firmware/config.txt
  • Install libinput tools: apt install libinput-tools
  • Reboot
  • Start libinput debug-events
  • Touch the display: Console should be filled with the libinput events from the touch screen. But usually nothing happens with the kernel 6.6.
  • Downgrade to kernel 6.1 (Confirm kernel removal with answer No):
apt install linux-image-6.1.0-rpi8-rpi-v8 linux-image-6.6.20+rpt-rpi-v8- linux-image-6.6.20+rpt-rpi-2712-
reboot
  • Command libinput debug-events will now show all the touch events as expected.

Device (s)

Raspberry Pi 4 Mod. B

System

Raspberry Pi reference 2024-03-15
Generated using pi-gen, https://github.com/RPi-Distro/pi-gen, f19ee211ddafcae300827f953d143de92a5c6624, stage2
Feb 29 2024 12:24:53 
Copyright (c) 2012 Broadcom
version f4e2138c2adc8f3a92a3a65939e458f11d7298ba (clean) (release) (start)

Kernel with broken touch screen:

Linux raspberrypi 6.6.20+rpt-rpi-v8 #1 SMP PREEMPT Debian 1:6.6.20-1+rpt1 (2024-03-07) aarch64 GNU/Linux

It works well with the following kernel:

Linux raspberrypi 6.1.0-rpi8-rpi-v8 #1 SMP PREEMPT Debian 1:6.1.73-1+rpt1 (2024-01-25) aarch64 GNU/Linux

Logs

Boot with broken touch screen kernel 6.6.20:
dmesg-broken.txt

The touch screen works well with kernel 6.1.0:
dmesg-working.txt

Additional context

No response

commented

Duplicate of raspberrypi/bookworm-feedback#88
Already fixed by #6029.

Use rpi-update to get the latest kernel with the fix.

... nope ...
I had the same problem where after a dist upgrade my Waveshare Touch (the smaller 3.5") just stopped working no matter what I did (and I tried a lot in the last 3 days).
This was the last attempt; an rpi update didn't make any change either...

dtoverlay=ads7846,cs=0,penirq=25,penirq_pull=2,speed=50000,keep_vref_on=1,swapxy=0,pmax=255,xohms=150

That have worked before like a smart ...

Your dtoverlay line is too long - there is a 100 character limit. It may not make it work, but you should split the line like this:

dtoverlay=ads7846,cs=0,penirq=25,penirq_pull=2,speed=50000,keep_vref_on=1
dtparam=swapxy=0,pmax=255,xohms=150

I have just change that without any result; same as before: no touch
BTW: The "long" line have worked before without trouble

EDIT:
I'm bad at linux so... How can I backstep the "dist-upgrade"?

EDIT 2:
Sorry, sorry, sorry... I screwed up and probably set the cs parameter to 0 instead of 1 through my own trial and error; I just noticed.
Now it seems (?) to work... I'll test it out...

  • right: with the long line it don't work. Wonder why it works well in older distris?!