1 #include <linux/module.h>
2 #include <linux/init.h>
3 #include <linux/kernel.h>
4 #include <linux/input.h>
6 #include <linux/interrupt.h>
7 #include <linux/slab.h>
8 #include <linux/hrtimer.h>
10 /*#include <plat/gpio-cfg.h>*/
11 #include <linux/irq.h>
13 #include <linux/delay.h>
16 #define WACNAME "WAC_I2C_EMR"
17 #define WACFLASH "WAC_I2C_FLASH"
18 #define LATEST_VERSION 0x15
21 #define COM_COORD_NUM 7
22 #define COM_QUERY_NUM 9
24 #define COM_SAMPLERATE_40 0x33
25 #define COM_SAMPLERATE_80 0x32
26 #define COM_SAMPLERATE_133 0x31
27 #define COM_SURVEYSCAN 0x2B
28 #define COM_QUERY 0x2A
29 #define COM_FLASH 0xff
31 /*I2C address for digitizer and its boot loader*/
32 #define WACOM_I2C_ADDR 0x56
33 #define WACOM_I2C_BOOT 0x57
35 /*Information for input_dev*/
37 #define WACOM_PKGLEN_I2C_EMR 0
39 /*Enable/disable irq*/
44 #define EPEN_TOOL_PEN 0x220
45 #define EPEN_TOOL_RUBBER 0x221
46 #define EPEN_STYLUS 0x22b
47 #define EPEN_STYLUS2 0x22c
49 //#define EMR_INT IRQ_EINT_GROUP(6, 2) // group 6 : D2
50 //#define PDCT_INT GPIO_ACCESSORY_INT
51 //#define GPIO_PEN_SLP S5PV210_GPH2(3)
53 /* Add android code to change position++ */
54 #define WACOM_POSX_MAX 7120
55 #define WACOM_POSY_MAX 11392
56 #define WACOM_PRESSURE_MAX 255
58 #define MAX_ROTATION 4
61 #define COOR_WORK_AROUND
62 /* Add android code to change position-- */
64 /*Parameters for wacom own features*/
65 struct wacom_features{
71 u8 data[COM_COORD_NUM];
74 static struct wacom_features wacom_feature_EMR = {
80 .data = {0, 0, 0, 0, 0, 0, 0},
83 struct wacom_g5_callbacks {
84 int (*check_prox)(struct wacom_g5_callbacks *);
87 struct wacom_g5_platform_data {
91 void (*init_platform_hw)(void);
92 void (*exit_platform_hw)(void);
93 void (*suspend_platform_hw)(void);
94 void (*resume_platform_hw)(void);
95 void (*register_cb)(struct wacom_g5_callbacks *);
98 /*Parameters for i2c driver*/
100 struct i2c_client *client;
101 struct input_dev *input_dev;
111 const char name[NAMEBUF];
112 struct wacom_features *wac_feature;
113 struct wacom_g5_platform_data *wac_pdata;
114 struct wacom_g5_callbacks callbacks;
115 int (*power)(int on);