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

Go to the source code of this file.

Data Structures

struct  synaptics_i2c
 

Macros

#define DRIVER_NAME   "synaptics_i2c"
 
#define PRODUCT_ID_LENGTH   15
 
#define REGISTER_LENGTH   8
 
#define SOFT_RESET_DELAY_MS   3
 
#define HARD_RESET_DELAY_MS   500
 
#define PAGE_SEL_REG   0xff
 
#define DEVICE_STATUS_REG   0x09
 
#define DEV_CONTROL_REG   0x0000
 
#define INTERRUPT_EN_REG   0x0001
 
#define ERR_STAT_REG   0x0002
 
#define INT_REQ_STAT_REG   0x0003
 
#define DEV_COMMAND_REG   0x0004
 
#define RMI_PROT_VER_REG   0x0200
 
#define MANUFACT_ID_REG   0x0201
 
#define PHYS_INT_VER_REG   0x0202
 
#define PROD_PROPERTY_REG   0x0203
 
#define INFO_QUERY_REG0   0x0204
 
#define INFO_QUERY_REG1   (INFO_QUERY_REG0 + 1)
 
#define INFO_QUERY_REG2   (INFO_QUERY_REG0 + 2)
 
#define INFO_QUERY_REG3   (INFO_QUERY_REG0 + 3)
 
#define PRODUCT_ID_REG0   0x0210
 
#define PRODUCT_ID_REG1   (PRODUCT_ID_REG0 + 1)
 
#define PRODUCT_ID_REG2   (PRODUCT_ID_REG0 + 2)
 
#define PRODUCT_ID_REG3   (PRODUCT_ID_REG0 + 3)
 
#define PRODUCT_ID_REG4   (PRODUCT_ID_REG0 + 4)
 
#define PRODUCT_ID_REG5   (PRODUCT_ID_REG0 + 5)
 
#define PRODUCT_ID_REG6   (PRODUCT_ID_REG0 + 6)
 
#define PRODUCT_ID_REG7   (PRODUCT_ID_REG0 + 7)
 
#define PRODUCT_ID_REG8   (PRODUCT_ID_REG0 + 8)
 
#define PRODUCT_ID_REG9   (PRODUCT_ID_REG0 + 9)
 
#define PRODUCT_ID_REG10   (PRODUCT_ID_REG0 + 10)
 
#define PRODUCT_ID_REG11   (PRODUCT_ID_REG0 + 11)
 
#define PRODUCT_ID_REG12   (PRODUCT_ID_REG0 + 12)
 
#define PRODUCT_ID_REG13   (PRODUCT_ID_REG0 + 13)
 
#define PRODUCT_ID_REG14   (PRODUCT_ID_REG0 + 14)
 
#define PRODUCT_ID_REG15   (PRODUCT_ID_REG0 + 15)
 
#define DATA_REG0   0x0400
 
#define ABS_PRESSURE_REG   0x0401
 
#define ABS_MSB_X_REG   0x0402
 
#define ABS_LSB_X_REG   (ABS_MSB_X_REG + 1)
 
#define ABS_MSB_Y_REG   0x0404
 
#define ABS_LSB_Y_REG   (ABS_MSB_Y_REG + 1)
 
#define REL_X_REG   0x0406
 
#define REL_Y_REG   0x0407
 
#define DEV_QUERY_REG0   0x1000
 
#define DEV_QUERY_REG1   (DEV_QUERY_REG0 + 1)
 
#define DEV_QUERY_REG2   (DEV_QUERY_REG0 + 2)
 
#define DEV_QUERY_REG3   (DEV_QUERY_REG0 + 3)
 
#define DEV_QUERY_REG4   (DEV_QUERY_REG0 + 4)
 
#define DEV_QUERY_REG5   (DEV_QUERY_REG0 + 5)
 
#define DEV_QUERY_REG6   (DEV_QUERY_REG0 + 6)
 
#define DEV_QUERY_REG7   (DEV_QUERY_REG0 + 7)
 
#define DEV_QUERY_REG8   (DEV_QUERY_REG0 + 8)
 
#define GENERAL_2D_CONTROL_REG   0x1041
 
