Commit 02d04254 authored by Hans de Goede's avatar Hans de Goede Committed by Dmitry Torokhov

Input: alps - use struct input_mt_pos to track coordinates

This is a preparation patch for switching the DIY mt handling to using
input_mt_assign_slots && input_mt_sync_frame.

struct alps_fields is quite large, so while making changes to almost all uses
of it lets put it in our priv data instead of on the stack.

Having it in our priv data also allows using it directly for storing values
which need to be cached, rather then having separate x, y, z, fingers, etc.
copies in our priv data.
Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
parent 28835f45
This diff is collapsed.
...@@ -12,6 +12,8 @@ ...@@ -12,6 +12,8 @@
#ifndef _ALPS_H #ifndef _ALPS_H
#define _ALPS_H #define _ALPS_H
#include <linux/input/mt.h>
#define ALPS_PROTO_V1 1 #define ALPS_PROTO_V1 1
#define ALPS_PROTO_V2 2 #define ALPS_PROTO_V2 2
#define ALPS_PROTO_V3 3 #define ALPS_PROTO_V3 3
...@@ -19,6 +21,8 @@ ...@@ -19,6 +21,8 @@
#define ALPS_PROTO_V5 5 #define ALPS_PROTO_V5 5
#define ALPS_PROTO_V6 6 #define ALPS_PROTO_V6 6
#define MAX_TOUCHES 2
#define DOLPHIN_COUNT_PER_ELECTRODE 64 #define DOLPHIN_COUNT_PER_ELECTRODE 64
#define DOLPHIN_PROFILE_XOFFSET 8 /* x-electrode offset */ #define DOLPHIN_PROFILE_XOFFSET 8 /* x-electrode offset */
#define DOLPHIN_PROFILE_YOFFSET 1 /* y-electrode offset */ #define DOLPHIN_PROFILE_YOFFSET 1 /* y-electrode offset */
...@@ -75,9 +79,9 @@ struct alps_bitmap_point { ...@@ -75,9 +79,9 @@ struct alps_bitmap_point {
* @x_map: Bitmap of active X positions for MT. * @x_map: Bitmap of active X positions for MT.
* @y_map: Bitmap of active Y positions for MT. * @y_map: Bitmap of active Y positions for MT.
* @fingers: Number of fingers for MT. * @fingers: Number of fingers for MT.
* @x: X position for ST. * @pressure: Pressure.
* @y: Y position for ST. * @st: position for ST.
* @z: Z position for ST. * @mt: position for MT.
* @first_mp: Packet is the first of a multi-packet report. * @first_mp: Packet is the first of a multi-packet report.
* @is_mp: Packet is part of a multi-packet report. * @is_mp: Packet is part of a multi-packet report.
* @left: Left touchpad button is active. * @left: Left touchpad button is active.
...@@ -91,9 +95,11 @@ struct alps_fields { ...@@ -91,9 +95,11 @@ struct alps_fields {
unsigned int x_map; unsigned int x_map;
unsigned int y_map; unsigned int y_map;
unsigned int fingers; unsigned int fingers;
unsigned int x;
unsigned int y; int pressure;
unsigned int z; struct input_mt_pos st;
struct input_mt_pos mt[MAX_TOUCHES];
unsigned int first_mp:1; unsigned int first_mp:1;
unsigned int is_mp:1; unsigned int is_mp:1;
...@@ -130,11 +136,7 @@ struct alps_fields { ...@@ -130,11 +136,7 @@ struct alps_fields {
* @prev_fin: Finger bit from previous packet. * @prev_fin: Finger bit from previous packet.
* @multi_packet: Multi-packet data in progress. * @multi_packet: Multi-packet data in progress.
* @multi_data: Saved multi-packet data. * @multi_data: Saved multi-packet data.
* @x1: First X coordinate from last MT report. * @f: Decoded packet data fields.
* @x2: Second X coordinate from last MT report.
* @y1: First Y coordinate from last MT report.
* @y2: Second Y coordinate from last MT report.
* @fingers: Number of fingers from last MT report.
* @quirks: Bitmap of ALPS_QUIRK_*. * @quirks: Bitmap of ALPS_QUIRK_*.
* @timer: Timer for flushing out the final report packet in the stream. * @timer: Timer for flushing out the final report packet in the stream.
*/ */
...@@ -162,8 +164,7 @@ struct alps_data { ...@@ -162,8 +164,7 @@ struct alps_data {
int prev_fin; int prev_fin;
int multi_packet; int multi_packet;
unsigned char multi_data[6]; unsigned char multi_data[6];
int x1, x2, y1, y2; struct alps_fields f;
int fingers;
u8 quirks; u8 quirks;
struct timer_list timer; struct timer_list timer;
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment