summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--man/elographics.man3
-rw-r--r--src/xf86Elo.c31
2 files changed, 34 insertions, 0 deletions
diff --git a/man/elographics.man b/man/elographics.man
index 8dac6b5..9f59941 100644
--- a/man/elographics.man
+++ b/man/elographics.man
@@ -71,6 +71,9 @@ event to occur. Default: 5 (50ms).
.TP
.BI "Option \*qReportDelay\*q \*q" integer \*q
Delay between report packets. Default: 1 (10ms).
+.TP
+.BI "Option \*qModel\*q \*q" string \*q
+The touchscreen model. Default: unset.
.SH "SEE ALSO"
__xservername__(__appmansuffix__), __xconfigfile__(__filemansuffix__), xorgconfig(__appmansuffix__), Xserver(__appmansuffix__), X(__miscmansuffix__).
.SH AUTHORS
diff --git a/src/xf86Elo.c b/src/xf86Elo.c
index dfb05d1..d1c89e5 100644
--- a/src/xf86Elo.c
+++ b/src/xf86Elo.c
@@ -65,6 +65,20 @@
#include "xf86Module.h"
#endif
+/**
+ * models to be treated specially.
+ */
+#define MODEL_UNKNOWN -1
+
+typedef struct {
+ int type;
+ char *name;
+} Model;
+
+static Model SupportedModels[] =
+{
+ {MODEL_UNKNOWN, NULL}
+};
/*
***************************************************************************
*
@@ -186,6 +200,7 @@ typedef struct _EloPrivateRec {
int packet_buf_p; /* Assembly buffer pointer */
int swap_axes; /* Swap X an Y axes if != 0 */
unsigned char packet_buf[ELO_PACKET_SIZE]; /* Assembly buffer */
+ int model; /* one of MODEL_... */
} EloPrivateRec, *EloPrivatePtr;
/*
@@ -1039,6 +1054,9 @@ xf86EloInit(InputDriverPtr drv,
char *str;
int portrait = 0;
int height, width;
+ char *opt_model;
+ Model* model;
+
local = xf86EloAllocate(drv);
if (!local) {
@@ -1065,6 +1083,19 @@ xf86EloInit(InputDriverPtr drv,
}
priv->input_dev = strdup(str);
+ opt_model = xf86SetStrOption(local->options, "Model", NULL);
+ model = SupportedModels;
+ priv->model = MODEL_UNKNOWN;
+ while(model->type != MODEL_UNKNOWN && opt_model)
+ {
+ if (!strcmp(model->name, opt_model))
+ {
+ priv->model = model->type;
+ break;
+ }
+ model++;
+ }
+
local->name = xf86SetStrOption(local->options, "DeviceName", XI_TOUCHSCREEN);
xf86Msg(X_CONFIG, "Elographics X device name: %s\n", local->name);
priv->screen_no = xf86SetIntOption(local->options, "ScreenNo", 0);