Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions
mcs5000_ts.c File Reference
#include <linux/module.h>
#include <linux/init.h>
#include <linux/i2c.h>
#include <linux/i2c/mcs.h>
#include <linux/interrupt.h>
#include <linux/input.h>
#include <linux/irq.h>
#include <linux/slab.h>

Go to the source code of this file.

Data Structures

struct  mcs5000_ts_data
 

Macros

#define MCS5000_TS_STATUS   0x00
 
#define STATUS_OFFSET   0
 
#define STATUS_NO   (0 << STATUS_OFFSET)
 
#define STATUS_INIT   (1 << STATUS_OFFSET)
 
#define STATUS_SENSING   (2 << STATUS_OFFSET)
 
#define STATUS_COORD   (3 << STATUS_OFFSET)
 
#define STATUS_GESTURE   (4 << STATUS_OFFSET)
 
#define ERROR_OFFSET   4
 
#define ERROR_NO   (0 << ERROR_OFFSET)
 
#define ERROR_POWER_ON_RESET   (1 << ERROR_OFFSET)
 
#define ERROR_INT_RESET   (2 << ERROR_OFFSET)
 
#define ERROR_EXT_RESET   (3 << ERROR_OFFSET)
 
#define ERROR_INVALID_REG_ADDRESS   (8 << ERROR_OFFSET)
 
#define ERROR_INVALID_REG_VALUE   (9 << ERROR_OFFSET)
 
#define MCS5000_TS_OP_MODE   0x01
 
#define RESET_OFFSET   0
 
#define RESET_NO   (0 << RESET_OFFSET)
 
#define RESET_EXT_SOFT   (1 << RESET_OFFSET)
 
#define OP_MODE_OFFSET   1
 
#define OP_MODE_SLEEP   (0 << OP_MODE_OFFSET)
 
#define OP_MODE_ACTIVE   (1 << OP_MODE_OFFSET)
 
#define GESTURE_OFFSET   4
 
#define GESTURE_DISABLE   (0 << GESTURE_OFFSET)
 
#define GESTURE_ENABLE   (1 << GESTURE_OFFSET)
 
#define PROXIMITY_OFFSET   5
 
#define PROXIMITY_DISABLE   (0 << PROXIMITY_OFFSET)
 
#define PROXIMITY_ENABLE   (1 << PROXIMITY_OFFSET)
 
#define SCAN_MODE_OFFSET   6
 
#define SCAN_MODE_INTERRUPT   (0 << SCAN_MODE_OFFSET)
 
#define SCAN_MODE_POLLING   (1 << SCAN_MODE_OFFSET)
 
#define REPORT_RATE_OFFSET   7
 
#define REPORT_RATE_40   (0 << REPORT_RATE_OFFSET)
 
#define REPORT_RATE_80   (1 << REPORT_RATE_OFFSET)
 
#define MCS5000_TS_SENS_CTL   0x02
 
#define MCS5000_TS_FILTER_CTL   0x03
 
#define PRI_FILTER_OFFSET   0
 
#define SEC_FILTER_OFFSET   4
 
#define MCS5000_TS_X_SIZE_UPPER   0x08
 
#define MCS5000_TS_X_SIZE_LOWER   0x09
 
#define MCS5000_TS_Y_SIZE_UPPER   0x0A
 
#define MCS5000_TS_Y_SIZE_LOWER   0x0B
 
#define MCS5000_TS_INPUT_INFO   0x10
 
#define INPUT_TYPE_OFFSET   0
 
#define INPUT_TYPE_NONTOUCH   (0 << INPUT_TYPE_OFFSET)
 
#define INPUT_TYPE_SINGLE   (1 << INPUT_TYPE_OFFSET)
 
#define INPUT_TYPE_DUAL   (2 << INPUT_TYPE_OFFSET)
 
#define INPUT_TYPE_PALM   (3 << INPUT_TYPE_OFFSET)
 
#define INPUT_TYPE_PROXIMITY   (7 << INPUT_TYPE_OFFSET)
 
#define GESTURE_CODE_OFFSET   3
 
#define GESTURE_CODE_NO   (0 << GESTURE_CODE_OFFSET)
 
#define MCS5000_TS_X_POS_UPPER   0x11
 
#define MCS5000_TS_X_POS_LOWER   0x12
 
#define MCS5000_TS_Y_POS_UPPER   0x13
 
#define MCS5000_TS_Y_POS_LOWER   0x14
 
#define MCS5000_TS_Z_POS   0x15
 
#define MCS5000_TS_WIDTH   0x16
 
#define MCS5000_TS_GESTURE_VAL   0x17
 