#define SENSOR_SENSITIVITY_REG   0x1044
 
#define SENS_MAX_POS_MSB_REG   0x1046
 
#define SENS_MAX_POS_LSB_REG   (SENS_MAX_POS_UPPER_REG + 1)
 
#define REPORT_RATE_1ST_BIT   6
 
#define F10_ABS_INT_ENA   0
 
#define F10_REL_INT_ENA   1
 
#define F20_INT_ENA   2
 
#define F10_ABS_INT_REQ   0
 
#define F10_REL_INT_REQ   1
 
#define F20_INT_REQ   2
 
#define STAT_CONFIGURED   6
 
#define STAT_ERROR   7
 
#define RESET_COMMAND   0x01
 
#define REZERO_COMMAND   0x02
 
#define GESTURE   3
 
#define HAS_PALM_DETECT   1
 
#define HAS_MULTI_FING   2
 
#define HAS_SCROLLER   4
 
#define HAS_2D_SCROLL   5
 
#define NO_DECELERATION   1
 
#define REDUCE_REPORTING   3
 
#define NO_FILTER   5
 
#define REPORT_RATE_MSK   0xc0
 
#define SLEEP_MODE_MSK   0x07
 
#define FULL_AWAKE   0x0
 
#define NORMAL_OP   0x1
 
#define LOW_PWR_OP   0x2
 
#define VERY_LOW_PWR_OP   0x3
 
#define SENS_SLEEP   0x4
 
#define SLEEP_MOD   0x5
 
#define DEEP_SLEEP   0x6
 
#define HIBERNATE   0x7
 
#define INT_ENA_REQ_MSK   0x07
 
#define INT_ENA_ABS_MSK   0x01
 
#define INT_ENA_REL_MSK   0x02
 
#define INT_ENA_F20_MSK   0x04
 
#define CONFIGURED_MSK   0x40
 
#define ERROR_MSK   0x80
 
#define FINGER_WIDTH_MSK   0xf0
 
#define GESTURE_MSK   0x08
 
#define SENSOR_STATUS_MSK   0x07
 
#define MSB_POSITION_MSK   0x1f
 
#define NUM_EXTRA_POS_MSK   0x07
 
#define THREAD_IRQ_SLEEP_SECS   2
 
#define THREAD_IRQ_SLEEP_MSECS   (THREAD_IRQ_SLEEP_SECS * MSEC_PER_SEC)
 
#define NO_DATA_THRES   (MSEC_PER_SEC)
 
#define NO_DATA_SLEEP_MSECS   (MSEC_PER_SEC / 4)
 

Functions

 module_param (no_decel, bool, 0644)
 
 MODULE_PARM_DESC (no_decel,"No Deceleration. Default = 1 (on)")
 
 module_param (reduce_report, bool, 0644)
 
 MODULE_PARM_DESC (reduce_report,"Reduced Reporting. Default = 0 (off)")
 
 module_param (no_filter, bool, 0644)
 
 MODULE_PARM_DESC (no_filter,"No Filter. Default = 0 (off)")
 
 module_param (polling_req, bool, 0444)
 
 MODULE_PARM_DESC (polling_req,"Request Polling. Default = 0 (use irq)")
 
 module_param (scan_rate, int, 0644)
 
 MODULE_PARM_DESC (scan_rate,"Polling rate in times/sec. Default = 80")
 
 MODULE_DEVICE_TABLE (i2c, synaptics_i2c_id_table)
 
 module_i2c_driver (synaptics_i2c_driver)
 
 MODULE_DESCRIPTION ("Synaptics I2C touchpad driver")
 
 MODULE_AUTHOR ("Mike Rapoport, Igor Grinberg, Compulab")
 
 MODULE_LICENSE ("GPL")
 

Macro Definition Documentation

#define ABS_LSB_X_REG   (ABS_MSB_X_REG + 1)

Definition at line 76 of file synaptics_i2c.c.

#define ABS_LSB_Y_REG   (ABS_MSB_Y_REG + 1)

Definition at line 78 of file synaptics_i2c.c.

#define ABS_MSB_X_REG   0x0402

