Commit 6df2b83a authored by Peter Osterlund's avatar Peter Osterlund

Don't call PS2QueryHardware() from PSMReadHwState().

parent 52376f3b
......@@ -72,6 +72,7 @@ SynapticsReadEvent(struct CommData *comm, struct input_event *ev)
static Bool
EventReadHwState(LocalDevicePtr local, struct SynapticsHwInfo *synhw,
struct SynapticsProtocolOperations *proto_ops,
struct CommData *comm, struct SynapticsHwState *hwRet)
{
struct input_event ev;
......
......@@ -550,6 +550,7 @@ ps2_packet_ok(struct SynapticsHwInfo *synhw, struct CommData *comm)
static Bool
ps2_synaptics_get_packet(LocalDevicePtr local, struct SynapticsHwInfo *synhw,
struct SynapticsProtocolOperations *proto_ops,
struct CommData *comm)
{
int count = 0;
......@@ -563,7 +564,7 @@ ps2_synaptics_get_packet(LocalDevicePtr local, struct SynapticsHwInfo *synhw,
if ((c == 0x00) && (comm->lastByte == 0xAA)) {
if (xf86WaitForInput(local->fd, 50000) == 0) {
DBG(7, ErrorF("Reset received\n"));
PS2QueryHardware(local, synhw);
proto_ops->QueryHardware(local, synhw);
} else
DBG(3, ErrorF("faked reset received\n"));
}
......@@ -589,7 +590,7 @@ ps2_synaptics_get_packet(LocalDevicePtr local, struct SynapticsHwInfo *synhw,
if (comm->outOfSync > MAX_UNSYNC_PACKETS) {
comm->outOfSync = 0;
DBG(3, ErrorF("Synaptics synchronization lost too long -> reset touchpad.\n"));
PS2QueryHardware(local, synhw); /* including a reset */
proto_ops->QueryHardware(local, synhw); /* including a reset */
continue;
}
}
......@@ -610,6 +611,7 @@ ps2_synaptics_get_packet(LocalDevicePtr local, struct SynapticsHwInfo *synhw,
static Bool
PS2ReadHwState(LocalDevicePtr local, struct SynapticsHwInfo *synhw,
struct SynapticsProtocolOperations *proto_ops,
struct CommData *comm, struct SynapticsHwState *hwRet)
{
int newabs = SYN_MODEL_NEWABS(*synhw);
......@@ -617,7 +619,7 @@ PS2ReadHwState(LocalDevicePtr local, struct SynapticsHwInfo *synhw,
struct SynapticsHwState *hw = &(comm->hwState);
int w, i;
if (!ps2_synaptics_get_packet(local, synhw, comm))
if (!ps2_synaptics_get_packet(local, synhw, proto_ops, comm))
return FALSE;
/* Handle guest packets */
......
......@@ -149,9 +149,10 @@ PSMQueryHardware(LocalDevicePtr local, struct SynapticsHwInfo *synhw)
static Bool
PSMReadHwState(LocalDevicePtr local, struct SynapticsHwInfo *synhw,
struct SynapticsProtocolOperations *proto_ops,
struct CommData *comm, struct SynapticsHwState *hwRet)
{
return psaux_proto_operations.ReadHwState(local, synhw, comm, hwRet);
return psaux_proto_operations.ReadHwState(local, synhw, proto_ops, comm, hwRet);
}
static Bool PSMAutoDevProbe(LocalDevicePtr local)
......
......@@ -657,7 +657,8 @@ SynapticsGetHwState(LocalDevicePtr local, SynapticsPrivate *priv,
}
return FALSE;
}
return priv->proto_ops->ReadHwState(local, &priv->synhw, &priv->comm, hw);
return priv->proto_ops->ReadHwState(local, &priv->synhw, priv->proto_ops,
&priv->comm, hw);
}
/*
......
......@@ -78,6 +78,7 @@ struct SynapticsProtocolOperations {
void (*DeviceOffHook)(LocalDevicePtr local);
Bool (*QueryHardware)(LocalDevicePtr local, struct SynapticsHwInfo *synhw);
Bool (*ReadHwState)(LocalDevicePtr local, struct SynapticsHwInfo *synhw,
struct SynapticsProtocolOperations *proto_ops,
struct CommData *comm, struct SynapticsHwState *hwRet);
Bool (*autoDevProbe)(LocalDevicePtr local);
};
......
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