#define MCS5000_TS_MODULE_REV   0x20
 
#define MCS5000_TS_FIRMWARE_VER   0x21
 
#define MCS5000_MAX_XC   0x3ff
 
#define MCS5000_MAX_YC   0x3ff
 

Enumerations

enum  mcs5000_ts_read_offset {
  READ_INPUT_INFO, READ_X_POS_UPPER, READ_X_POS_LOWER, READ_Y_POS_UPPER,
  READ_Y_POS_LOWER, READ_BLOCK_SIZE
}
 

Functions

 MODULE_DEVICE_TABLE (i2c, mcs5000_ts_id)
 
 module_i2c_driver (mcs5000_ts_driver)
 
 MODULE_AUTHOR ("Joonyoung Shim <[email protected]>")
 
 MODULE_DESCRIPTION ("Touchscreen driver for MELFAS MCS-5000 controller")
 
 MODULE_LICENSE ("GPL")
 

Macro Definition Documentation

#define ERROR_EXT_RESET   (3 << ERROR_OFFSET)

Definition at line 37 of file mcs5000_ts.c.

#define ERROR_INT_RESET   (2 << ERROR_OFFSET)

Definition at line 36 of file mcs5000_ts.c.

#define ERROR_INVALID_REG_ADDRESS   (8 << ERROR_OFFSET)

Definition at line 38 of file mcs5000_ts.c.

#define ERROR_INVALID_REG_VALUE   (9 << ERROR_OFFSET)

Definition at line 39 of file mcs5000_ts.c.

#define ERROR_NO   (0 << ERROR_OFFSET)

Definition at line 34 of file mcs5000_ts.c.

#define ERROR_OFFSET   4

Definition at line 33 of file mcs5000_ts.c.

#define ERROR_POWER_ON_RESET   (1 << ERROR_OFFSET)

Definition at line 35 of file mcs5000_ts.c.

#define GESTURE_CODE_NO   (0 << GESTURE_CODE_OFFSET)

Definition at line 79 of file mcs5000_ts.c.

#define GESTURE_CODE_OFFSET   3

Definition at line 78 of file mcs5000_ts.c.

#define GESTURE_DISABLE   (0 << GESTURE_OFFSET)

Definition at line 49 of file mcs5000_ts.c.

#define GESTURE_ENABLE   (1 << GESTURE_OFFSET)

Definition at line 50 of file mcs5000_ts.c.

#define GESTURE_OFFSET   4

Definition at line 48 of file mcs5000_ts.c.

#define INPUT_TYPE_DUAL   (2 << INPUT_TYPE_OFFSET)

Definition at line 75 of file mcs5000_ts.c.

#define INPUT_TYPE_NONTOUCH   (0 << INPUT_TYPE_OFFSET)

Definition at line 73 of file mcs5000_ts.c.

#define INPUT_TYPE_OFFSET   0

Definition at line 72 of file mcs5000_ts.c.

#define INPUT_TYPE_PALM   (3 << INPUT_TYPE_OFFSET)

Definition at line 76 of file mcs5000_ts.c.

#define INPUT_TYPE_PROXIMITY   (7 << INPUT_TYPE_OFFSET)

Definition at line 77 of file mcs5000_ts.c.

#define INPUT_TYPE_SINGLE   (1 << INPUT_TYPE_OFFSET)

Definition at line 74 of file mcs5000_ts.c.

#define MCS5000_MAX_XC   0x3ff

Definition at line 92 of file mcs5000_ts.c.

#define MCS5000_MAX_YC   0x3ff

Definition at line 93 of file mcs5000_ts.c.

#define MCS5000_TS_FILTER_CTL   0x03

Definition at line 62 of file mcs5000_ts.c.

#define MCS5000_TS_FIRMWARE_VER   0x21

Definition at line 89 of file mcs5000_ts.c.

#define MCS5000_TS_GESTURE_VAL   0x17

Definition at line 87 of file mcs5000_ts.c.

#define MCS5000_TS_INPUT_INFO   0x10

Definition at line 71 of file mcs5000_ts.c.

#define MCS5000_TS_MODULE_REV   0x20

Definition at line 88 of file mcs5000_ts.c.

#define MCS5000_TS_OP_MODE   0x01

Definition at line 41 of file mcs5000_ts.c.

#define MCS5000_TS_SENS_CTL   0x02

Definition at line 61 of file mcs5000_ts.c.

#define MCS5000_TS_STATUS   0x00

Definition at line 26 of file mcs5000_ts.c.

#define MCS5000_TS_WIDTH   0x16

Definition at line 86 of file mcs5000_ts.c.

