The ads7846 USES spi interface (an available SPI controller driver). The ads7846 PROVIDES event device interface. The event device is a generic layer supporting buttons (keyboards), switches, relative analog devices (mice), absolute analog devices (touchscreens) etc. All drivers are automatically enumerated as event0...eventx and given respective major/minor numbers, for example on one of my systems:
Code:
#ls -l /dev/input
crw-r----- 1 0 0 13, 64 Nov 1 2007 event0
crw-r----- 1 0 0 13, 65 Nov 1 2007 event1
crw-r----- 1 0 0 13, 66 Nov 1 2007 event2
Then your application goes through all event devices and asks their capabilities. My applications are looking for ABS_X and ABS_Y capable driver. Then, the max and min values are read for each parameter and so the app autodetects your touchscreen, whatever type the controller is.