Difference between revisions of "TSC2102 Linux driver"

From ArmadeusWiki
Jump to: navigation, search
(Installation)
(Usage)
Line 26: Line 26:
  
 
==Usage==
 
==Usage==
  # insmod /mnt/host/lib/modules/spi_imx.ko
+
First create the event0 node if not already existing:
  # insmod /mnt/host/lib/modules/tsc2102.ko
+
  # cat /sys/class/input/event0/dev
  # insmod /mnt/host/lib/modules/evdev.ko
+
# 13:64
  # insmod /mnt/host/lib/modules/tsc2102_ts.ko
+
# mkdir /dev/input
 +
# cd /dev/input/
 +
# mknod event0 c 13 64
 +
 
 +
Then modify the touchscreen configuration file to use raw input:
 +
# cat /etc/ts.conf
 +
module_raw input
 +
module pthres pmin=1
 +
module variance delta=30
 +
module dejitter delta=100
 +
module linear
 +
 
 +
and now start the drivers:
 +
# insmod /lib/modules/drivers/hwmon/hwmon.ko
 +
  # insmod /lib/modules/drivers/spi/spi_imx.ko
 +
  # insmod /lib/modules/drivers/spi/tsc2102.ko
 +
  # insmod /lib/modules/drivers/input/touchscreen/tsc2102_ts.ko
  
 
Then:
 
Then:
* get temperature and voltage with [http://lxr.linux.no/source/Documentation/hwmon/sysfs-interface?v=2.6.18 hwmon] (Hardware Monitoring) interface,
+
* get temperature and voltage with [http://lxr.linux.no/source/Documentation/hwmon/sysfs-interface?v=2.6.18 hwmon] (Hardware Monitoring) interface
* use touchscreen interface with [[tslib]] API,
+
-> ie cat /sys/bus/spi/drivers/tsc2102/spi2.0/in0_input
 +
* use touchscreen interface with [[tslib]] API
 
* play sounds through [http://www.alsa-project.org/ ALSA interface]
 
* play sounds through [http://www.alsa-project.org/ ALSA interface]
  

Revision as of 16:08, 20 September 2007

Installation

$ make linux-menuconfig
in 'device driver/input device support' select 'event interface' as kernel part
in 'device driver/input device support' select 'touchscreen ->tsc2102' as module 
in 'device driver/spi support' select 'spi support ->freescale iMX spi' as module
in 'device driver/spi support' select 'spi support ->TSC2102 codec' as module
if the harware monitoring functions are required (Temperature, battery measurements) 
the HWMON support has to be activated:

in 'device driver/hardware monitoring support' select 'hardware monitoring support' as module

Architecture

Touchscreen (tsc2102_ts.ko) HWmon ALSA
TSC2102 Main driver (tsc2102.ko)
Linux API

Usage

First create the event0 node if not already existing:

# cat /sys/class/input/event0/dev
# 13:64
# mkdir /dev/input
# cd /dev/input/
# mknod event0 c 13 64

Then modify the touchscreen configuration file to use raw input:

# cat /etc/ts.conf
module_raw input
module pthres pmin=1
module variance delta=30
module dejitter delta=100
module linear

and now start the drivers:

# insmod /lib/modules/drivers/hwmon/hwmon.ko
# insmod /lib/modules/drivers/spi/spi_imx.ko
# insmod /lib/modules/drivers/spi/tsc2102.ko
# insmod /lib/modules/drivers/input/touchscreen/tsc2102_ts.ko

Then:

  • get temperature and voltage with hwmon (Hardware Monitoring) interface

-> ie cat /sys/bus/spi/drivers/tsc2102/spi2.0/in0_input

Quick test

To quickly check driver fonctionnality, touch the screen and check that tsc2102 interrupts count is increasing:

# cat /proc/interrupts
          CPU0
26:          0         MPU  IMX-uart
29:         17         MPU  IMX-uart
30:         22         MPU  IMX-uart
35:         12         MPU  imx-mmc
39:         14         MPU  I2C_IMX
40:         16         MPU  imx-spi.2
41:          0         MPU  imx-spi.1
59:       3682         MPU  i.MX Timer Tick
60:          0         MPU  DMA
61:          0         MPU  DMA
110:         0        GPIO  eth0
168:         0        GPIO  tsc2102
Err:         0
#

Links