summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2012-05-21 11:22:21 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2012-05-31 14:56:47 +1000
commitf2d275044d7a68d6fd116d420a0e6e33b0353b20 (patch)
treefffe2d327e3b422da203e43c9c85df1fbf5c1a35
parent84ca61a2ac4512bf542ecb8a44e32bd2a2f3fbff (diff)
Pass the fd down into QueryHardware
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r--src/alpscomm.c4
-rw-r--r--src/eventcomm.c10
-rw-r--r--src/ps2comm.c20
-rw-r--r--src/psmcomm.c2
-rw-r--r--src/synaptics-x11.c4
-rw-r--r--src/synaptics.c4
-rw-r--r--src/synaptics.h2
-rw-r--r--src/synproto.h2
8 files changed, 24 insertions, 24 deletions
diff --git a/src/alpscomm.c b/src/alpscomm.c
index 0fd1c69..9a9b18d 100644
--- a/src/alpscomm.c
+++ b/src/alpscomm.c
@@ -88,9 +88,9 @@ ALPS_initialize(int fd)
}
static Bool
-ALPSQueryHardware(SynapticsPrivate *priv)
+ALPSQueryHardware(SynapticsPrivate *priv, int fd)
{
- ALPS_initialize(priv->fd);
+ ALPS_initialize(fd);
return TRUE;
}
diff --git a/src/eventcomm.c b/src/eventcomm.c
index 8f13b18..c40d699 100644
--- a/src/eventcomm.c
+++ b/src/eventcomm.c
@@ -839,7 +839,7 @@ event_query_touch(SynapticsPrivate *priv, int fd)
* Probe the open device for dimensions.
*/
static Bool
-EventQueryHardware(SynapticsPrivate *priv)
+EventQueryHardware(SynapticsPrivate *priv, int fd)
{
struct eventcomm_proto_data *proto_data = priv->proto_data;
int i;
@@ -853,12 +853,12 @@ EventQueryHardware(SynapticsPrivate *priv)
proto_data->axis_map[i] = -1;
proto_data->cur_slot = -1;
- if (!event_query_is_touchpad(priv->fd, (proto_data) ? proto_data->need_grab : TRUE))
+ if (!event_query_is_touchpad(fd, (proto_data) ? proto_data->need_grab : TRUE))
return FALSE;
- event_query_touch(priv, priv->fd);
- event_query_axis_ranges(priv, priv->fd);
- event_query_model(priv->fd, &priv->model, &priv->id_vendor,
+ event_query_touch(priv, fd);
+ event_query_axis_ranges(priv, fd);
+ event_query_model(fd, &priv->model, &priv->id_vendor,
&priv->id_product);
SynapticsMsg(priv, MSG_INFO, "touchpad found\n");
diff --git a/src/ps2comm.c b/src/ps2comm.c
index 1ad6d15..cb22414 100644
--- a/src/ps2comm.c
+++ b/src/ps2comm.c
@@ -383,7 +383,7 @@ PS2DeviceOffHook(SynapticsPrivate *priv)
}
static Bool
-PS2QueryHardware(SynapticsPrivate *priv)
+PS2QueryHardware(SynapticsPrivate *priv, int fd)
{
int mode;
struct PS2SynapticsHwInfo *synhw;
@@ -393,21 +393,21 @@ PS2QueryHardware(SynapticsPrivate *priv)
synhw = (struct PS2SynapticsHwInfo *) priv->proto_data;
/* is the synaptics touchpad active? */
- if (!ps2_query_is_synaptics(priv, priv->fd, synhw))
+ if (!ps2_query_is_synaptics(priv, fd, synhw))
return FALSE;
SynapticsMsg(priv, MSG_INFO, "synaptics touchpad found\n");
- if (!ps2_synaptics_reset(priv->fd))
+ if (!ps2_synaptics_reset(fd))
SynapticsMsg(priv, MSG_ERROR, "reset failed\n");
- if (!ps2_synaptics_identify(priv->fd, synhw))
+ if (!ps2_synaptics_identify(fd, synhw))
return FALSE;
- if (!ps2_synaptics_model_id(priv->fd, synhw))
+ if (!ps2_synaptics_model_id(fd, synhw))
return FALSE;
- if (!ps2_synaptics_capability(priv->fd, synhw))
+ if (!ps2_synaptics_capability(fd, synhw))
return FALSE;
mode = SYN_BIT_ABSOLUTE_MODE | SYN_BIT_HIGH_RATE;
@@ -415,10 +415,10 @@ PS2QueryHardware(SynapticsPrivate *priv)
mode |= SYN_BIT_DISABLE_GESTURE;
if (SYN_CAP_EXTENDED(synhw))
mode |= SYN_BIT_W_MODE;
- if (!ps2_synaptics_set_mode(priv->fd, mode))
+ if (!ps2_synaptics_set_mode(fd, mode))
return FALSE;
- ps2_synaptics_enable_device(priv->fd);
+ ps2_synaptics_enable_device(fd);
ps2_print_ident(priv, synhw);
@@ -474,7 +474,7 @@ ps2_synaptics_get_packet(SynapticsPrivate *priv, struct PS2SynapticsHwInfo *synh
if ((c == 0x00) && (ps2_comm_data->lastByte == 0xAA)) {
if (xf86WaitForInput(priv->fd, 50000) == 0) {
PS2DBG("Reset received\n");
- proto_ops->QueryHardware(priv);
+ proto_ops->QueryHardware(priv, priv->fd);
}
else
PS2DBG("faked reset received\n");
@@ -503,7 +503,7 @@ ps2_synaptics_get_packet(SynapticsPrivate *priv, struct PS2SynapticsHwInfo *synh
if (ps2_comm_data->outOfSync > MAX_UNSYNC_PACKETS) {
ps2_comm_data->outOfSync = 0;
PS2DBG("Synaptics synchronization lost too long -> reset touchpad.\n");
- proto_ops->QueryHardware(priv); /* including a reset */
+ proto_ops->QueryHardware(priv, priv->fd); /* including a reset */
continue;
}
}
diff --git a/src/psmcomm.c b/src/psmcomm.c
index d06b60e..bce2a74 100644
--- a/src/psmcomm.c
+++ b/src/psmcomm.c
@@ -128,7 +128,7 @@ convert_hw_info(const synapticshw_t * psm_ident,
}
static Bool
-PSMQueryHardware(SynapticsPrivate *priv)
+PSMQueryHardware(SynapticsPrivate *priv, int fd)
{
synapticshw_t psm_ident;
struct PS2SynapticsHwInfo *synhw;
diff --git a/src/synaptics-x11.c b/src/synaptics-x11.c
index 890e4ff..3110ef0 100644
--- a/src/synaptics-x11.c
+++ b/src/synaptics-x11.c
@@ -394,7 +394,7 @@ DeviceOn(DeviceIntPtr dev)
xf86FlushInput(pInfo->fd);
/* reinit the pad */
- if (!SynapticsQueryHardware(priv)) {
+ if (!SynapticsQueryHardware(priv, priv->fd)) {
xf86CloseSerial(pInfo->fd);
pInfo->fd = -1;
return !Success;
@@ -750,7 +750,7 @@ SynapticsPreInit(InputDriverPtr drv, InputInfoPtr pInfo, int flags)
priv->fd = pInfo->fd;
/* read hardware dimensions */
- if (!SynapticsQueryHardware(priv)) {
+ if (!SynapticsQueryHardware(priv, priv->fd)) {
xf86IDrvMsg(pInfo, MSG_ERROR,
"Unable to query/initialize Synaptics hardware.\n");
goto SetupProc_fail;
diff --git a/src/synaptics.c b/src/synaptics.c
index a92f192..d7719d7 100644
--- a/src/synaptics.c
+++ b/src/synaptics.c
@@ -2207,9 +2207,9 @@ HandleState(SynapticsPrivate *priv, struct SynapticsHwState *hw, unsigned int no
}
Bool
-SynapticsQueryHardware(SynapticsPrivate *priv)
+SynapticsQueryHardware(SynapticsPrivate *priv, int fd)
{
- if (!priv->proto_ops->QueryHardware(priv)) {
+ if (!priv->proto_ops->QueryHardware(priv, fd)) {
SynapticsMsg(priv, MSG_INFO, "no supported touchpad found\n");
if (priv->proto_ops->DeviceOffHook)
priv->proto_ops->DeviceOffHook(priv);
diff --git a/src/synaptics.h b/src/synaptics.h
index fb479be..d7fa94d 100644
--- a/src/synaptics.h
+++ b/src/synaptics.h
@@ -71,7 +71,7 @@ void SynapticsCloseDevice(SynapticsPrivate *priv);
*/
void SynapticsSetTimer(SynapticsPrivate *priv, unsigned int now, unsigned int delay);
void CalculateScalingCoeffs(SynapticsPrivate * priv);
-Bool SynapticsQueryHardware(SynapticsPrivate *priv);
+Bool SynapticsQueryHardware(SynapticsPrivate *priv, int fd);
struct SynapticsProtocolOperations*
SynapticsGetDeviceProtocolOps(SynapticsPrivate *priv,
const char *proto,
diff --git a/src/synproto.h b/src/synproto.h
index b0dbcda..f8b7f01 100644
--- a/src/synproto.h
+++ b/src/synproto.h
@@ -98,7 +98,7 @@ struct SynapticsProtocolOperations {
Bool (*DeviceOnHook) (SynapticsPrivate *priv,
struct _SynapticsParameters * para);
Bool (*DeviceOffHook) (SynapticsPrivate *priv);
- Bool (*QueryHardware) (SynapticsPrivate * priv);
+ Bool (*QueryHardware) (SynapticsPrivate * priv, int fd);
Bool (*ReadHwState) (SynapticsPrivate * priv,
struct CommData * comm,
struct SynapticsHwState * hwRet);