Definition at line 75 of file synaptics_i2c.c.

#define ABS_MSB_Y_REG   0x0404

Definition at line 77 of file synaptics_i2c.c.

#define ABS_PRESSURE_REG   0x0401

Definition at line 74 of file synaptics_i2c.c.

#define CONFIGURED_MSK   0x40

Definition at line 156 of file synaptics_i2c.c.

#define DATA_REG0   0x0400

Definition at line 73 of file synaptics_i2c.c.

#define DEEP_SLEEP   0x6

Definition at line 145 of file synaptics_i2c.c.

#define DEV_COMMAND_REG   0x0004

Definition at line 45 of file synaptics_i2c.c.

#define DEV_CONTROL_REG   0x0000

Definition at line 41 of file synaptics_i2c.c.

#define DEV_QUERY_REG0   0x1000

Definition at line 82 of file synaptics_i2c.c.

#define DEV_QUERY_REG1   (DEV_QUERY_REG0 + 1)

Definition at line 83 of file synaptics_i2c.c.

#define DEV_QUERY_REG2   (DEV_QUERY_REG0 + 2)

Definition at line 84 of file synaptics_i2c.c.

#define DEV_QUERY_REG3   (DEV_QUERY_REG0 + 3)

Definition at line 85 of file synaptics_i2c.c.

#define DEV_QUERY_REG4   (DEV_QUERY_REG0 + 4)

Definition at line 86 of file synaptics_i2c.c.

#define DEV_QUERY_REG5   (DEV_QUERY_REG0 + 5)

Definition at line 87 of file synaptics_i2c.c.

#define DEV_QUERY_REG6   (DEV_QUERY_REG0 + 6)

Definition at line 88 of file synaptics_i2c.c.

#define DEV_QUERY_REG7   (DEV_QUERY_REG0 + 7)

Definition at line 89 of file synaptics_i2c.c.

#define DEV_QUERY_REG8   (DEV_QUERY_REG0 + 8)

Definition at line 90 of file synaptics_i2c.c.

#define DEVICE_STATUS_REG   0x09

Definition at line 38 of file synaptics_i2c.c.

#define DRIVER_NAME   "synaptics_i2c"

Definition at line 23 of file synaptics_i2c.c.

#define ERR_STAT_REG   0x0002

Definition at line 43 of file synaptics_i2c.c.

#define ERROR_MSK   0x80

Definition at line 157 of file synaptics_i2c.c.

#define F10_ABS_INT_ENA   0

Definition at line 102 of file synaptics_i2c.c.

#define F10_ABS_INT_REQ   0

Definition at line 107 of file synaptics_i2c.c.

#define F10_REL_INT_ENA   1

Definition at line 103 of file synaptics_i2c.c.

#define F10_REL_INT_REQ   1

Definition at line 108 of file synaptics_i2c.c.

#define F20_INT_ENA   2

Definition at line 104 of file synaptics_i2c.c.

#define F20_INT_REQ   2

Definition at line 109 of file synaptics_i2c.c.

#define FINGER_WIDTH_MSK   0xf0

Definition at line 160 of file synaptics_i2c.c.

#define FULL_AWAKE   0x0

Definition at line 139 of file synaptics_i2c.c.

#define GENERAL_2D_CONTROL_REG   0x1041

Definition at line 92 of file synaptics_i2c.c.

#define GESTURE   3

Definition at line 119 of file synaptics_i2c.c.

#define GESTURE_MSK   0x08

Definition at line 161 of file synaptics_i2c.c.

#define HARD_RESET_DELAY_MS   500

Definition at line 34 of file synaptics_i2c.c.

#define HAS_2D_SCROLL   5

Definition at line 126 of file synaptics_i2c.c.

#define HAS_MULTI_FING   2

Definition at line 124 of file synaptics_i2c.c.

#define HAS_PALM_DETECT   1

Definition at line 123 of file synaptics_i2c.c.

#define HAS_SCROLLER   4

Definition at line 125 of file synaptics_i2c.c.

#define HIBERNATE   0x7

Definition at line 146 of file synaptics_i2c.c.

#define INFO_QUERY_REG0   0x0204

