Difference between revisions of "TSC2102 Linux driver"

From ArmadeusWiki
Jump to: navigation, search
m (Usage)
m (Usage)
 
(18 intermediate revisions by 3 users not shown)
Line 1: Line 1:
This page details the installation and the usage of the Linux drivers for the [[TSC2102|TSC2102 touchscreen & sound chip]]. Sound (ALSA) specific part [[ALSA|can be found here.]]
+
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.]]
  
 
==Driver Installation==
 
==Driver Installation==
'''Drivers are now installed by default in standard Armadeus rootfs.''' Following instructions are only given as references or if you want to remove these drivers from your configuration.
+
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).
 
+
<pre class="host">
+
$ make linux26-menuconfig
+
</pre>
+
<pre class="config">
+
Device Drivers  --->
+
    Input device support  --->
+
        <*>  Event interface
+
        ...
+
        [*]  Touchscreens  --->
+
            <M>  TSC 2102 based touchscreens
+
    ...
+
    SPI support  --->
+
        <M> Freescale iMX SPI controller
+
        --- TSC2102 codec support
+
    ...
+
    <M> Hardware Monitoring support
+
</pre>
+
<pre class="host">
+
$ make
+
</pre>
+
 
+
Then reflash your Linux kernel and your Rootfs...
+
  
 
==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==
* load all the needed drivers:
+
* Load all the needed drivers:
 
<pre class="apf">
 
<pre class="apf">
 
  # modprobe tsc2102_ts
 
  # modprobe tsc2102_ts
TI TSC2102 driver initializing
+
TI TSC210x driver initializing
input: TSC2102 Touchscreen as /class/input/input0
+
TSC2101 detected
TSC2102 touchscreen driver initialized
+
input: TSC210x Touchscreen as /devices/platform/mxc_spi.1/spi1.0/tsc210x-ts/input/input0
 +
TSC210x Touchscreen driver initialized
 
</pre>
 
</pre>
* To check:
+
 
 +
===Touchscreen===
 +
Before use, the touchscreen has to be (at least one time) calibrated:
 
<pre class="apf">
 
<pre class="apf">
  # lsmod
+
  # ts_calibrate
Module                  Size  Used by    Not tainted
+
tsc2102_ts              1188  0
+
tsc2102                10192  3 tsc2102_ts
+
hwmon                    916  1 tsc2102
+
spi_imx                7136  0
+
 
</pre>
 
</pre>
Then, you can:
+
[[Image:Tslib_calibrate.png]]
* get temperature and voltage with [http://lxr.linux.no/source/Documentation/hwmon/sysfs-interface?v=2.6.18 hwmon] (Hardware Monitoring) interface. For example:
+
 
 +
Then it can be tested with:
 
<pre class="apf">
 
<pre class="apf">
  # cat /sys/class/hwmon/hwmon0/device/temp1_input    -- result in m°C
+
  # ts_test
 
</pre>
 
</pre>
* play sounds through [[ALSA| ALSA interface]]
+
[[Image:Tslib_test.png]]
* use touchscreen with [[Tslib]]
+
  
==Quick test==
+
If it does not work you can quickly check driver functionality; touch the screen and check that tsc2102 interrupts count is increasing:
To quickly check driver fonctionnality, touch the screen and check that tsc2102 interrupts count is increasing:
+
 
<pre class="apf">
 
<pre class="apf">
 
  # cat /proc/interrupts
 
  # cat /proc/interrupts
Line 84: Line 50:
 
  #
 
  #
 
</pre>
 
</pre>
then you can start the Tslib/touchscreen calibration tool:
+
 
 +
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">
 
<pre class="apf">
  # /usr/bin/ts_calibrate
+
  # modprobe hwmon
 +
# cat /sys/class/hwmon/hwmon0/device/temp1_input        -- result in m°C
 
</pre>
 
</pre>
[[tslib | To know more about Tslib configuration]] (if the default one doesn't suite you).
 
  
 
==Links==
 
==Links==
Line 100: Line 74:
  
 
[[Category:Linux drivers]]
 
[[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