Difference between revisions of "TSC2102 Linux driver"

From ArmadeusWiki
Jump to: navigation, search
m (Driver Installation)
m (Usage)
Line 41: Line 41:
 
==Usage==
 
==Usage==
 
* load all the needed drivers:
 
* load all the needed drivers:
 
+
<pre class="apf">
 
  # modprobe spi_imx
 
  # modprobe spi_imx
 
  # modprobe tsc2102_ts
 
  # modprobe tsc2102_ts
Line 47: Line 47:
 
  input: TSC2102 Touchscreen as /class/input/input0
 
  input: TSC2102 Touchscreen as /class/input/input0
 
  TSC2102 touchscreen driver initialized
 
  TSC2102 touchscreen driver initialized
 
+
</pre>
 
* To check:
 
* To check:
 +
<pre class="apf">
 
  # lsmod
 
  # lsmod
 
  Module                  Size  Used by    Not tainted
 
  Module                  Size  Used by    Not tainted
Line 55: Line 56:
 
  hwmon                    916  1 tsc2102
 
  hwmon                    916  1 tsc2102
 
  spi_imx                7136  0
 
  spi_imx                7136  0
 
+
</pre>
 
Then, you can:
 
Then, you can:
 
* 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 temperature and voltage with [http://lxr.linux.no/source/Documentation/hwmon/sysfs-interface?v=2.6.18 hwmon] (Hardware Monitoring) interface. For example:
 +
<pre class="apf">
 
  # cat /sys/class/hwmon/hwmon0/device/temp1_input    -- result in m°C
 
  # cat /sys/class/hwmon/hwmon0/device/temp1_input    -- result in m°C
 +
</pre>
 
* play sounds through [[ALSA| ALSA interface]]
 
* play sounds through [[ALSA| ALSA interface]]
 
* use touchscreen with [[Tslib]]
 
* use touchscreen with [[Tslib]]

Revision as of 08:06, 6 February 2009

This page details the installation and the usage of the Linux drivers for the TSC2102 touchscreen & sound chip. Sound (ALSA) specific part can be found here.

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.

 $ make linux26-menuconfig
 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
 $ make

Then reflash your Linux kernel and your Rootfs...

Architecture

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

Usage

  • load all the needed drivers:
 # modprobe spi_imx
 # modprobe tsc2102_ts
 TI TSC2102 driver initializing
 input: TSC2102 Touchscreen as /class/input/input0
 TSC2102 touchscreen driver initialized
  • To check:
 # lsmod
 Module                  Size  Used by    Not tainted
 tsc2102_ts              1188  0
 tsc2102                10192  3 tsc2102_ts
 hwmon                    916  1 tsc2102
 spi_imx                 7136  0

Then, you can:

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

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
#

then you can start the Tslib/touchscreen calibration tool:

# /usr/bin/ts_calibrate

To know more about Tslib configuration (if the default one doesn't suite you).

Links