Action Item #299
Add touchscreen driver to kernel build
|Status:||Closed||Start date:||22 Mar 2014|
|Severity:||01 - Critical|
According to this information, the ADS7846 driver is needed in order to support the touchscreen interface on the HY28A display. This needs to be enabled in the kernel to be able to utilize the touchscreen interface on the texy display (see RM#240).
RM #299: Add support to the installation script to update the config.txt for Xeon, the PiBox phone.
RM #299: Added ILITEK ILITEK-TP to devices the touchscreen library can look for. Fixed cross.sh to build with properly paths to glib/gtk components.
RM #299: Add touchscreen library support to ptests. Fix cross.sh to properly build ptests and package with the library.
#2 Updated by Hammel about 5 years ago
- % Done changed from 10 to 20
This repo is designed to be built out-of-kernel. It requires work to make it into a real driver tree.
What I may be able to do is modify the Makefile and add a Kconfig file for just the ads7846_device, which is all that's missing for touchscreen support. There are other drivers in there but they aren't required.
#4 Updated by Hammel about 5 years ago
- ads7846_device (from fbtft_tools)
ads7846 was not configured in the kernel.
ads7846_device is currently being built by the kernel-build-drivers target.
evdev was already enabled as a module in the kernel.
xinput was not enabled as an X.org driver module in Buildroot.
Updating both configs and rebuilding. S90UI will be updated to make sure these are all loaded when the fbtft driver is loaded.
#5 Updated by Hammel about 5 years ago
- Dual screen HDMI and 2.8 PiTFT - lots of manual-howto help plus tips on testing.
- % Done changed from 70 to 50
Attempted to boot with TFT attached. I got a white screen but nothing else. HDMI still works.
The problems are likely configuration problems with config.txt and cmdline.txt. I also may or may not have the correct TFT drivers enabled for this particular display.
An alternative problem is that I soldered the headers to the Pi Zero W to connect the display. At least one pin may not be properly soldered. However, I checked the tutorial for the TFT and it appears this pin is not used for the display. So I think my soldering is sufficient for testing.
Bumping back the %done again because I think I still have a ways to go to get the TFT working properly.
- % Done changed from 50 to 80
I had a hard time getting the TFT touchscreen to work. So much so that I looked around to see if there was a small HDMI screen I could use. I found one:
I picked one of these up from Amazon
This arrived pretty quickly and I was able to boot the Pi Zero with it quite easily. The package came with the exact changes required for config.txt in order for the display to work. The display is large (5") and just hooks up to the HDMI port on the Pi. So much simpler and requires no changes to the PiBox development platform other than the config.txt. At least so far - the touchscreen requires the display to be hooked to the USB port of the Pi. Both are female micro USB ports and I don't have a connector for that, so I haven't tried it yet (will need a hub for that, which I have but haven't tested yet).
So I'm switching to the HDMI display for the Xeon project. I've ordered a set of connectors that I think will allow me to hook up both the HDMI and USB ports with as small cabling as possible. Adafruit has some nice parts for DIY HDMI and USB connections. I've also done a test layout of the parts for the phone over some perfboard and they fit fine.
Once I have the parts for the cables and have fit them to verify I can close this issue.
The HDMI display's touchscreen via the USB connection is not working with X.org under PiBox. It does work with Raspbian. I've logged everything I can find under Raspbian and started examining it to figure out what might be happening.
The first thing I found was the X.org.log file from Raspbian shows that config/udev is being used to identify the touchscreen device. Udev had already created the input device for it. PiBox doesn't use udev - it uses mdev. So the fix may be as simple as modifying
To support the touchscreen and create the appropriate input device. Then I can add an xorg.conf that specifies the device to be used.
I also noted that X.org comes up fine without an xorg.conf file in general, it just doesn't support the input device. I may only need to make sure the input device is properly created (which I think it may already be because I tested it with evtest under PiBox), but I think the problem is with X.org knowing what to do with the device and that means making mdev create a specific device I can reference for it in the xorg.conf.
I managed to get the touchscreen working with the HDMI display. The first trick was to load the hid_multitouch kernel driver. That made the device available and worked, out of the box, with X.org. Then I needed to update libpibox to include the display name ILITEK ILITEK-TP. Now my lib sees the device.
The next problem is that touch points are way larger than screen points, which causes my launcher to not work with the display. So on an 800x480 screen I get a middle touch point of 8439,5161. This means I need to calibrate the display. The ts_calibrate tool lets me do that but I have to figure out what to do with the output it provides. I think there is a config file I can use to filter the touch points or maybe I can use the values myself in libpibox to calibrate manually.
Well that was easy. Run ts_calibrate to generate /etc/pointercal. This translates touches to within the display size. Now that should map to my icons correctly, though I still have to test that.
I should keep calibration files for landscape and portrait modes. Xeon will use portrait mode but a rotation (if I ever implement that) would need to swap calibration files.
Next I need to integrate the calibration files into the build. I can get them off the Pi and save them in the tree, then integrate them with the build using the skeleton tree. Might need a new Make target that handles updating the skeleton based on HW config, if I don't already have something like that.
- Status changed from In Progress to Closed
- % Done changed from 80 to 100
Some experimentation with display_rotate and lcd_display_rotate in the config.txt shows that rotation of the display doesn't work quite right. The 800x480 is squeezed into a smaller space in portrait mode. I posted a comment about this on the device where I bought it (Amazon) since that seems my only way to provide feedback so far.
In the meantime I'll work with the device in landscape mode just to keep moving forward. I'll open a second issue on the rotation bug and track it separately.
The pointercal file is integrated into the mainline PiBox build and gets added to the tree if HW=xeon now. Changes pushed.