Nicholas Flintham | 1e3d311 | 2013-04-10 10:48:38 +0100 | [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" |
| 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 |
| 28 | |
| 29 | |
| 30 | #define SYN_CONFIG_SIZE 32 * 16 |
| 31 | #define SYN_MAX_PAGE 4 |
| 32 | #define SYN_BL_PAGE 1 |
| 33 | #define SYN_F01DATA_BASEADDR 0x0013 |
| 34 | #define SYN_PROCESS_ERR -1 |
| 35 | |
| 36 | #define SYN_AND_REPORT_TYPE_A 0 |
| 37 | #define SYN_AND_REPORT_TYPE_B 1 |
| 38 | #define SYN_AND_REPORT_TYPE_HTC 2 |
| 39 | |
| 40 | #define TAP_DX_OUTER 0 |
| 41 | #define TAP_DY_OUTER 1 |
| 42 | #define TAP_TIMEOUT 2 |
| 43 | #define TAP_DX_INTER 3 |
| 44 | #define TAP_DY_INTER 4 |
| 45 | |
| 46 | #define CUS_REG_SIZE 4 |
| 47 | #define CUS_REG_BASE 0 |
| 48 | #define CUS_BALLISTICS_CTRL 1 |
| 49 | #define CUS_LAND_CTRL 2 |
| 50 | #define CUS_LIFT_CTRL 3 |
| 51 | |
| 52 | #define SENSOR_ID_CHECKING_EN 1 << 16 |
| 53 | |
| 54 | enum { |
| 55 | SYNAPTICS_FLIP_X = 1UL << 0, |
| 56 | SYNAPTICS_FLIP_Y = 1UL << 1, |
| 57 | SYNAPTICS_SWAP_XY = 1UL << 2, |
| 58 | SYNAPTICS_SNAP_TO_INACTIVE_EDGE = 1UL << 3, |
| 59 | }; |
| 60 | |
| 61 | enum { |
| 62 | FINGER_1_REPORT = 1 << 0, |
| 63 | FINGER_2_REPORT = 1 << 1, |
| 64 | }; |
| 65 | |
| 66 | struct synaptics_virtual_key { |
| 67 | int index; |
| 68 | int keycode; |
| 69 | int x_range_min; |
| 70 | int x_range_max; |
| 71 | int y_range_min; |
| 72 | int y_range_max; |
| 73 | }; |
| 74 | |
| 75 | struct synaptics_i2c_rmi_platform_data { |
| 76 | uint32_t version; |
| 77 | |
| 78 | |
| 79 | int (*power)(int on); |
| 80 | int (*lpm_power)(int on); |
| 81 | struct synaptics_virtual_key *virtual_key; |
| 82 | uint8_t virtual_key_num; |
| 83 | struct kobject *vk_obj; |
| 84 | struct kobj_attribute *vk2Use; |
| 85 | uint8_t sensitivity; |
| 86 | uint8_t finger_support; |
| 87 | uint32_t gap_area; |
| 88 | uint32_t key_area; |
| 89 | uint32_t flags; |
| 90 | unsigned long irqflags; |
| 91 | uint32_t inactive_left; |
| 92 | uint32_t inactive_right; |
| 93 | uint32_t inactive_top; |
| 94 | uint32_t inactive_bottom; |
| 95 | uint32_t snap_left_on; |
| 96 | uint32_t snap_left_off; |
| 97 | uint32_t snap_right_on; |
| 98 | uint32_t snap_right_off; |
| 99 | uint32_t snap_top_on; |
| 100 | uint32_t snap_top_off; |
| 101 | uint32_t snap_bottom_on; |
| 102 | uint32_t snap_bottom_off; |
| 103 | uint32_t fuzz_x; |
| 104 | uint32_t fuzz_y; |
| 105 | int abs_x_min; |
| 106 | int abs_x_max; |
| 107 | int abs_y_min; |
| 108 | int abs_y_max; |
| 109 | int fuzz_p; |
| 110 | int fuzz_w; |
| 111 | uint32_t display_width; |
| 112 | uint32_t display_height; |
| 113 | int8_t sensitivity_adjust; |
| 114 | uint32_t dup_threshold; |
| 115 | uint32_t margin_inactive_pixel[4]; |
| 116 | uint16_t filter_level[4]; |
| 117 | uint8_t reduce_report_level[5]; |
| 118 | uint8_t noise_information; |
| 119 | uint8_t jumpfq_enable; |
| 120 | uint8_t cable_support; |
| 121 | uint8_t config[SYN_CONFIG_SIZE]; |
| 122 | int gpio_irq; |
| 123 | int gpio_reset; |
| 124 | uint8_t default_config; |
| 125 | uint8_t report_type; |
| 126 | uint8_t large_obj_check; |
| 127 | uint16_t tw_pin_mask; |
| 128 | uint32_t sensor_id; |
| 129 | uint32_t packrat_number; |
| 130 | uint8_t support_htc_event; |
| 131 | uint8_t mfg_flag; |
| 132 | uint8_t customer_register[CUS_REG_SIZE]; |
| 133 | uint8_t segmentation_bef_unlock; |
| 134 | uint8_t threshold_bef_unlock; |
| 135 | uint16_t saturation_bef_unlock; |
| 136 | uint8_t i2c_err_handler_en; |
| 137 | uint8_t energy_ratio_relaxation; |
| 138 | uint8_t multitouch_calibration; |
| 139 | uint8_t psensor_detection; |
| 140 | uint8_t PixelTouchThreshold_bef_unlock; |
| 141 | }; |
| 142 | |
| 143 | struct page_description { |
| 144 | uint8_t addr; |
| 145 | uint8_t value; |
| 146 | }; |
| 147 | |
| 148 | struct syn_finger_data { |
| 149 | int x; |
| 150 | int y; |
| 151 | int w; |
| 152 | int z; |
| 153 | }; |
| 154 | |
| 155 | struct function_t { |
| 156 | uint8_t function_type; |
| 157 | uint8_t interrupt_source; |
| 158 | uint16_t data_base; |
| 159 | uint16_t control_base; |
| 160 | uint16_t command_base; |
| 161 | uint16_t query_base; |
| 162 | }; |
| 163 | enum { |
| 164 | QUERY_BASE, |
| 165 | COMMAND_BASE, |
| 166 | CONTROL_BASE, |
| 167 | DATA_BASE, |
| 168 | INTR_SOURCE, |
| 169 | FUNCTION |
| 170 | }; |
| 171 | |
| 172 | extern uint8_t getPowerKeyState(void); |
| 173 | #endif |