Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
clearpad_tm1217.c File Reference
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/input.h>
#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/i2c.h>
#include <linux/timer.h>
#include <linux/gpio.h>
#include <linux/hrtimer.h>
#include <linux/kthread.h>
#include <linux/delay.h>
#include <linux/slab.h>
#include "cp_tm1217.h"

Go to the source code of this file.

Data Structures

struct  touch_state
 
struct  cp_dev_info
 
struct  cp_vendor_info
 
struct  cp_tm1217_device
 
struct  cp_tm1217_device::input_dev_info
 

Macros

#define CPTM1217_DEVICE_NAME   "cptm1217"
 
#define CPTM1217_DRIVER_NAME   CPTM1217_DEVICE_NAME
 
#define MAX_TOUCH_SUPPORTED   2
 
#define TOUCH_SUPPORTED   1
 
#define SAMPLING_FREQ   80 /* Frequency in HZ */
 
#define DELAY_BTWIN_SAMPLE   (1000 / SAMPLING_FREQ)
 
#define WAIT_FOR_RESPONSE   5 /* 5msec just works */
 
#define MAX_RETRIES   5 /* As above */
 
#define INCREMENTAL_DELAY   5 /* As above */
 
#define TMA1217_DEV_STATUS   0x13 /* Device Status */
 
#define TMA1217_INT_STATUS   0x14 /* Interrupt Status */
 
#define TMA1217_FINGER_STATE   0x18 /* Finger State */
 
#define TMA1217_FINGER1_X_HIGHER8   0x19 /* Higher 8 bit of X coordinate */
 
#define TMA1217_FINGER1_Y_HIGHER8   0x1A /* Higher 8 bit of Y coordinate */
 
#define TMA1217_FINGER1_XY_LOWER4   0x1B /* Lower 4 bits of X and Y */
 
#define TMA1217_FINGER1_Z_VALUE   0x1D /* 8 bit Z value for finger 1 */
 
#define TMA1217_FINGER2_X_HIGHER8   0x1E /* Higher 8 bit of X coordinate */
 
#define TMA1217_FINGER2_Y_HIGHER8   0x1F /* Higher 8 bit of Y coordinate */
 
#define TMA1217_FINGER2_XY_LOWER4   0x20 /* Lower 4 bits of X and Y */
 
#define TMA1217_FINGER2_Z_VALUE   0x22 /* 8 bit Z value for finger 2 */
 
#define TMA1217_DEVICE_CTRL   0x23 /* Device Control */
 
#define TMA1217_INTERRUPT_ENABLE   0x24 /* Interrupt Enable */
 
#define TMA1217_REPORT_MODE   0x2B /* Reporting Mode */
 
#define TMA1217_MAX_X_LOWER8   0x31 /* Bit 0-7 for Max X */
 
#define TMA1217_MAX_X_HIGHER4   0x32 /* Bit 8-11 for Max X */
 
#define TMA1217_MAX_Y_LOWER8   0x33 /* Bit 0-7 for Max Y */
 
#define TMA1217_MAX_Y_HIGHER4   0x34 /* Bit 8-11 for Max Y */
 
#define TMA1217_DEVICE_CMD_RESET   0x67 /* Device CMD reg for reset */
 
#define TMA1217_DEVICE_CMD_REZERO   0x69 /* Device CMD reg for rezero */
 
#define TMA1217_MANUFACTURER_ID   0x73 /* Manufacturer Id */
 
#define TMA1217_PRODUCT_FAMILY   0x75 /* Product Family */
 
#define TMA1217_FIRMWARE_REVISION   0x76 /* Firmware Revision */
 
#define TMA1217_SERIAL_NO_HIGH   0x7C /* Bit 8-15 of device serial no. */
 
#define TMA1217_SERIAL_NO_LOW   0x7D /* Bit 0-7 of device serial no. */
 
#define TMA1217_PRODUCT_ID_START   0x7E /* Start address for 10 byte ID */
 
#define TMA1217_DEVICE_CAPABILITY   0x8B /* Reporting capability */
 

Functions

 MODULE_DEVICE_TABLE (i2c, cp_tm1217_idtable)
 
 module_i2c_driver (cp_tm1217_driver)
 
 MODULE_AUTHOR ("Ramesh Agarwal <[email protected]>")
 
 MODULE_DESCRIPTION ("Synaptics TM1217 TouchScreen Driver")
 
 MODULE_LICENSE ("GPL v2")
 

Macro Definition Documentation

#define CPTM1217_DEVICE_NAME   "cptm1217"

Definition at line 40 of file clearpad_tm1217.c.

#define CPTM1217_DRIVER_NAME   CPTM1217_DEVICE_NAME

Definition at line 41 of file clearpad_tm1217.c.

#define DELAY_BTWIN_SAMPLE   (1000 / SAMPLING_FREQ)

Definition at line 46 of file clearpad_tm1217.c.

#define INCREMENTAL_DELAY   5 /* As above */

Definition at line 49 of file clearpad_tm1217.c.

#define MAX_RETRIES   5 /* As above */

Definition at line 48 of file clearpad_tm1217.c.

