Project

General

Profile

Actions

Action Item #299

closed

Add touchscreen driver to kernel build

Added by Hammel about 10 years ago. Updated about 5 years ago.

Status:
Closed
Priority:
Immediate
Assignee:
Target version:
Start date:
22 Mar 2014
Due date:
% Done:

100%

Estimated time:
Severity:
01 - Critical

Description

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).

Actions #1

Updated by Hammel about 10 years ago

  • Status changed from New to In Progress
  • % Done changed from 0 to 10

Apparently I need to integrate this driver into the build too:
https://github.com/notro/fbtft_tools

Actions #2

Updated by Hammel almost 10 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.

Actions #3

Updated by Hammel almost 10 years ago

  • % Done changed from 20 to 50

Added fbtft_tools to kernel build. The drivers are installed under lib/modules/<version>/extra.

They have not been tested on the target yet.

Actions #4

Updated by Hammel almost 10 years ago

Drivers required:
  1. Kernel
    1. ads7846
    2. ads7846_device (from fbtft_tools)
    3. evdev
  2. Buildroot
    1. xinput

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.

Actions #6

Updated by Hammel almost 10 years ago

  • % Done changed from 50 to 70

Enabled driver in modules.conf so it gets loaded by S11dev now. All that's left is to verify it can be used if the touchscreen is actually available and that it doesn't cause a problem if it isn't available.

Actions #7

Updated by Hammel almost 10 years ago

  • Priority changed from Immediate to Normal
  • Target version changed from 0.9.0 to 0.10.0

Additional work on this is being pushed to 0.10.0 so I can get the media specific stuff completed in time for camping season.

Actions #8

Updated by Hammel over 9 years ago

  • Target version changed from 0.10.0 to 2.0 - Harkonnen

A touchscreen interface is not really required until we get to the "Nest"-like feature set that supports home automation, which isn't target till the 2.0 release.

Moving to 2.0 target version.

Actions #9

Updated by Hammel about 5 years ago

Touchscreen support is available via the official Raspberry Pi 7" touchscreen. Support for Adafruit displays like the ADS7846 is incomplete and will be investigated further with the PiBox Phone (project Xeon).

Actions #10

Updated by Hammel about 5 years ago

  • Project changed from PiBox to Xeon
  • Category deleted (03 - Linux Kernel)
  • Priority changed from Normal to Immediate
  • Target version changed from 2.0 - Harkonnen to v0.1
  • Severity changed from 03 - Medium to 01 - Critical
Actions #11

Updated by Hammel about 5 years ago

FYI: Here is a blog post from someone who tried doing the same thing.

In the end I think I'm on the right path here but I can probably learn a little more from what that guy went through.

Actions #12

Updated by Hammel about 5 years ago

  • % 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.

Actions #13

Updated by Hammel about 5 years ago

  • % 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:

http://wiki.52pi.com/index.php/5-Inch-800x480-Capacity-Touch-Screen_SKU:_EP-0081

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.

Actions #14

Updated by Hammel about 5 years ago

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

lib/mdev/inputdev

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.

Actions #15

Updated by Hammel about 5 years ago

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.

Actions #16

Updated by Hammel about 5 years ago

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.

Actions #17

Updated by Hammel about 5 years ago

  • 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.

Closing issue.

Actions

Also available in: Atom PDF