aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/mouse
diff options
context:
space:
mode:
authorHenrik Rydberg <rydberg@euromail.se>2012-09-15 03:49:51 -0400
committerHenrik Rydberg <rydberg@euromail.se>2012-09-19 13:50:22 -0400
commit0e7269669d4cd14a49b4e5c708b8be0ba11504f7 (patch)
tree8f1316af57b6bc431208005325c37886686e0c38 /drivers/input/mouse
parentf17953abc92a7d536f4b9b9ce42cf8e07d8d3489 (diff)
Input: bcm5974 - Drop the logical dimensions
The logical scale is used to produce special finger width values to userspace, but has become an unnecessary restriction for everything else. Also, the bcm5974 trackpads are very accurate and work well without hysteresis. This patch simplifies the driver and device data by removing the logical scale, and by moving the special synaptics code out of the main path. Also add the orientation range, needed in a subsequent patch, to the device configuration. Tested-by: Benjamin Tissoires <benjamin.tissoires@enac.fr> Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Diffstat (limited to 'drivers/input/mouse')
-rw-r--r--drivers/input/mouse/bcm5974.c255
1 files changed, 111 insertions, 144 deletions
diff --git a/drivers/input/mouse/bcm5974.c b/drivers/input/mouse/bcm5974.c
index 2de974ce56b2..e8cfb3864181 100644
--- a/drivers/input/mouse/bcm5974.c
+++ b/drivers/input/mouse/bcm5974.c
@@ -200,10 +200,9 @@ struct tp_finger {
200 200
201/* device-specific parameters */ 201/* device-specific parameters */
202struct bcm5974_param { 202struct bcm5974_param {
203 int dim; /* logical dimension */ 203 int snratio; /* signal-to-noise ratio */
204 int fuzz; /* logical noise value */ 204 int min; /* device minimum reading */
205 int devmin; /* device minimum reading */ 205 int max; /* device maximum reading */
206 int devmax; /* device maximum reading */
207}; 206};
208 207
209/* device-specific configuration */ 208/* device-specific configuration */
@@ -220,6 +219,7 @@ struct bcm5974_config {
220 struct bcm5974_param w; /* finger width limits */ 219 struct bcm5974_param w; /* finger width limits */
221 struct bcm5974_param x; /* horizontal limits */ 220 struct bcm5974_param x; /* horizontal limits */
222 struct bcm5974_param y; /* vertical limits */ 221 struct bcm5974_param y; /* vertical limits */
222 struct bcm5974_param o; /* orientation limits */
223}; 223};
224 224
225/* logical device structure */ 225/* logical device structure */
@@ -235,23 +235,13 @@ struct bcm5974 {
235 struct bt_data *bt_data; /* button transferred data */ 235 struct bt_data *bt_data; /* button transferred data */
236 struct urb *tp_urb; /* trackpad usb request block */ 236 struct urb *tp_urb; /* trackpad usb request block */
237 u8 *tp_data; /* trackpad transferred data */ 237 u8 *tp_data; /* trackpad transferred data */
238 int fingers; /* number of fingers on trackpad */
239}; 238};
240 239
241/* logical dimensions */
242#define DIM_PRESSURE 256 /* maximum finger pressure */
243#define DIM_WIDTH 16 /* maximum finger width */
244#define DIM_X 1280 /* maximum trackpad x value */
245#define DIM_Y 800 /* maximum trackpad y value */
246
247/* logical signal quality */ 240/* logical signal quality */
248#define SN_PRESSURE 45 /* pressure signal-to-noise ratio */ 241#define SN_PRESSURE 45 /* pressure signal-to-noise ratio */
249#define SN_WIDTH 100 /* width signal-to-noise ratio */ 242#define SN_WIDTH 100 /* width signal-to-noise ratio */
250#define SN_COORD 250 /* coordinate signal-to-noise ratio */ 243#define SN_COORD 250 /* coordinate signal-to-noise ratio */
251 244#define SN_ORIENT 10 /* orientation signal-to-noise ratio */
252/* pressure thresholds */
253#define PRESSURE_LOW (2 * DIM_PRESSURE / SN_PRESSURE)
254#define PRESSURE_HIGH (3 * PRESSURE_LOW)
255 245
256/* device constants */ 246/* device constants */
257static const struct bcm5974_config bcm5974_config_table[] = { 247static const struct bcm5974_config bcm5974_config_table[] = {
@@ -262,10 +252,11 @@ static const struct bcm5974_config bcm5974_config_table[] = {
262 0, 252 0,
263 0x84, sizeof(struct bt_data), 253 0x84, sizeof(struct bt_data),
264 0x81, TYPE1, FINGER_TYPE1, FINGER_TYPE1 + SIZEOF_ALL_FINGERS, 254 0x81, TYPE1, FINGER_TYPE1, FINGER_TYPE1 + SIZEOF_ALL_FINGERS,
265 { DIM_PRESSURE, DIM_PRESSURE / SN_PRESSURE, 0, 256 }, 255 { SN_PRESSURE, 0, 256 },
266 { DIM_WIDTH, DIM_WIDTH / SN_WIDTH, 0, 2048 }, 256 { SN_WIDTH, 0, 2048 },
267 { DIM_X, DIM_X / SN_COORD, -4824, 5342 }, 257 { SN_COORD, -4824, 5342 },
268 { DIM_Y, DIM_Y / SN_COORD, -172, 5820 } 258 { SN_COORD, -172, 5820 },
259 { SN_ORIENT, -MAX_FINGER_ORIENTATION, MAX_FINGER_ORIENTATION }
269 }, 260 },
270 { 261 {
271 USB_DEVICE_ID_APPLE_WELLSPRING2_ANSI, 262 USB_DEVICE_ID_APPLE_WELLSPRING2_ANSI,
@@ -274,10 +265,11 @@ static const struct bcm5974_config bcm5974_config_table[] = {
274 0, 265 0,
275 0x84, sizeof(struct bt_data), 266 0x84, sizeof(struct bt_data),
276 0x81, TYPE1, FINGER_TYPE1, FINGER_TYPE1 + SIZEOF_ALL_FINGERS, 267 0x81, TYPE1, FINGER_TYPE1, FINGER_TYPE1 + SIZEOF_ALL_FINGERS,
277 { DIM_PRESSURE, DIM_PRESSURE / SN_PRESSURE, 0, 256 }, 268 { SN_PRESSURE, 0, 256 },
278 { DIM_WIDTH, DIM_WIDTH / SN_WIDTH, 0, 2048 }, 269 { SN_WIDTH, 0, 2048 },
279 { DIM_X, DIM_X / SN_COORD, -4824, 4824 }, 270 { SN_COORD, -4824, 4824 },
280 { DIM_Y, DIM_Y / SN_COORD, -172, 4290 } 271 { SN_COORD, -172, 4290 },
272 { SN_ORIENT, -MAX_FINGER_ORIENTATION, MAX_FINGER_ORIENTATION }
281 }, 273 },
282 { 274 {
283 USB_DEVICE_ID_APPLE_WELLSPRING3_ANSI, 275 USB_DEVICE_ID_APPLE_WELLSPRING3_ANSI,
@@ -286,10 +278,11 @@ static const struct bcm5974_config bcm5974_config_table[] = {
286 HAS_INTEGRATED_BUTTON, 278 HAS_INTEGRATED_BUTTON,
287 0x84, sizeof(struct bt_data), 279 0x84, sizeof(struct bt_data),
288 0x81, TYPE2, FINGER_TYPE2, FINGER_TYPE2 + SIZEOF_ALL_FINGERS, 280 0x81, TYPE2, FINGER_TYPE2, FINGER_TYPE2 + SIZEOF_ALL_FINGERS,
289 { DIM_PRESSURE, DIM_PRESSURE / SN_PRESSURE, 0, 300 }, 281 { SN_PRESSURE, 0, 300 },
290 { DIM_WIDTH, DIM_WIDTH / SN_WIDTH, 0, 2048 }, 282 { SN_WIDTH, 0, 2048 },
291 { DIM_X, DIM_X / SN_COORD, -4460, 5166 }, 283 { SN_COORD, -4460, 5166 },
292 { DIM_Y, DIM_Y / SN_COORD, -75, 6700 } 284 { SN_COORD, -75, 6700 },
285 { SN_ORIENT, -MAX_FINGER_ORIENTATION, MAX_FINGER_ORIENTATION }
293 }, 286 },
294 { 287 {
295 USB_DEVICE_ID_APPLE_WELLSPRING4_ANSI, 288 USB_DEVICE_ID_APPLE_WELLSPRING4_ANSI,
@@ -298,10 +291,11 @@ static const struct bcm5974_config bcm5974_config_table[] = {
298 HAS_INTEGRATED_BUTTON, 291 HAS_INTEGRATED_BUTTON,
299 0x84, sizeof(struct bt_data), 292 0x84, sizeof(struct bt_data),
300 0x81, TYPE2, FINGER_TYPE2, FINGER_TYPE2 + SIZEOF_ALL_FINGERS, 293 0x81, TYPE2, FINGER_TYPE2, FINGER_TYPE2 + SIZEOF_ALL_FINGERS,
301 { DIM_PRESSURE, DIM_PRESSURE / SN_PRESSURE, 0, 300 }, 294 { SN_PRESSURE, 0, 300 },
302 { DIM_WIDTH, DIM_WIDTH / SN_WIDTH, 0, 2048 }, 295 { SN_WIDTH, 0, 2048 },
303 { DIM_X, DIM_X / SN_COORD, -4620, 5140 }, 296 { SN_COORD, -4620, 5140 },
304 { DIM_Y, DIM_Y / SN_COORD, -150, 6600 } 297 { SN_COORD, -150, 6600 },
298 { SN_ORIENT, -MAX_FINGER_ORIENTATION, MAX_FINGER_ORIENTATION }
305 }, 299 },
306 { 300 {
307 USB_DEVICE_ID_APPLE_WELLSPRING4A_ANSI, 301 USB_DEVICE_ID_APPLE_WELLSPRING4A_ANSI,
@@ -310,10 +304,11 @@ static const struct bcm5974_config bcm5974_config_table[] = {
310 HAS_INTEGRATED_BUTTON, 304 HAS_INTEGRATED_BUTTON,
311 0x84, sizeof(struct bt_data), 305 0x84, sizeof(struct bt_data),
312 0x81, TYPE2, FINGER_TYPE2, FINGER_TYPE2 + SIZEOF_ALL_FINGERS, 306 0x81, TYPE2, FINGER_TYPE2, FINGER_TYPE2 + SIZEOF_ALL_FINGERS,
313 { DIM_PRESSURE, DIM_PRESSURE / SN_PRESSURE, 0, 300 }, 307 { SN_PRESSURE, 0, 300 },
314 { DIM_WIDTH, DIM_WIDTH / SN_WIDTH, 0, 2048 }, 308 { SN_WIDTH, 0, 2048 },
315 { DIM_X, DIM_X / SN_COORD, -4616, 5112 }, 309 { SN_COORD, -4616, 5112 },
316 { DIM_Y, DIM_Y / SN_COORD, -142, 5234 } 310 { SN_COORD, -142, 5234 },
311 { SN_ORIENT, -MAX_FINGER_ORIENTATION, MAX_FINGER_ORIENTATION }
317 }, 312 },
318 { 313 {
319 USB_DEVICE_ID_APPLE_WELLSPRING5_ANSI, 314 USB_DEVICE_ID_APPLE_WELLSPRING5_ANSI,
@@ -322,10 +317,11 @@ static const struct bcm5974_config bcm5974_config_table[] = {
322 HAS_INTEGRATED_BUTTON, 317 HAS_INTEGRATED_BUTTON,
323 0x84, sizeof(struct bt_data), 318 0x84, sizeof(struct bt_data),
324 0x81, TYPE2, FINGER_TYPE2, FINGER_TYPE2 + SIZEOF_ALL_FINGERS, 319 0x81, TYPE2, FINGER_TYPE2, FINGER_TYPE2 + SIZEOF_ALL_FINGERS,
325 { DIM_PRESSURE, DIM_PRESSURE / SN_PRESSURE, 0, 300 }, 320 { SN_PRESSURE, 0, 300 },
326 { DIM_WIDTH, DIM_WIDTH / SN_WIDTH, 0, 2048 }, 321 { SN_WIDTH, 0, 2048 },
327 { DIM_X, DIM_X / SN_COORD, -4415, 5050 }, 322 { SN_COORD, -4415, 5050 },
328 { DIM_Y, DIM_Y / SN_COORD, -55, 6680 } 323 { SN_COORD, -55, 6680 },
324 { SN_ORIENT, -MAX_FINGER_ORIENTATION, MAX_FINGER_ORIENTATION }
329 }, 325 },
330 { 326 {
331 USB_DEVICE_ID_APPLE_WELLSPRING6_ANSI, 327 USB_DEVICE_ID_APPLE_WELLSPRING6_ANSI,
@@ -334,10 +330,11 @@ static const struct bcm5974_config bcm5974_config_table[] = {
334 HAS_INTEGRATED_BUTTON, 330 HAS_INTEGRATED_BUTTON,
335 0x84, sizeof(struct bt_data), 331 0x84, sizeof(struct bt_data),
336 0x81, TYPE2, FINGER_TYPE2, FINGER_TYPE2 + SIZEOF_ALL_FINGERS, 332 0x81, TYPE2, FINGER_TYPE2, FINGER_TYPE2 + SIZEOF_ALL_FINGERS,
337 { DIM_PRESSURE, DIM_PRESSURE / SN_PRESSURE, 0, 300 }, 333 { SN_PRESSURE, 0, 300 },
338 { DIM_WIDTH, DIM_WIDTH / SN_WIDTH, 0, 2048 }, 334 { SN_WIDTH, 0, 2048 },
339 { DIM_X, DIM_X / SN_COORD, -4620, 5140 }, 335 { SN_COORD, -4620, 5140 },
340 { DIM_Y, DIM_Y / SN_COORD, -150, 6600 } 336 { SN_COORD, -150, 6600 },
337 { SN_ORIENT, -MAX_FINGER_ORIENTATION, MAX_FINGER_ORIENTATION }
341 }, 338 },
342 { 339 {
343 USB_DEVICE_ID_APPLE_WELLSPRING5A_ANSI, 340 USB_DEVICE_ID_APPLE_WELLSPRING5A_ANSI,
@@ -346,10 +343,11 @@ static const struct bcm5974_config bcm5974_config_table[] = {
346 HAS_INTEGRATED_BUTTON, 343 HAS_INTEGRATED_BUTTON,