Arve Hjønnevåg | 46b612b | 2007-08-21 21:56:46 -0700 | [diff] [blame] | 1 | /* |
| 2 | * include/linux/synaptics_i2c_rmi.h - platform data structure for f75375s sensor |
| 3 | * |
| 4 | * Copyright (C) 2008 Google, Inc. |
| 5 | * |
| 6 | * This software is licensed under the terms of the GNU General Public |
| 7 | * License version 2, as published by the Free Software Foundation, and |
| 8 | * may be copied, distributed, and modified under those terms. |
| 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 | */ |
| 16 | |
| 17 | #ifndef _LINUX_SYNAPTICS_I2C_RMI_H |
| 18 | #define _LINUX_SYNAPTICS_I2C_RMI_H |
| 19 | |
| 20 | #define SYNAPTICS_I2C_RMI_NAME "synaptics-rmi-ts" |
Flemmard | ce3c2c3 | 2013-05-23 16:53:44 -0700 | [diff] [blame] | 21 | #define SYNAPTICS_T1007_NAME "synaptics-t1007" |
| 22 | #define SYNAPTICS_T1021_NAME "synaptics-t1021" |
| 23 | #define SYNAPTICS_3K_NAME "synaptics-3k" |
| 24 | #define SYNAPTICS_3K_INCELL_NAME "synaptics-3k-incell" |
| 25 | #define SYNAPTICS_3200_NAME "synaptics-3200" |
| 26 | #define SYNAPTICS_FW_3_2_PACKRAT 1115999 |
| 27 | #define SYNAPTICS_FW_NOCAL_PACKRAT 1293981 |
Flemmard | 0810abc | 2014-01-07 16:33:21 -0800 | [diff] [blame] | 28 | #define SYNAPTICS_FW_2IN1_PACKRAT 1396865 |
Flemmard | ce3c2c3 | 2013-05-23 16:53:44 -0700 | [diff] [blame] | 29 | |
| 30 | |
| 31 | #define SYN_CONFIG_SIZE 32 * 16 |
| 32 | #define SYN_MAX_PAGE 4 |
| 33 | #define SYN_BL_PAGE 1 |
| 34 | #define SYN_F01DATA_BASEADDR 0x0013 |
| 35 | #define SYN_PROCESS_ERR -1 |
| 36 | |
| 37 | #define SYN_AND_REPORT_TYPE_A 0 |
| 38 | #define SYN_AND_REPORT_TYPE_B 1 |
| 39 | #define SYN_AND_REPORT_TYPE_HTC 2 |
| 40 | |
| 41 | #define TAP_DX_OUTER 0 |
| 42 | #define TAP_DY_OUTER 1 |
| 43 | #define TAP_TIMEOUT 2 |
| 44 | #define TAP_DX_INTER 3 |
| 45 | #define TAP_DY_INTER 4 |
| 46 | |
| 47 | #define CUS_REG_SIZE 4 |
| 48 | #define CUS_REG_BASE 0 |
| 49 | #define CUS_BALLISTICS_CTRL 1 |
| 50 | #define CUS_LAND_CTRL 2 |
| 51 | #define CUS_LIFT_CTRL 3 |
| 52 | |
| 53 | #define SENSOR_ID_CHECKING_EN 1 << 16 |
Flemmard | 0810abc | 2014-01-07 16:33:21 -0800 | [diff] [blame] | 54 | #define PSENSOR_STATUS 0x03 |
| 55 | #define PHONE_STATUS 0x04 |
Arve Hjønnevåg | 46b612b | 2007-08-21 21:56:46 -0700 | [diff] [blame] | 56 | |
| 57 | enum { |
| 58 | SYNAPTICS_FLIP_X = 1UL << 0, |
| 59 | SYNAPTICS_FLIP_Y = 1UL << 1, |
| 60 | SYNAPTICS_SWAP_XY = 1UL << 2, |
| 61 | SYNAPTICS_SNAP_TO_INACTIVE_EDGE = 1UL << 3, |
| 62 | }; |
| 63 | |
Flemmard | ce3c2c3 | 2013-05-23 16:53:44 -0700 | [diff] [blame] | 64 | enum { |
| 65 | FINGER_1_REPORT = 1 << 0, |
| 66 | FINGER_2_REPORT = 1 << 1, |
| 67 | }; |
| 68 | |
| 69 | #ifdef CONFIG_TOUCHSCREEN_SYNAPTICS_3K |
| 70 | struct synaptics_virtual_key { |
| 71 | int index; |
| 72 | int keycode; |
| 73 | int x_range_min; |
| 74 | int x_range_max; |
| 75 | int y_range_min; |
| 76 | int y_range_max; |
| 77 | }; |
| 78 | #endif |
| 79 | |
Arve Hjønnevåg | 46b612b | 2007-08-21 21:56:46 -0700 | [diff] [blame] | 80 | struct synaptics_i2c_rmi_platform_data { |
| 81 | uint32_t version; /* Use this entry for panels with */ |
| 82 | /* (major << 8 | minor) version or above. */ |
| 83 | /* If non-zero another array entry follows */ |
| 84 | int (*power)(int on); /* Only valid in first array entry */ |
Flemmard | ce3c2c3 | 2013-05-23 16:53:44 -0700 | [diff] [blame] | 85 | #ifdef CONFIG_TOUCHSCREEN_SYNAPTICS_3K |
Flemmard | 0810abc | 2014-01-07 16:33:21 -0800 | [diff] [blame] | 86 | int (*lpm_power)(int on); |
Flemmard | ce3c2c3 | 2013-05-23 16:53:44 -0700 | [diff] [blame] | 87 | struct synaptics_virtual_key *virtual_key; |
| 88 | uint8_t virtual_key_num; |
| 89 | struct kobject *vk_obj; |
| 90 | struct kobj_attribute *vk2Use; |
| 91 | uint8_t sensitivity; |
| 92 | uint8_t finger_support; |
| 93 | uint32_t gap_area; |
| 94 | uint32_t key_area; |
| 95 | #endif |
Arve Hjønnevåg | 46b612b | 2007-08-21 21:56:46 -0700 | [diff] [blame] | 96 | uint32_t flags; |
| 97 | unsigned long irqflags; |
| 98 | uint32_t inactive_left; /* 0x10000 = screen width */ |
| 99 | uint32_t inactive_right; /* 0x10000 = screen width */ |
| 100 | uint32_t inactive_top; /* 0x10000 = screen height */ |
| 101 | uint32_t inactive_bottom; /* 0x10000 = screen height */ |
| 102 | uint32_t snap_left_on; /* 0x10000 = screen width */ |
| 103 | uint32_t snap_left_off; /* 0x10000 = screen width */ |
| 104 | uint32_t snap_right_on; /* 0x10000 = screen width */ |
| 105 | uint32_t snap_right_off; /* 0x10000 = screen width */ |
| 106 | uint32_t snap_top_on; /* 0x10000 = screen height */ |
| 107 | uint32_t snap_top_off; /* 0x10000 = screen height */ |
| 108 | uint32_t snap_bottom_on; /* 0x10000 = screen height */ |
| 109 | uint32_t snap_bottom_off; /* 0x10000 = screen height */ |
| 110 | uint32_t fuzz_x; /* 0x10000 = screen width */ |
| 111 | uint32_t fuzz_y; /* 0x10000 = screen height */ |
Flemmard | ce3c2c3 | 2013-05-23 16:53:44 -0700 | [diff] [blame] | 112 | #ifdef CONFIG_TOUCHSCREEN_SYNAPTICS_3K |
| 113 | int abs_x_min; |
| 114 | int abs_x_max; |
| 115 | int abs_y_min; |
| 116 | int abs_y_max; |
| 117 | #endif |
Arve Hjønnevåg | 46b612b | 2007-08-21 21:56:46 -0700 | [diff] [blame] | 118 | int fuzz_p; |
| 119 | int fuzz_w; |
Flemmard | ce3c2c3 | 2013-05-23 16:53:44 -0700 | [diff] [blame] | 120 | #ifdef CONFIG_TOUCHSCREEN_SYNAPTICS_3K |
| 121 | uint32_t display_width; |
| 122 | uint32_t display_height; |
| 123 | #endif |
Arve Hjønnevåg | 46b612b | 2007-08-21 21:56:46 -0700 | [diff] [blame] | 124 | int8_t sensitivity_adjust; |
Flemmard | ce3c2c3 | 2013-05-23 16:53:44 -0700 | [diff] [blame] | 125 | #ifdef CONFIG_TOUCHSCREEN_SYNAPTICS_3K |
| 126 | uint32_t dup_threshold; |
| 127 | uint32_t margin_inactive_pixel[4]; |
| 128 | uint16_t filter_level[4]; |
| 129 | uint8_t reduce_report_level[5]; |
| 130 | uint8_t noise_information; |
| 131 | uint8_t jumpfq_enable; |
| 132 | uint8_t cable_support; |
| 133 | uint8_t config[SYN_CONFIG_SIZE]; |
| 134 | int gpio_irq; |
| 135 | int gpio_reset; |
| 136 | uint8_t default_config; |
| 137 | uint8_t report_type; |
| 138 | uint8_t large_obj_check; |
| 139 | uint16_t tw_pin_mask; |
| 140 | uint32_t sensor_id; |
| 141 | uint32_t packrat_number; |
| 142 | uint8_t support_htc_event; |
| 143 | uint8_t mfg_flag; |
| 144 | uint8_t customer_register[CUS_REG_SIZE]; |
| 145 | uint8_t segmentation_bef_unlock; |
| 146 | uint8_t threshold_bef_unlock; |
| 147 | uint16_t saturation_bef_unlock; |
| 148 | uint8_t i2c_err_handler_en; |
| 149 | uint8_t energy_ratio_relaxation; |
| 150 | uint8_t multitouch_calibration; |
| 151 | uint8_t psensor_detection; |
| 152 | uint8_t PixelTouchThreshold_bef_unlock; |
Flemmard | 0810abc | 2014-01-07 16:33:21 -0800 | [diff] [blame] | 153 | uint8_t block_touch_time_near; |
| 154 | uint8_t block_touch_time_far; |
Flemmard | ce3c2c3 | 2013-05-23 16:53:44 -0700 | [diff] [blame] | 155 | #endif |
Arve Hjønnevåg | 46b612b | 2007-08-21 21:56:46 -0700 | [diff] [blame] | 156 | }; |
| 157 | |
Flemmard | ce3c2c3 | 2013-05-23 16:53:44 -0700 | [diff] [blame] | 158 | #ifdef CONFIG_TOUCHSCREEN_SYNAPTICS_3K |
| 159 | struct page_description { |
| 160 | uint8_t addr; |
| 161 | uint8_t value; |
| 162 | }; |
| 163 | |
| 164 | struct syn_finger_data { |
| 165 | int x; |
| 166 | int y; |
| 167 | int w; |
| 168 | int z; |
| 169 | }; |
| 170 | |
| 171 | struct function_t { |
| 172 | uint8_t function_type; |
| 173 | uint8_t interrupt_source; |
| 174 | uint16_t data_base; |
| 175 | uint16_t control_base; |
| 176 | uint16_t command_base; |
| 177 | uint16_t query_base; |
| 178 | }; |
| 179 | enum { |
| 180 | QUERY_BASE, |
| 181 | COMMAND_BASE, |
| 182 | CONTROL_BASE, |
| 183 | DATA_BASE, |
| 184 | INTR_SOURCE, |
| 185 | FUNCTION |
| 186 | }; |
| 187 | |
| 188 | extern uint8_t getPowerKeyState(void); |
| 189 | #endif /* CONFIG_TOUCHSCREEN_SYNAPTICS_3K */ |
Arve Hjønnevåg | 46b612b | 2007-08-21 21:56:46 -0700 | [diff] [blame] | 190 | #endif /* _LINUX_SYNAPTICS_I2C_RMI_H */ |