Module Name:    xsrc
Committed By:   mrg
Date:           Wed Jun  5 01:03:12 UTC 2013

Modified Files:
        xsrc/external/mit/xf86-input-elographics/dist/src: xf86Elo.c
Removed Files:
        xsrc/external/mit/xf86-input-synaptics/dist/include: synaptics.h
        xsrc/external/mit/xf86-input-synaptics/dist/src: alpscomm.h

Log Message:
merge xf86-input-elographics 1.4.1 and xf86-input-synaptics 1.7.1.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 \
    xsrc/external/mit/xf86-input-elographics/dist/src/xf86Elo.c
cvs rdiff -u -r1.1.1.1 -r0 \
    xsrc/external/mit/xf86-input-synaptics/dist/include/synaptics.h
cvs rdiff -u -r1.1.1.1 -r0 \
    xsrc/external/mit/xf86-input-synaptics/dist/src/alpscomm.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: xsrc/external/mit/xf86-input-elographics/dist/src/xf86Elo.c
diff -u xsrc/external/mit/xf86-input-elographics/dist/src/xf86Elo.c:1.2 xsrc/external/mit/xf86-input-elographics/dist/src/xf86Elo.c:1.3
--- xsrc/external/mit/xf86-input-elographics/dist/src/xf86Elo.c:1.2	Sat Jul 23 21:56:54 2011
+++ xsrc/external/mit/xf86-input-elographics/dist/src/xf86Elo.c	Wed Jun  5 01:03:12 2013
@@ -66,7 +66,7 @@
 
 typedef struct {
     int         type;
-    char        *name;
+    const char  *name;
 } Model;
 
 static Model SupportedModels[] =
@@ -248,7 +248,7 @@ xf86EloGetPacket(unsigned char	*buffer,
    * Okay, give up.
    */
   if (num_bytes < 0) {
-    Error("System error while reading from Elographics touchscreen.");
+    ErrorF("System error while reading from Elographics touchscreen.");
     return !Success;
   }
   DBG(4, ErrorF("Read %d bytes\n", num_bytes));
@@ -722,7 +722,7 @@ xf86EloControl(DeviceIntPtr	dev,
 	/* I will map coordinates myself */
 	InitValuatorAxisStruct(dev, 0,
 			       axis_labels[0],
-			       -1, -1,
+			       priv->min_x, priv->max_x,
 			       9500,
 			       0     /* min_res */,
 			       9500  /* max_res */
@@ -732,7 +732,7 @@ xf86EloControl(DeviceIntPtr	dev,
 			       );
 	InitValuatorAxisStruct(dev, 1,
 			       axis_labels[1],
-			       -1, -1,
+			       priv->min_y, priv->max_y,
 			       10500,
 			       0     /* min_res */,
 			       10500 /* max_res */
@@ -764,7 +764,7 @@ xf86EloControl(DeviceIntPtr	dev,
       DBG(2, ErrorF("Elographics touchscreen opening : %s\n", priv->input_dev));
       pInfo->fd = xf86OpenSerial(pInfo->options);
       if (pInfo->fd < 0) {
-	Error("Unable to open Elographics touchscreen device");
+	ErrorF("Unable to open Elographics touchscreen device");
 	return !Success;
       }
 
@@ -856,7 +856,7 @@ xf86EloControl(DeviceIntPtr	dev,
 
   default:
       ErrorF("unsupported mode=%d\n", mode);
-      return !Success;
+      return BadValue;
   }
 }
 
@@ -892,13 +892,12 @@ xf86EloAllocate(InputDriverPtr drv, Inpu
   priv->packet_buf_p = 0;
   priv->swap_axes = 0;
 
-  pInfo->flags = 0 /* XI86_NO_OPEN_ON_INIT */;
   pInfo->device_control = xf86EloControl;
   pInfo->read_input   = xf86EloReadInput;
   pInfo->control_proc = NULL;
   pInfo->switch_mode  = NULL;
   pInfo->private      = priv;
-  pInfo->type_name    = "Elographics TouchScreen";
+  pInfo->type_name    = XI_TOUCHSCREEN;
 
   return Success;
 }
@@ -917,7 +916,11 @@ xf86EloUninit(InputDriverPtr	drv,
   xf86DeleteInput(pInfo, 0);
 }
 
-static char *default_options[] = {
+static
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 18
+const
+#endif
+char *default_options[] = {
   "BaudRate", "9600",
   "StopBits", "1",
   "DataBits", "8",
@@ -932,7 +935,7 @@ xf86EloInit(InputDriverPtr	drv,
 	    int			flags)
 {
   EloPrivatePtr		priv=NULL;
-  char			*str;
+  const char		*str;
   int			portrait = 0;
   int			height, width;
   char			*opt_model;
@@ -946,18 +949,21 @@ xf86EloInit(InputDriverPtr	drv,
 
   priv = pInfo->private;
 
-  str = xf86FindOptionValue(pInfo->options, "Device");
+  str = xf86SetStrOption(pInfo->options, "Device", NULL);
   if (!str) {
     xf86Msg(X_ERROR, "%s: No Device specified in Elographics module config.\n",
 	    pInfo->name);
-    if (priv) {
-      if (priv->input_dev) {
-	free(priv->input_dev);
-      }
-      free(priv);
-    }
     return BadValue;
+  } else {
+      pInfo->fd = xf86OpenSerial(pInfo->options);
+      if (pInfo->fd < 0) {
+	xf86Msg(X_ERROR, "%s: Unable to open Elographics touchscreen device %s", pInfo->name, str);
+	return BadValue;
+      }
+      xf86CloseSerial(pInfo->fd);
+      pInfo->fd = -1;
   }
+
   priv->input_dev = strdup(str);
 
   opt_model = xf86SetStrOption(pInfo->options, "Model", NULL);
@@ -973,8 +979,6 @@ xf86EloInit(InputDriverPtr	drv,
       model++;
   }
 
-  pInfo->name = xf86SetStrOption(pInfo->options, "DeviceName", XI_TOUCHSCREEN);
-  xf86Msg(X_CONFIG, "Elographics X device name: %s\n", pInfo->name);
   priv->screen_no = xf86SetIntOption(pInfo->options, "ScreenNo", 0);
   xf86Msg(X_CONFIG, "Elographics associated screen: %d\n", priv->screen_no);
   priv->untouch_delay = xf86SetIntOption(pInfo->options, "UntouchDelay", ELO_UNTOUCH_DELAY);

Reply via email to