Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
tsc2005.c File Reference
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/input.h>
#include <linux/interrupt.h>
#include <linux/delay.h>
#include <linux/pm.h>
#include <linux/spi/spi.h>
#include <linux/spi/tsc2005.h>

Go to the source code of this file.

Data Structures

struct  tsc2005_spi_rd
 
struct  tsc2005
 

Macros

#define TSC2005_CMD   0x80
 
#define TSC2005_CMD_NORMAL   0x00
 
#define TSC2005_CMD_STOP   0x01
 
#define TSC2005_CMD_12BIT   0x04
 
#define TSC2005_REG_READ   0x0001
 
#define TSC2005_REG_PND0   0x0002
 
#define TSC2005_REG_X   0x0000
 
#define TSC2005_REG_Y   0x0008
 
#define TSC2005_REG_Z1   0x0010
 
#define TSC2005_REG_Z2   0x0018
 
#define TSC2005_REG_TEMP_HIGH   0x0050
 
#define TSC2005_REG_CFR0   0x0060
 
#define TSC2005_REG_CFR1   0x0068
 
#define TSC2005_REG_CFR2   0x0070
 
#define TSC2005_CFR0_PRECHARGE_276US   0x0040
 
#define TSC2005_CFR0_STABTIME_1MS   0x0300
 
#define TSC2005_CFR0_CLOCK_1MHZ   0x1000
 
#define TSC2005_CFR0_RESOLUTION12   0x2000
 
#define TSC2005_CFR0_PENMODE   0x8000
 
#define TSC2005_CFR0_INITVALUE
 
#define TSC2005_CFR0_RW_MASK   0x3fff
 
#define TSC2005_CFR1_BATCHDELAY_4MS   0x0003
 
#define TSC2005_CFR1_INITVALUE   TSC2005_CFR1_BATCHDELAY_4MS
 
#define TSC2005_CFR2_MAVE_Z   0x0004
 
#define TSC2005_CFR2_MAVE_Y   0x0008
 
#define TSC2005_CFR2_MAVE_X   0x0010
 
#define TSC2005_CFR2_AVG_7   0x0800
 
#define TSC2005_CFR2_MEDIUM_15   0x3000
 
#define TSC2005_CFR2_INITVALUE
 
#define MAX_12BIT   0xfff
 
#define TSC2005_SPI_MAX_SPEED_HZ   10000000
 
#define TSC2005_PENUP_TIME_MS   40
 

Functions

 module_spi_driver (tsc2005_driver)
 
 MODULE_AUTHOR ("Lauri Leukkunen <[email protected]>")
 
 MODULE_DESCRIPTION ("TSC2005 Touchscreen Driver")
 
 MODULE_LICENSE ("GPL")
 

Macro Definition Documentation

#define MAX_12BIT   0xfff

Definition at line 102 of file tsc2005.c.

#define TSC2005_CFR0_CLOCK_1MHZ   0x1000

Definition at line 74 of file tsc2005.c.

#define TSC2005_CFR0_INITVALUE
Value:
TSC2005_CFR0_CLOCK_1MHZ | \
TSC2005_CFR0_RESOLUTION12 | \
TSC2005_CFR0_PRECHARGE_276US | \
TSC2005_CFR0_PENMODE)

Definition at line 77 of file tsc2005.c.

#define TSC2005_CFR0_PENMODE   0x8000

Definition at line 76 of file tsc2005.c.

#define TSC2005_CFR0_PRECHARGE_276US   0x0040

Definition at line 72 of file tsc2005.c.

#define TSC2005_CFR0_RESOLUTION12   0x2000

Definition at line 75 of file tsc2005.c.

#define TSC2005_CFR0_RW_MASK   0x3fff

Definition at line 84 of file tsc2005.c.

#define TSC2005_CFR0_STABTIME_1MS   0x0300

Definition at line 73 of file tsc2005.c.

#define TSC2005_CFR1_BATCHDELAY_4MS   0x0003

Definition at line 87 of file tsc2005.c.

#define TSC2005_CFR1_INITVALUE   TSC2005_CFR1_BATCHDELAY_4MS

Definition at line 88 of file tsc2005.c.

#define TSC2005_CFR2_AVG_7   0x0800

Definition at line 94 of file tsc2005.c.

#define TSC2005_CFR2_INITVALUE
Value:
TSC2005_CFR2_MAVE_Y | \
TSC2005_CFR2_MAVE_Z | \
TSC2005_CFR2_MEDIUM_15 | \
TSC2005_CFR2_AVG_7)

Definition at line 96 of file tsc2005.c.

#define TSC2005_CFR2_MAVE_X   0x0010

Definition at line 93 of file tsc2005.c.

#define TSC2005_CFR2_MAVE_Y   0x0008

Definition at line 92 of file tsc2005.c.

#define TSC2005_CFR2_MAVE_Z   0x0004

Definition at line 91 of file tsc2005.c.

#define TSC2005_CFR2_MEDIUM_15   0x3000

Definition at line 95 of file tsc2005.c.

#define TSC2005_CMD   0x80

Definition at line 54 of file tsc2005.c.

#define TSC2005_CMD_12BIT   0x04

Definition at line 57 of file tsc2005.c.

#define TSC2005_CMD_NORMAL   0x00

Definition at line 55 of file tsc2005.c.

#define TSC2005_CMD_STOP   0x01

Definition at line 56 of file tsc2005.c.

#define TSC2005_PENUP_TIME_MS   40

Definition at line 104 of file tsc2005.c.

#define TSC2005_REG_CFR0   0x0060

Definition at line 67 of file tsc2005.c.

#define TSC2005_REG_CFR1   0x0068

Definition at line 68 of file tsc2005.c.

#define TSC2005_REG_CFR2   0x0070

Definition at line 69 of file tsc2005.c.

#define TSC2005_REG_PND0   0x0002

Definition at line 61 of file tsc2005.c.

#define TSC2005_REG_READ   0x0001

Definition at line 60 of file tsc2005.c.

#define TSC2005_REG_TEMP_HIGH   0x0050

Definition at line 66 of file tsc2005.c.

#define TSC2005_REG_X   0x0000

Definition at line 62 of file tsc2005.c.

#define TSC2005_REG_Y   0x0008

Definition at line 63 of file tsc2005.c.

#define TSC2005_REG_Z1   0x0010

Definition at line 64 of file tsc2005.c.

#define TSC2005_REG_Z2   0x0018

Definition at line 65 of file tsc2005.c.

#define TSC2005_SPI_MAX_SPEED_HZ   10000000

Definition at line 103 of file tsc2005.c.

Function Documentation

MODULE_AUTHOR ( "Lauri Leukkunen <[email protected]>"  )
MODULE_DESCRIPTION ( "TSC2005 Touchscreen Driver"  )
MODULE_LICENSE ( "GPL"  )
module_spi_driver ( tsc2005_driver  )