[COMMON] touchscreen: synaptics: Add synaptics touch screen code
[GitHub/moto-9609/android_kernel_motorola_exynos9610.git] / include / linux / i2c / synaptics_rmi.h
1 /*
2 * Copyright (c) 2011, 2012 Synaptics Incorporated
3 * Copyright (c) 2011 Unixphere
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 *
19 */
20 #ifndef _SYNAPTICS_RMI4_GENERIC_H_
21 #define _SYNAPTICS_RMI4_GENERIC_H_
22
23 #ifndef CONFIG_KEYBOARD_CYPRESS_TOUCH
24 #define NO_0D_WHILE_2D
25 #endif
26
27 struct synaptics_rmi_f1a_button_map {
28 unsigned char nbuttons;
29 unsigned char *map;
30 };
31
32 #ifdef SYNAPTICS_RMI_INFORM_CHARGER
33 struct synaptics_rmi_callbacks {
34 void (*inform_charger)(struct synaptics_rmi_callbacks *, int);
35 };
36 #endif
37
38 /**
39 * struct synaptics_rmi4_platform_data - rmi4 platform data
40 * @x_flip: x flip flag
41 * @y_flip: y flip flag
42 * @regulator_en: regulator enable flag
43 * @gpio: attention interrupt gpio
44 * @irq_type: irq type
45 * @gpio_config: pointer to gpio configuration function
46 * @f1a_button_map: pointer to 0d button map
47 * @charger_noti_type: define method to notify the connection of charger.
48 */
49 struct synaptics_rmi4_platform_data {
50 bool x_flip;
51 bool y_flip;
52 unsigned int sensor_max_x;
53 unsigned int sensor_max_y;
54 unsigned int num_of_rx;
55 unsigned int num_of_tx;
56 unsigned char max_touch_width;
57 unsigned char panel_revision; /* to identify panel info */
58 bool regulator_en;
59 unsigned gpio;
60 int irq_type;
61 int (*gpio_config)(unsigned interrupt_gpio, bool configure);
62 int (*power)(void *data, bool on);
63 #ifdef NO_0D_WHILE_2D
64 int (*led_power_on) (bool);
65 #endif
66 unsigned char (*get_ddi_type)(void); /* to indentify ddi type */
67 void (*enable_sync)(bool on);
68 const char *firmware_name;
69 const char *project_name;
70 const char *model_name;
71 #ifdef SYNAPTICS_RMI_INFORM_CHARGER
72 void (*register_cb)(struct synaptics_rmi_callbacks *);
73 #endif
74 bool charger_noti_type;
75 struct synaptics_rmi_f1a_button_map *f1a_button_map;
76
77 const char *regulator_dvdd;
78 const char *regulator_avdd;
79 struct regulator *regul_dvdd;
80 };
81
82 extern unsigned int lcdtype;
83
84 #endif