summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnas Nashif <anas.nashif@intel.com>2012-11-15 17:46:44 -0800
committerAnas Nashif <anas.nashif@intel.com>2012-11-15 17:46:44 -0800
commit130f74ca64ca7b41c4d0ee01d8f9ffbd2dccddfa (patch)
treecc9e8ad5e4a131eb082d2132bf33e8ee6e5ae9bf
parentaa07031c56db30f0e01c1f5ef6b25a9aac4fb144 (diff)
downloadxf86-input-synaptics-130f74ca64ca7b41c4d0ee01d8f9ffbd2dccddfa.tar.gz
xf86-input-synaptics-130f74ca64ca7b41c4d0ee01d8f9ffbd2dccddfa.tar.bz2
xf86-input-synaptics-130f74ca64ca7b41c4d0ee01d8f9ffbd2dccddfa.zip
wait
-rw-r--r--src/eventcomm.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/eventcomm.c b/src/eventcomm.c
index 280ef9b..e1154e1 100644
--- a/src/eventcomm.c
+++ b/src/eventcomm.c
@@ -926,6 +926,8 @@ EventAutoDevProbe(InputInfoPtr pInfo, const char *device)
int i;
Bool touchpad_found = FALSE;
struct dirent **namelist;
+ int wait = 0;
+ const int max_wait = 2000;
if (device) {
int fd = -1;
@@ -943,6 +945,7 @@ EventAutoDevProbe(InputInfoPtr pInfo, const char *device)
}
}
+ while (wait <= max_wait && !touchpad_found) {
i = scandir(DEV_INPUT_EVENT, &namelist, EventDevOnly, alphasort);
if (i < 0) {
xf86IDrvMsg(pInfo, X_ERROR, "Couldn't open %s\n", DEV_INPUT_EVENT);
@@ -967,8 +970,8 @@ EventAutoDevProbe(InputInfoPtr pInfo, const char *device)
if (event_query_is_touchpad(fd, TRUE)) {
touchpad_found = TRUE;
- xf86IDrvMsg(pInfo, X_PROBED, "auto-dev sets device to %s\n",
- fname);
+ xf86IDrvMsg(pInfo, X_PROBED, "auto-dev sets device to %s (waited %d msec)\n",
+ fname, wait);
pInfo->options =
xf86ReplaceStrOption(pInfo->options, "Device", fname);
}
@@ -976,6 +979,13 @@ EventAutoDevProbe(InputInfoPtr pInfo, const char *device)
}
free(namelist[i]);
}
+ if (!touchpad_found) {
+ xf86IDrvMsg(pInfo, X_ERROR, "waiting 100 msec to become devices ready\n");
+ usleep(100*1000);
+ wait += 100;
+ xf86IDrvMsg(pInfo, X_ERROR, "aiting time total: %d\n", wait);
+ }
+ } /* while (wait <= max_wait && !touchpad_found) */
free(namelist);