summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2011-03-18 16:24:28 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2011-03-18 16:25:02 +1000
commit4ebde557aee7953f766fcd6b725cbacd47f806ec (patch)
treec1ec8de9a9a840954a0a7e395a0af9d478e42d6d /src
parentd521fc0335e9a6527d337154e064d192ab006425 (diff)
Revert "Add synaptics orientation support"
This patch needs more work before we can ship it. This reverts commit 049d5fb6037b34d94b24cb8300849cf4e3b67437. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'src')
-rw-r--r--src/alpscomm.c29
-rw-r--r--src/eventcomm.c22
-rw-r--r--src/properties.c8
-rw-r--r--src/ps2comm.c36
-rw-r--r--src/synaptics.c2
-rw-r--r--src/synapticsstr.h1
6 files changed, 13 insertions, 85 deletions
diff --git a/src/alpscomm.c b/src/alpscomm.c
index 7d5cda2..dc76655 100644
--- a/src/alpscomm.c
+++ b/src/alpscomm.c
@@ -149,12 +149,11 @@ ALPS_get_packet(struct CommData *comm, InputInfoPtr pInfo)
* reflects left,right,down,up in lef1,rig1,mid1,up1.
*/
static void
-ALPS_process_packet(SynapticsPrivate *priv, unsigned char *packet, struct SynapticsHwState *hw)
+ALPS_process_packet(unsigned char *packet, struct SynapticsHwState *hw)
{
int x = 0, y = 0, z = 0;
int left = 0, right = 0, middle = 0;
int i;
- SynapticsParameters *para = &priv->synpara;
x = (packet[1] & 0x7f) | ((packet[2] & 0x78) << (7-3));
y = (packet[4] & 0x7f) | ((packet[3] & 0x70) << (7-4));
@@ -173,27 +172,8 @@ ALPS_process_packet(SynapticsPrivate *priv, unsigned char *packet, struct Synapt
hw->multi[i] = FALSE;
if (z > 0) {
- if (para->orientation==0)
- hw->x = x;
- else if (para->orientation==2)
- hw->x = priv->maxx + priv->minx - x;
- else if (para->orientation==3)
- hw->y = (priv->maxx - x) * (priv->maxy - priv->miny) / (priv->maxx - priv->minx) + priv->miny;
- else if (para->orientation==1)
- hw->y = (x - priv->minx) * (priv->maxy - priv->miny) / (priv->maxx - priv->minx) + priv->miny;
- else
- hw->x = x;
-
- if (para->orientation==0)
- hw->y = y;
- else if (para->orientation==2)
- hw->y = priv->maxy + priv->miny - y;
- else if (para->orientation==3)
- hw->x = (y - priv->miny) * (priv->maxx - priv->minx) / (priv->maxy - priv->miny) + priv->minx;
- else if (para->orientation==1)
- hw->x = (priv->maxy - y) * (priv->maxx - priv->minx) / (priv->maxy - priv->miny) + priv->minx;
- else
- hw->y = y;
+ hw->x = x;
+ hw->y = y;
}
hw->z = z;
hw->numFingers = (z > 0) ? 1 : 0;
@@ -230,12 +210,11 @@ ALPSReadHwState(InputInfoPtr pInfo,
{
unsigned char *buf = comm->protoBuf;
struct SynapticsHwState *hw = &(comm->hwState);
- SynapticsPrivate *priv = (SynapticsPrivate *)pInfo->private;
if (!ALPS_get_packet(comm, pInfo))
return FALSE;
- ALPS_process_packet(priv, buf, hw);
+ ALPS_process_packet(buf, hw);
*hwRet = *hw;
return TRUE;
diff --git a/src/eventcomm.c b/src/eventcomm.c
index 3d550f1..d394d3f 100644
--- a/src/eventcomm.c
+++ b/src/eventcomm.c
@@ -400,28 +400,10 @@ EventReadHwState(InputInfoPtr pInfo,
case EV_ABS:
switch (ev.code) {
case ABS_X:
- if (para->orientation==0)
- hw->x = ev.value;
- else if (para->orientation==2)
- hw->x = priv->maxx + priv->minx - ev.value;
- else if (para->orientation==3)
- hw->y = (priv->maxx - ev.value) * (priv->maxy - priv->miny) / (priv->maxx - priv->minx) + priv->miny;
- else if (para->orientation==1)
- hw->y = (ev.value - priv->minx) * (priv->maxy - priv->miny) / (priv->maxx - priv->minx) + priv->miny;
- else
- hw->x = ev.value;
+ hw->x = ev.value;
break;
case ABS_Y:
- if (para->orientation==0)
- hw->y = ev.value;
- else if (para->orientation==2)
- hw->y = priv->maxy + priv->miny - ev.value;
- else if (para->orientation==3)
- hw->x = (ev.value - priv->miny) * (priv->maxx - priv->minx) / (priv->maxy - priv->miny) + priv->minx;
- else if (para->orientation==1)
- hw->x = (priv->maxy - ev.value) * (priv->maxx - priv->minx) / (priv->maxy - priv->miny) + priv->minx;
- else
- hw->y = ev.value;
+ hw->y = ev.value;
break;
case ABS_PRESSURE:
hw->z = ev.value;
diff --git a/src/properties.c b/src/properties.c
index 06909ed..23b5a6a 100644
--- a/src/properties.c
+++ b/src/properties.c
@@ -83,7 +83,6 @@ Atom prop_capabilities = 0;
Atom prop_resolution = 0;
Atom prop_area = 0;
Atom prop_noise_cancellation = 0;
-Atom prop_orientation = 0;
static Atom
InitAtom(DeviceIntPtr dev, char *name, int format, int nvalues, int *values)
@@ -286,8 +285,6 @@ InitDeviceProperties(InputInfoPtr pInfo)
prop_noise_cancellation = InitAtom(pInfo->dev,
SYNAPTICS_PROP_NOISE_CANCELLATION, 32, 2, values);
- prop_orientation = InitAtom(pInfo->dev, SYNAPTICS_ORIENTATION, 32, 1, &para->orientation);
-
}
int
@@ -669,11 +666,6 @@ SetProperty(DeviceIntPtr dev, Atom property, XIPropertyValuePtr prop,
return BadValue;
para->hyst_x = hyst[0];
para->hyst_y = hyst[1];
- } else if (property == prop_orientation)
- {
- if (prop->size != 1 || prop->format != 32 || prop->type != XA_INTEGER)
- return BadMatch;
- para->orientation = *(INT32*)prop->data;
}
return Success;
diff --git a/src/ps2comm.c b/src/ps2comm.c
index 1c2bbc3..0e9b861 100644
--- a/src/ps2comm.c
+++ b/src/ps2comm.c
@@ -524,7 +524,7 @@ PS2ReadHwStateProto(InputInfoPtr pInfo,
SynapticsParameters *para = &priv->synpara;
struct PS2SynapticsHwInfo *synhw;
int newabs;
- int w, i, x, y;
+ int w, i;
synhw = (struct PS2SynapticsHwInfo*)priv->proto_data;
if (!synhw)
@@ -541,17 +541,17 @@ PS2ReadHwStateProto(InputInfoPtr pInfo,
return FALSE;
/* Handle normal packets */
- hw->x = hw->y = hw->z = hw->numFingers = hw->fingerWidth = x = y = 0;
+ hw->x = hw->y = hw->z = hw->numFingers = hw->fingerWidth = 0;
hw->left = hw->right = hw->up = hw->down = hw->middle = FALSE;
for (i = 0; i < 8; i++)
hw->multi[i] = FALSE;
if (newabs) { /* newer protos...*/
DBG(7, "using new protocols\n");
- x = (((buf[3] & 0x10) << 8) |
+ hw->x = (((buf[3] & 0x10) << 8) |
((buf[1] & 0x0f) << 8) |
buf[4]);
- y = (((buf[3] & 0x20) << 7) |
+ hw->y = (((buf[3] & 0x20) << 7) |
((buf[1] & 0xf0) << 4) |
buf[5]);
@@ -598,9 +598,9 @@ PS2ReadHwStateProto(InputInfoPtr pInfo,
}
} else { /* old proto...*/
DBG(7, "using old protocol\n");
- x = (((buf[1] & 0x1F) << 8) |
+ hw->x = (((buf[1] & 0x1F) << 8) |
buf[2]);
- y = (((buf[4] & 0x1F) << 8) |
+ hw->y = (((buf[4] & 0x1F) << 8) |
buf[5]);
hw->z = (((buf[0] & 0x30) << 2) |
@@ -612,29 +612,7 @@ PS2ReadHwStateProto(InputInfoPtr pInfo,
hw->right = (buf[0] & 0x02) ? 1 : 0;
}
- y = YMAX_NOMINAL + YMIN_NOMINAL - y;
-
- if (para->orientation==0)
- hw->x = x;
- else if (para->orientation==2)
- hw->x = priv->maxx + priv->minx - x;
- else if (para->orientation==3)
- hw->y = (priv->maxx - x) * (priv->maxy - priv->miny) / (priv->maxx - priv->minx) + priv->miny;
- else if (para->orientation==1)
- hw->y = (x - priv->minx) * (priv->maxy - priv->miny) / (priv->maxx - priv->minx) + priv->miny;
- else
- hw->x = x;
-
- if (para->orientation==0)
- hw->y = y;
- else if (para->orientation==2)
- hw->y = priv->maxy + priv->miny - y;
- else if (para->orientation==3)
- hw->x = (y - priv->miny) * (priv->maxx - priv->minx) / (priv->maxy - priv->miny) + priv->minx;
- else if (para->orientation==1)
- hw->x = (priv->maxy - y) * (priv->maxx - priv->minx) / (priv->maxy - priv->miny) + priv->minx;
- else
- hw->y = y;
+ hw->y = YMAX_NOMINAL + YMIN_NOMINAL - hw->y;
if (hw->z >= para->finger_high) {
int w_ok = 0;
diff --git a/src/synaptics.c b/src/synaptics.c
index 03a9f60..1233917 100644
--- a/src/synaptics.c
+++ b/src/synaptics.c
@@ -574,8 +574,6 @@ static void set_default_parameters(InputInfoPtr pInfo)
pars->resolution_horiz = xf86SetIntOption(opts, "HorizResolution", horizResolution);
pars->resolution_vert = xf86SetIntOption(opts, "VertResolution", vertResolution);
- pars->orientation = xf86SetIntOption(opts, "Orientation", 0);
-
/* Warn about (and fix) incorrectly configured TopEdge/BottomEdge parameters */
if (pars->top_edge > pars->bottom_edge) {
int tmp = pars->top_edge;
diff --git a/src/synapticsstr.h b/src/synapticsstr.h
index 90640f7..8f6593e 100644
--- a/src/synapticsstr.h
+++ b/src/synapticsstr.h
@@ -161,7 +161,6 @@ typedef struct _SynapticsParameters
unsigned int resolution_vert; /* vertical resolution of touchpad in units/mm */
int area_left_edge, area_right_edge, area_top_edge, area_bottom_edge; /* area coordinates absolute */
int hyst_x, hyst_y; /* x and y width of hysteresis box */
- int orientation; /* orientation of the touchpad */
} SynapticsParameters;