Definition at line 51 of file synaptics_i2c.c.

#define INFO_QUERY_REG1   (INFO_QUERY_REG0 + 1)

Definition at line 52 of file synaptics_i2c.c.

#define INFO_QUERY_REG2   (INFO_QUERY_REG0 + 2)

Definition at line 53 of file synaptics_i2c.c.

#define INFO_QUERY_REG3   (INFO_QUERY_REG0 + 3)

Definition at line 54 of file synaptics_i2c.c.

#define INT_ENA_ABS_MSK   0x01

Definition at line 151 of file synaptics_i2c.c.

#define INT_ENA_F20_MSK   0x04

Definition at line 153 of file synaptics_i2c.c.

#define INT_ENA_REL_MSK   0x02

Definition at line 152 of file synaptics_i2c.c.

#define INT_ENA_REQ_MSK   0x07

Definition at line 150 of file synaptics_i2c.c.

#define INT_REQ_STAT_REG   0x0003

Definition at line 44 of file synaptics_i2c.c.

#define INTERRUPT_EN_REG   0x0001

Definition at line 42 of file synaptics_i2c.c.

#define LOW_PWR_OP   0x2

Definition at line 141 of file synaptics_i2c.c.

#define MANUFACT_ID_REG   0x0201

Definition at line 48 of file synaptics_i2c.c.

#define MSB_POSITION_MSK   0x1f

Definition at line 169 of file synaptics_i2c.c.

#define NO_DATA_SLEEP_MSECS   (MSEC_PER_SEC / 4)

Definition at line 185 of file synaptics_i2c.c.

#define NO_DATA_THRES   (MSEC_PER_SEC)

Definition at line 184 of file synaptics_i2c.c.

#define NO_DECELERATION   1

Definition at line 129 of file synaptics_i2c.c.

#define NO_FILTER   5

Definition at line 131 of file synaptics_i2c.c.

#define NORMAL_OP   0x1

Definition at line 140 of file synaptics_i2c.c.

#define NUM_EXTRA_POS_MSK   0x07

Definition at line 174 of file synaptics_i2c.c.

#define PAGE_SEL_REG   0xff

Definition at line 37 of file synaptics_i2c.c.

#define PHYS_INT_VER_REG   0x0202

Definition at line 49 of file synaptics_i2c.c.

#define PROD_PROPERTY_REG   0x0203

Definition at line 50 of file synaptics_i2c.c.

#define PRODUCT_ID_LENGTH   15

Definition at line 25 of file synaptics_i2c.c.

#define PRODUCT_ID_REG0   0x0210

Definition at line 56 of file synaptics_i2c.c.

#define PRODUCT_ID_REG1   (PRODUCT_ID_REG0 + 1)

Definition at line 57 of file synaptics_i2c.c.

#define PRODUCT_ID_REG10   (PRODUCT_ID_REG0 + 10)

Definition at line 66 of file synaptics_i2c.c.

#define PRODUCT_ID_REG11   (PRODUCT_ID_REG0 + 11)

Definition at line 67 of file synaptics_i2c.c.

#define PRODUCT_ID_REG12   (PRODUCT_ID_REG0 + 12)

Definition at line 68 of file synaptics_i2c.c.

#define PRODUCT_ID_REG13   (PRODUCT_ID_REG0 + 13)

Definition at line 69 of file synaptics_i2c.c.

#define PRODUCT_ID_REG14   (PRODUCT_ID_REG0 + 14)

Definition at line 70 of file synaptics_i2c.c.

#define PRODUCT_ID_REG15   (PRODUCT_ID_REG0 + 15)

Definition at line 71 of file synaptics_i2c.c.

#define PRODUCT_ID_REG2   (PRODUCT_ID_REG0 + 2)

Definition at line 58 of file synaptics_i2c.c.

#define PRODUCT_ID_REG3   (PRODUCT_ID_REG0 + 3)

Definition at line 59 of file synaptics_i2c.c.

#define PRODUCT_ID_REG4   (PRODUCT_ID_REG0 + 4)

Definition at line 60 of file synaptics_i2c.c.

