Difference between revisions of "TSC2102 Linux driver"

From ArmadeusWiki
Jump to: navigation, search
m (Usage)
 
(48 intermediate revisions by 4 users not shown)
Line 1: Line 1:
==Installation==
+
This page details the installation and the usage of the Linux drivers for the [[TSC2102|TSC210x chips]] (touch & temp/voltage control). Sound (ALSA) specific part [[ALSA|can be found here.]]
$ make linux-menuconfig
+
  
in 'device driver/input device support' select 'event interface' as kernel part
+
==Driver Installation==
in 'device driver/input device support' select 'touchscreen ->tsc2102' as module
+
These drivers are now installed by default in standard Armadeus rootfs. [[Talk:TSC2102_Linux_driver|Here]] you will find instructions to know how we configured Linux to activate these drivers (may be useful if you want to deactivate them).
 
+
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
+
 
+
in 'device driver/hardware monitoring support' select 'hardware monitoring support' as module
+
 
+
install the touchscreen API [[tslib]]
+
  
 
==Architecture==
 
==Architecture==
  
{| border="1" cellpadding="5" cellspacing="0" summary="Driver Architecture"
+
[[Image:TSC_arch.png]]
|- style="background:#efefef;"
+
! '''Touchscreen (tsc2102_ts.ko)''' || '''HWmon''' || '''ALSA'''
+
|----------------
+
| colspan="3" align="center" | TSC2102 Main driver (tsc2102.ko)
+
|----------------
+
| colspan="3" align="center" | Linux API
+
|-
+
|}
+
  
 
==Usage==
 
==Usage==
First create the event0 node if not already existing:
+
* Load all the needed drivers:
# cat /sys/class/input/event0/dev
+
<pre class="apf">
  # 13:64
+
  # modprobe tsc2102_ts
# mkdir /dev/input
+
TI TSC210x driver initializing
# cd /dev/input/
+
TSC2101 detected
# mknod event0 c 13 64
+
input: TSC210x Touchscreen as /devices/platform/mxc_spi.1/spi1.0/tsc210x-ts/input/input0
 +
TSC210x Touchscreen driver initialized
 +
</pre>
  
Then modify the touchscreen configuration file to use raw input:
+
===Touchscreen===
# cat /etc/ts.conf
+
Before use, the touchscreen has to be (at least one time) calibrated:
module_raw input
+
<pre class="apf">
module pthres pmin=1
+
  # ts_calibrate
  module variance delta=30
+
</pre>
module dejitter delta=100
+
[[Image:Tslib_calibrate.png]]
module linear
+
  
and now start the drivers:
+
Then it can be tested with:
# insmod /lib/modules/drivers/hwmon/hwmon.ko
+
<pre class="apf">
  # insmod /lib/modules/drivers/spi/spi_imx.ko
+
  # ts_test
# insmod /lib/modules/drivers/spi/tsc2102.ko
+
</pre>
# insmod /lib/modules/drivers/input/touchscreen/tsc2102_ts.ko
+
[[Image:Tslib_test.png]]
  
Then:
+
If it does not work you can quickly check driver functionality; touch the screen and check that tsc2102 interrupts count is increasing:
* get temperature and voltage with [http://lxr.linux.no/source/Documentation/hwmon/sysfs-interface?v=2.6.18 hwmon] (Hardware Monitoring) interface
+
<pre class="apf">
cat /sys/class/hwmon/hwmon0/device/in0_input
+
* play sounds through [http://www.alsa-project.org/ ALSA interface]
+
 
+
==Quick test==
+
To quickly check driver fonctionnality, touch the screen and check that tsc2102 interrupts count is increasing:
+
 
  # cat /proc/interrupts
 
  # cat /proc/interrupts
 
           CPU0
 
           CPU0
Line 66: Line 46:
 
  61:          0        MPU  DMA
 
  61:          0        MPU  DMA
 
  110:        0        GPIO  eth0
 
  110:        0        GPIO  eth0
  '''168:        0        GPIO  tsc2102'''
+
  168:        0        GPIO  tsc2102   <<<<--------
 
  Err:        0
 
  Err:        0
 
  #
 
  #
 +
</pre>
 +
 +
More informations concerning the Tslib can be found [[tslib | here]].
 +
 +
===Audio===
 +
 +
You can play sounds through [[ALSA| ALSA interface]].
 +
 +
===Miscellaneous===
 +
* get temperature and voltage with [http://lxr.linux.no/source/Documentation/hwmon/sysfs-interface?v=2.6.18 hwmon] (Hardware Monitoring) interface. For example, get board temperature from TSC210x:
 +
<pre class="apf">
 +
# modprobe hwmon
 +
# cat /sys/class/hwmon/hwmon0/device/temp1_input        -- result in m°C
 +
</pre>
  
 
==Links==
 
==Links==
* http://source.mvista.com/git/gitweb.cgi?p=linux-omap-2.6.git;a=log;t=7 (search for TSC2102)
+
* [http://source.mvista.com/git/gitweb.cgi?p=linux-omap-2.6.git;a=log;t=7 Driver for OMAP] (search for TSC2102)
 +
* [http://www.avr32linux.org/archives/kernel/2007-August/000209.html Driver for AVR32]
 
* http://osdir.com/ml/linux.ports.arm.omap/2006-08/msg00183.html
 
* http://osdir.com/ml/linux.ports.arm.omap/2006-08/msg00183.html
 
* [http://docs.blackfin.uclinux.org/doku.php?id=touchscreen Touchscreen usage on Blackfin]
 
* [http://docs.blackfin.uclinux.org/doku.php?id=touchscreen Touchscreen usage on Blackfin]
Line 77: Line 72:
 
* http://www.opentom.org/Tslib
 
* http://www.opentom.org/Tslib
 
* http://www.openembedded.org/filebrowser/org.openembedded.packaged-staging/packages/tslib
 
* http://www.openembedded.org/filebrowser/org.openembedded.packaged-staging/packages/tslib
 +
 +
[[Category:Linux drivers]]
 +
[[Category:Touchscreen]]

Latest revision as of 01:45, 10 August 2011

This page details the installation and the usage of the Linux drivers for the TSC210x chips (touch & temp/voltage control). Sound (ALSA) specific part can be found here.

Driver Installation

These drivers are now installed by default in standard Armadeus rootfs. Here you will find instructions to know how we configured Linux to activate these drivers (may be useful if you want to deactivate them).

Architecture

TSC arch.png

Usage

  • Load all the needed drivers:
 # modprobe tsc2102_ts
TI TSC210x driver initializing
TSC2101 detected
input: TSC210x Touchscreen as /devices/platform/mxc_spi.1/spi1.0/tsc210x-ts/input/input0
TSC210x Touchscreen driver initialized

Touchscreen

Before use, the touchscreen has to be (at least one time) calibrated:

 # ts_calibrate

Tslib calibrate.png

Then it can be tested with:

 # ts_test

Tslib test.png

If it does not work you can quickly check driver functionality; 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
 #

More informations concerning the Tslib can be found here.

Audio

You can play sounds through ALSA interface.

Miscellaneous

  • get temperature and voltage with hwmon (Hardware Monitoring) interface. For example, get board temperature from TSC210x:
 # modprobe hwmon
 # cat /sys/class/hwmon/hwmon0/device/temp1_input         -- result in m°C

Links