Can confirm these instructions work with a Waveshare 3.5 inch SPI touchscreen: 3.5inch RPi LCD (A) - Waveshare Wiki – bought on Amazon, described as “Waveshare 3.5inch Resistive Touch Control Screen TFT LCD Compatible with Raspberry Pi 4B/3B+/3B/2B/B+/A+/Zero/Zero W/WH/Zero 2W Series Boards 480x320 Resolution SPI”
Specs and pinout details available on those product pages.
Using a 2GB AML-S905X-CC “Le Potato”, running ubuntu-22.04.1-preinstalled-desktop-arm64+aml-s905x-cc.img from the Libre Computing repository. Fully updated and patched. I’m accessing the system a few different ways (SSH, Remote Desktop Connection, direct with keyboard/mouse/HDMI display, and now with SPI touchscreen), for convenience and testing purposes. To add some procedural detail to the above instructions:
[power off, plug the screen into the GPIO header, boot the system]
sudo apt install libretech-gpio libretech-dtoverlay
# was already installed/latest version
sudo ldto reset
# to ensure no conflicting merged overlays installed
sudo reboot
# to ensure all overlays cleared and starting clean
sudo ldto enable spicc-cs1
# to test-enable spi overlay
sudo ldto enable spicc-cs1-ili9486-xpt2046
# to test-enable basic LCD and touchscreen overlay
dmesg
# check log to see if screen was detected
Your logs may differ, but as an example (most of the warnings have no negative impact – the key is the screen is identified and enumerated):
[Fri Nov 18 23:50:37 2022] [drm] Initialized ili9486 1.0.0 20200118 for spi0.0 on minor 1
[Fri Nov 18 23:50:37 2022] checking generic (7f807000 7e9000) vs hw (0 0)
[Fri Nov 18 23:50:37 2022] meson_vdec: module is from the staging directory, the quality is unknown, you have been warned.
[Fri Nov 18 23:50:37 2022] SPI driver ads7846 has no spi_device_id for ti,tsc2046
[Fri Nov 18 23:50:37 2022] SPI driver ads7846 has no spi_device_id for ti,ads7843
[Fri Nov 18 23:50:37 2022] SPI driver ads7846 has no spi_device_id for ti,ads7845
[Fri Nov 18 23:50:37 2022] SPI driver ads7846 has no spi_device_id for ti,ads7873
[Fri Nov 18 23:50:37 2022] ads7846 spi0.1: Looking up vcc-supply from device tree
[Fri Nov 18 23:50:37 2022] ads7846 spi0.1: Looking up vcc-supply property in node /soc/bus@c1100000/spi@8d80/touchscreen@1 failed
[Fri Nov 18 23:50:37 2022] ads7846 spi0.1: supply vcc not found, using dummy regulator
[Fri Nov 18 23:50:37 2022] ili9486 spi0.0: [drm] fb1: ili9486drmfb frame buffer device
[Fri Nov 18 23:50:37 2022] ads7846 spi0.1: touchscreen, irq 36
[Fri Nov 18 23:50:37 2022] input: ADS7846 Touchscreen as /devices/platform/soc/c1100000.bus/c1108d80.spi/spi_master/spi0/spi0.1/input/input1
ls /dev
# per the log, fb1 was the new device, and confirmed in /dev
sudo ldto merge spicc-cs1
# the test-enable worked, so merge it into boot
sudo ldto merge spicc-cs1-ili9486-xpt2046
# merge this into boot, too
sudo reboot
# to verify the merge worked and it loads on boot
dmesg
# verify detected with log entries similar to above
At this point I was able to use the Display Settings control panel in my windowing environment to enable and configure the LCD touchscreen. I did some quick tests and was able to run it as the only display, as a secondary display/extension to the primary display, and disabled. In general, it behaved normally. There were some vertical line pattern artifacts and minor color discrepancies but the display was usable and touch appeared to work. I haven’t done in-depth testing or tried the “tuned” mhs3528 or mpi3501 overlays to see if they improve anything. I’ve also been testing with this system for a week, so it’s not a pure/pristine OS, but I think this is repeatable.