| .. | .. |
|---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-only */ |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Elantech Touchpad driver (v6) |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * Copyright (C) 2007-2009 Arjan Opmeer <arjan@opmeer.net> |
|---|
| 5 | | - * |
|---|
| 6 | | - * This program is free software; you can redistribute it and/or modify it |
|---|
| 7 | | - * under the terms of the GNU General Public License version 2 as published |
|---|
| 8 | | - * by the Free Software Foundation. |
|---|
| 9 | 6 | * |
|---|
| 10 | 7 | * Trademarks are the property of their respective owners. |
|---|
| 11 | 8 | */ |
|---|
| .. | .. |
|---|
| 21 | 18 | #define ETP_CAPABILITIES_QUERY 0x02 |
|---|
| 22 | 19 | #define ETP_SAMPLE_QUERY 0x03 |
|---|
| 23 | 20 | #define ETP_RESOLUTION_QUERY 0x04 |
|---|
| 21 | +#define ETP_ICBODY_QUERY 0x05 |
|---|
| 24 | 22 | |
|---|
| 25 | 23 | /* |
|---|
| 26 | 24 | * Command values for register reading or writing |
|---|
| .. | .. |
|---|
| 143 | 141 | unsigned char samples[3]; |
|---|
| 144 | 142 | unsigned char debug; |
|---|
| 145 | 143 | unsigned char hw_version; |
|---|
| 144 | + unsigned char pattern; |
|---|
| 146 | 145 | unsigned int fw_version; |
|---|
| 146 | + unsigned int ic_version; |
|---|
| 147 | + unsigned int product_id; |
|---|
| 148 | + unsigned int x_min; |
|---|
| 149 | + unsigned int y_min; |
|---|
| 150 | + unsigned int x_max; |
|---|
| 151 | + unsigned int y_max; |
|---|
| 147 | 152 | unsigned int x_res; |
|---|
| 148 | 153 | unsigned int y_res; |
|---|
| 154 | + unsigned int x_traces; |
|---|
| 155 | + unsigned int y_traces; |
|---|
| 156 | + unsigned int width; |
|---|
| 149 | 157 | unsigned int bus; |
|---|
| 150 | 158 | bool paritycheck; |
|---|
| 151 | 159 | bool jumpy_cursor; |
|---|
| .. | .. |
|---|
| 153 | 161 | bool crc_enabled; |
|---|
| 154 | 162 | bool set_hw_resolution; |
|---|
| 155 | 163 | bool has_trackpoint; |
|---|
| 164 | + bool has_middle_button; |
|---|
| 156 | 165 | int (*send_cmd)(struct psmouse *psmouse, unsigned char c, |
|---|
| 157 | 166 | unsigned char *param); |
|---|
| 158 | 167 | }; |
|---|
| .. | .. |
|---|
| 179 | 188 | void (*original_set_rate)(struct psmouse *psmouse, unsigned int rate); |
|---|
| 180 | 189 | }; |
|---|
| 181 | 190 | |
|---|
| 182 | | -#ifdef CONFIG_MOUSE_PS2_ELANTECH |
|---|
| 183 | 191 | int elantech_detect(struct psmouse *psmouse, bool set_properties); |
|---|
| 184 | 192 | int elantech_init_ps2(struct psmouse *psmouse); |
|---|
| 193 | + |
|---|
| 194 | +#ifdef CONFIG_MOUSE_PS2_ELANTECH |
|---|
| 185 | 195 | int elantech_init(struct psmouse *psmouse); |
|---|
| 186 | 196 | #else |
|---|
| 187 | | -static inline int elantech_detect(struct psmouse *psmouse, bool set_properties) |
|---|
| 188 | | -{ |
|---|
| 189 | | - return -ENOSYS; |
|---|
| 190 | | -} |
|---|
| 191 | 197 | static inline int elantech_init(struct psmouse *psmouse) |
|---|
| 192 | | -{ |
|---|
| 193 | | - return -ENOSYS; |
|---|
| 194 | | -} |
|---|
| 195 | | -static inline int elantech_init_ps2(struct psmouse *psmouse) |
|---|
| 196 | 198 | { |
|---|
| 197 | 199 | return -ENOSYS; |
|---|
| 198 | 200 | } |
|---|
| 199 | 201 | #endif /* CONFIG_MOUSE_PS2_ELANTECH */ |
|---|
| 200 | 202 | |
|---|
| 201 | | -#if defined(CONFIG_MOUSE_PS2_ELANTECH_SMBUS) |
|---|
| 202 | 203 | int elantech_init_smbus(struct psmouse *psmouse); |
|---|
| 203 | | -#else |
|---|
| 204 | | -static inline int elantech_init_smbus(struct psmouse *psmouse) |
|---|
| 205 | | -{ |
|---|
| 206 | | - return -ENOSYS; |
|---|
| 207 | | -} |
|---|
| 208 | | -#endif /* CONFIG_MOUSE_PS2_ELANTECH_SMBUS */ |
|---|
| 209 | 204 | |
|---|
| 210 | 205 | #endif |
|---|