#define PRODUCT_ID_REG5   (PRODUCT_ID_REG0 + 5)

Definition at line 61 of file synaptics_i2c.c.

#define PRODUCT_ID_REG6   (PRODUCT_ID_REG0 + 6)

Definition at line 62 of file synaptics_i2c.c.

#define PRODUCT_ID_REG7   (PRODUCT_ID_REG0 + 7)

Definition at line 63 of file synaptics_i2c.c.

#define PRODUCT_ID_REG8   (PRODUCT_ID_REG0 + 8)

Definition at line 64 of file synaptics_i2c.c.

#define PRODUCT_ID_REG9   (PRODUCT_ID_REG0 + 9)

Definition at line 65 of file synaptics_i2c.c.

#define REDUCE_REPORTING   3

Definition at line 130 of file synaptics_i2c.c.

#define REGISTER_LENGTH   8

Definition at line 26 of file synaptics_i2c.c.

#define REL_X_REG   0x0406

Definition at line 79 of file synaptics_i2c.c.

#define REL_Y_REG   0x0407

Definition at line 80 of file synaptics_i2c.c.

#define REPORT_RATE_1ST_BIT   6

Definition at line 99 of file synaptics_i2c.c.

#define REPORT_RATE_MSK   0xc0

Definition at line 135 of file synaptics_i2c.c.

#define RESET_COMMAND   0x01

Definition at line 115 of file synaptics_i2c.c.

#define REZERO_COMMAND   0x02

Definition at line 116 of file synaptics_i2c.c.

#define RMI_PROT_VER_REG   0x0200

Definition at line 47 of file synaptics_i2c.c.

#define SENS_MAX_POS_LSB_REG   (SENS_MAX_POS_UPPER_REG + 1)

Definition at line 95 of file synaptics_i2c.c.

#define SENS_MAX_POS_MSB_REG   0x1046

Definition at line 94 of file synaptics_i2c.c.

#define SENS_SLEEP   0x4

Definition at line 143 of file synaptics_i2c.c.

#define SENSOR_SENSITIVITY_REG   0x1044

Definition at line 93 of file synaptics_i2c.c.

#define SENSOR_STATUS_MSK   0x07

Definition at line 162 of file synaptics_i2c.c.

#define SLEEP_MOD   0x5

Definition at line 144 of file synaptics_i2c.c.

#define SLEEP_MODE_MSK   0x07

Definition at line 136 of file synaptics_i2c.c.

#define SOFT_RESET_DELAY_MS   3

Definition at line 32 of file synaptics_i2c.c.

#define STAT_CONFIGURED   6

Definition at line 111 of file synaptics_i2c.c.

#define STAT_ERROR   7

Definition at line 112 of file synaptics_i2c.c.

#define THREAD_IRQ_SLEEP_MSECS   (THREAD_IRQ_SLEEP_SECS * MSEC_PER_SEC)

Definition at line 178 of file synaptics_i2c.c.

#define THREAD_IRQ_SLEEP_SECS   2

Definition at line 177 of file synaptics_i2c.c.

#define VERY_LOW_PWR_OP   0x3

Definition at line 142 of file synaptics_i2c.c.

Function Documentation

MODULE_AUTHOR ( "Mike  Rapoport,
Igor  Grinberg,
Compulab"   
)
MODULE_DESCRIPTION ( "Synaptics I2C touchpad driver )
MODULE_DEVICE_TABLE ( i2c  ,
synaptics_i2c_id_table   
)
module_i2c_driver ( synaptics_i2c_driver  )
MODULE_LICENSE ( "GPL"  )
module_param ( no_decel  ,
bool  ,
0644   
)
module_param ( reduce_report  ,
bool  ,
0644   
)
module_param ( no_filter  ,
bool  ,
0644   
)
module_param ( polling_req  ,
bool  ,
0444   
)
module_param ( scan_rate  ,
int  ,
0644   
)
MODULE_PARM_DESC ( no_decel  )
MODULE_PARM_DESC ( reduce_report  )
MODULE_PARM_DESC ( no_filter  )
MODULE_PARM_DESC ( polling_req  )
MODULE_PARM_DESC ( scan_rate  )