AM335x Touchscreen Driver's Guide
Touchscreen controller on AM335x is an 8 channel general purpose ADC, with support for interleaving Touch Screen conversions for a 4-wire resistive panel. A resistive touchscreen operates by applying a voltage across a resistive network and measuring the change in resistance at a given point on the matrix where the screen is touched by an input (stylus or finger). The change in the resistance ratio marks the location on the touchscreen.
Test the working of touchscreen by using the Tslib utility. Tslib is an abstraction layer for touchscreen panel events, as well as a filter stack for the manipulation of those events. Tslib is generally used on embedded devices to provide a common user space interface to touchscreen functionality.
Make sure you have the following settings right.
- export TSLIB_FBDEVICE=/dev/fb0
- This is for the Fbdev device node to be used for display.
- export TSLIB_TSDEVICE=/dev/input/touchscreen0
- First run ts_calibrate to calibrate the touch screen.
- You can now run ts_test application. This application helps in moving a cross-hair pattern around the LCD touchscreen. The pattern moves with your stylus movements. Also there is a draw option supported. Using your stylus you can write/draw on touchscreen.
You can enable touchscreen driver as in the kernel as follows.
Device Drivers ---> Input device support ---> [*] Touchscreens ---> <*> TI Touchscreen Interface
Building as Loadable Kernel Module
- Incase if you want to build the drivers as modules, use <M> instead of <*> during menuconfig while selecting the drivers (as shown below). For more information on loadable modules refer Loadable Module HOWTO
Device Drivers ---> Input device support ---> [*] Touchscreens ---> <M> TI Touchscreen Interface
- This step applies if the driver is built as module
- Do "make modules" to build the Touchscreen driver as module. The module should be present in "drivers/input/touchscreen/ti_tsc.ko".
- Load the driver using "ti_tsc.ko".