#define MCS5000_TS_X_POS_LOWER   0x12

Definition at line 82 of file mcs5000_ts.c.

#define MCS5000_TS_X_POS_UPPER   0x11

Definition at line 81 of file mcs5000_ts.c.

#define MCS5000_TS_X_SIZE_LOWER   0x09

Definition at line 67 of file mcs5000_ts.c.

#define MCS5000_TS_X_SIZE_UPPER   0x08

Definition at line 66 of file mcs5000_ts.c.

#define MCS5000_TS_Y_POS_LOWER   0x14

Definition at line 84 of file mcs5000_ts.c.

#define MCS5000_TS_Y_POS_UPPER   0x13

Definition at line 83 of file mcs5000_ts.c.

#define MCS5000_TS_Y_SIZE_LOWER   0x0B

Definition at line 69 of file mcs5000_ts.c.

#define MCS5000_TS_Y_SIZE_UPPER   0x0A

Definition at line 68 of file mcs5000_ts.c.

#define MCS5000_TS_Z_POS   0x15

Definition at line 85 of file mcs5000_ts.c.

#define OP_MODE_ACTIVE   (1 << OP_MODE_OFFSET)

Definition at line 47 of file mcs5000_ts.c.

#define OP_MODE_OFFSET   1

Definition at line 45 of file mcs5000_ts.c.

#define OP_MODE_SLEEP   (0 << OP_MODE_OFFSET)

Definition at line 46 of file mcs5000_ts.c.

#define PRI_FILTER_OFFSET   0

Definition at line 63 of file mcs5000_ts.c.

#define PROXIMITY_DISABLE   (0 << PROXIMITY_OFFSET)

Definition at line 52 of file mcs5000_ts.c.

#define PROXIMITY_ENABLE   (1 << PROXIMITY_OFFSET)

Definition at line 53 of file mcs5000_ts.c.

#define PROXIMITY_OFFSET   5

Definition at line 51 of file mcs5000_ts.c.

#define REPORT_RATE_40   (0 << REPORT_RATE_OFFSET)

Definition at line 58 of file mcs5000_ts.c.

#define REPORT_RATE_80   (1 << REPORT_RATE_OFFSET)

Definition at line 59 of file mcs5000_ts.c.

#define REPORT_RATE_OFFSET   7

Definition at line 57 of file mcs5000_ts.c.

#define RESET_EXT_SOFT   (1 << RESET_OFFSET)

Definition at line 44 of file mcs5000_ts.c.

#define RESET_NO   (0 << RESET_OFFSET)

Definition at line 43 of file mcs5000_ts.c.

#define RESET_OFFSET   0

Definition at line 42 of file mcs5000_ts.c.

#define SCAN_MODE_INTERRUPT   (0 << SCAN_MODE_OFFSET)

Definition at line 55 of file mcs5000_ts.c.

#define SCAN_MODE_OFFSET   6

Definition at line 54 of file mcs5000_ts.c.

#define SCAN_MODE_POLLING   (1 << SCAN_MODE_OFFSET)

Definition at line 56 of file mcs5000_ts.c.

#define SEC_FILTER_OFFSET   4

Definition at line 64 of file mcs5000_ts.c.

#define STATUS_COORD   (3 << STATUS_OFFSET)

Definition at line 31 of file mcs5000_ts.c.

#define STATUS_GESTURE   (4 << STATUS_OFFSET)

Definition at line 32 of file mcs5000_ts.c.

#define STATUS_INIT   (1 << STATUS_OFFSET)

Definition at line 29 of file mcs5000_ts.c.

#define STATUS_NO   (0 << STATUS_OFFSET)

Definition at line 28 of file mcs5000_ts.c.

#define STATUS_OFFSET   0

Definition at line 27 of file mcs5000_ts.c.

#define STATUS_SENSING   (2 << STATUS_OFFSET)

Definition at line 30 of file mcs5000_ts.c.

Enumeration Type Documentation

Enumerator:
READ_INPUT_INFO 
READ_X_POS_UPPER 
READ_X_POS_LOWER 
READ_Y_POS_UPPER 
READ_Y_POS_LOWER 
READ_BLOCK_SIZE 

Definition at line 95 of file mcs5000_ts.c.

Function Documentation

MODULE_AUTHOR ( "Joonyoung Shim <[email protected]>"  )
MODULE_DESCRIPTION ( "Touchscreen driver for MELFAS MCS-5000 controller )
MODULE_DEVICE_TABLE ( i2c  ,
mcs5000_ts_id   
)
module_i2c_driver ( mcs5000_ts_driver  )
MODULE_LICENSE ( "GPL"  )