#define MAX_TOUCH_SUPPORTED   2

Definition at line 43 of file clearpad_tm1217.c.

#define SAMPLING_FREQ   80 /* Frequency in HZ */

Definition at line 45 of file clearpad_tm1217.c.

#define TMA1217_DEV_STATUS   0x13 /* Device Status */

Definition at line 52 of file clearpad_tm1217.c.

#define TMA1217_DEVICE_CAPABILITY   0x8B /* Reporting capability */

Definition at line 83 of file clearpad_tm1217.c.

#define TMA1217_DEVICE_CMD_RESET   0x67 /* Device CMD reg for reset */

Definition at line 74 of file clearpad_tm1217.c.

#define TMA1217_DEVICE_CMD_REZERO   0x69 /* Device CMD reg for rezero */

Definition at line 75 of file clearpad_tm1217.c.

#define TMA1217_DEVICE_CTRL   0x23 /* Device Control */

Definition at line 67 of file clearpad_tm1217.c.

#define TMA1217_FINGER1_X_HIGHER8   0x19 /* Higher 8 bit of X coordinate */

Definition at line 59 of file clearpad_tm1217.c.

#define TMA1217_FINGER1_XY_LOWER4   0x1B /* Lower 4 bits of X and Y */

Definition at line 61 of file clearpad_tm1217.c.

#define TMA1217_FINGER1_Y_HIGHER8   0x1A /* Higher 8 bit of Y coordinate */

Definition at line 60 of file clearpad_tm1217.c.

#define TMA1217_FINGER1_Z_VALUE   0x1D /* 8 bit Z value for finger 1 */

Definition at line 62 of file clearpad_tm1217.c.

#define TMA1217_FINGER2_X_HIGHER8   0x1E /* Higher 8 bit of X coordinate */

Definition at line 63 of file clearpad_tm1217.c.

#define TMA1217_FINGER2_XY_LOWER4   0x20 /* Lower 4 bits of X and Y */

Definition at line 65 of file clearpad_tm1217.c.

#define TMA1217_FINGER2_Y_HIGHER8   0x1F /* Higher 8 bit of Y coordinate */

Definition at line 64 of file clearpad_tm1217.c.

#define TMA1217_FINGER2_Z_VALUE   0x22 /* 8 bit Z value for finger 2 */

Definition at line 66 of file clearpad_tm1217.c.

#define TMA1217_FINGER_STATE   0x18 /* Finger State */

Definition at line 58 of file clearpad_tm1217.c.

#define TMA1217_FIRMWARE_REVISION   0x76 /* Firmware Revision */

Definition at line 79 of file clearpad_tm1217.c.

#define TMA1217_INT_STATUS   0x14 /* Interrupt Status */

Definition at line 53 of file clearpad_tm1217.c.

#define TMA1217_INTERRUPT_ENABLE   0x24 /* Interrupt Enable */

Definition at line 68 of file clearpad_tm1217.c.

#define TMA1217_MANUFACTURER_ID   0x73 /* Manufacturer Id */

Definition at line 77 of file clearpad_tm1217.c.

#define TMA1217_MAX_X_HIGHER4   0x32 /* Bit 8-11 for Max X */

Definition at line 71 of file clearpad_tm1217.c.

#define TMA1217_MAX_X_LOWER8   0x31 /* Bit 0-7 for Max X */

Definition at line 70 of file clearpad_tm1217.c.

#define TMA1217_MAX_Y_HIGHER4   0x34 /* Bit 8-11 for Max Y */

Definition at line 73 of file clearpad_tm1217.c.

#define TMA1217_MAX_Y_LOWER8   0x33 /* Bit 0-7 for Max Y */

Definition at line 72 of file clearpad_tm1217.c.

#define TMA1217_PRODUCT_FAMILY   0x75 /* Product Family */

Definition at line 78 of file clearpad_tm1217.c.

#define TMA1217_PRODUCT_ID_START   0x7E /* Start address for 10 byte ID */

Definition at line 82 of file clearpad_tm1217.c.

#define TMA1217_REPORT_MODE   0x2B /* Reporting Mode */

Definition at line 69 of file clearpad_tm1217.c.

#define TMA1217_SERIAL_NO_HIGH   0x7C /* Bit 8-15 of device serial no. */

Definition at line 80 of file clearpad_tm1217.c.

#define TMA1217_SERIAL_NO_LOW   0x7D /* Bit 0-7 of device serial no. */

Definition at line 81 of file clearpad_tm1217.c.

#define TOUCH_SUPPORTED   1

Definition at line 44 of file clearpad_tm1217.c.

#define WAIT_FOR_RESPONSE   5 /* 5msec just works */

Definition at line 47 of file clearpad_tm1217.c.

Function Documentation

MODULE_AUTHOR ( "Ramesh Agarwal <[email protected]>"  )
MODULE_DESCRIPTION ( "Synaptics TM1217 TouchScreen Driver"  )
MODULE_DEVICE_TABLE ( i2c  ,
cp_tm1217_idtable   
)
module_i2c_driver ( cp_tm1217_driver  )
MODULE_LICENSE ( "GPL v2 )