diff options
author | Peter Hutterer <peter.hutterer@redhat.com> | 2008-10-14 10:22:29 +1030 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@redhat.com> | 2008-10-14 10:22:29 +1030 |
commit | 117a54598043df6497fbc1ae4f047cc248441072 (patch) | |
tree | b123e2b36541d438981f7e7209e260d891e4c973 | |
parent | d0aa1083c0130861a2c78509b72847fc3f7ee5f3 (diff) |
Add special handling for Sunit dSeries. RH #445193
This model does not reply to queries about touchscreen identification. After
opening the fd, we can skip right to enabling the device.
Red Hat Bug <https://bugzilla.redhat.com/show_bug.cgi?id=445193>
-rw-r--r-- | man/elographics.man | 2 | ||||
-rw-r--r-- | src/xf86Elo.c | 102 |
2 files changed, 55 insertions, 49 deletions
diff --git a/man/elographics.man b/man/elographics.man index 9f59941..3a3e84e 100644 --- a/man/elographics.man +++ b/man/elographics.man @@ -73,7 +73,7 @@ event to occur. Default: 5 (50ms). Delay between report packets. Default: 1 (10ms). .TP .BI "Option \*qModel\*q \*q" string \*q -The touchscreen model. Default: unset. +The touchscreen model. Default: unset. Supported models: "Sunit dSeries". .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 d1c89e5..1620e44 100644 --- a/src/xf86Elo.c +++ b/src/xf86Elo.c @@ -69,6 +69,7 @@ * models to be treated specially. */ #define MODEL_UNKNOWN -1 +#define MODEL_SUNIT_D 1 typedef struct { int type; @@ -77,6 +78,7 @@ typedef struct { static Model SupportedModels[] = { + {MODEL_SUNIT_D, "Sunit dSeries"}, /* sunit dSeries models don't reply to queries */ {MODEL_UNKNOWN, NULL} }; /* @@ -860,57 +862,61 @@ xf86EloControl(DeviceIntPtr dev, Error("Unable to open Elographics touchscreen device"); return !Success; } - /* - * Try to see if the link is at the specified rate and - * ask the controller to report various infos. - */ - memset(req, 0, ELO_PACKET_SIZE); - req[1] = tolower(ELO_PARAMETER); - if (xf86EloSendQuery(req, reply, local->fd) != Success) { - priv->is_a_2310 = 1; - ErrorF("Not at the specified rate or model 2310, will continue\n"); - } - /* - * Ask the controller to report various infos. - */ - memset(req, 0, ELO_PACKET_SIZE); - req[1] = tolower(ELO_ID); - if (xf86EloSendQuery(req, reply, local->fd) == Success) { - xf86EloPrintIdent(reply, priv); - } - else { - ErrorF("Unable to ask Elographics touchscreen identification\n"); - goto not_success; - } + if (priv->model != MODEL_SUNIT_D) + { + /* + * Try to see if the link is at the specified rate and + * ask the controller to report various infos. + */ + memset(req, 0, ELO_PACKET_SIZE); + req[1] = tolower(ELO_PARAMETER); + if (xf86EloSendQuery(req, reply, local->fd) != Success) { + priv->is_a_2310 = 1; + ErrorF("Not at the specified rate or model 2310, will continue\n"); + } - /* - * Set the operating mode: Stream, no scaling, no calibration, - * no range checking, no trim, tracking enabled. - */ - memset(req, 0, ELO_PACKET_SIZE); - req[1] = ELO_MODE; - req[3] = ELO_TOUCH_MODE | ELO_STREAM_MODE | ELO_UNTOUCH_MODE; - req[4] = ELO_TRACKING_MODE; - if (xf86EloSendControl(req, local->fd) != Success) { - ErrorF("Unable to change Elographics touchscreen operating mode\n"); - goto not_success; - } + /* + * Ask the controller to report various infos. + */ + memset(req, 0, ELO_PACKET_SIZE); + req[1] = tolower(ELO_ID); + if (xf86EloSendQuery(req, reply, local->fd) == Success) { + xf86EloPrintIdent(reply, priv); + } + else { + ErrorF("Unable to ask Elographics touchscreen identification\n"); + goto not_success; + } - /* - * Set the touch reports timings from configuration data. - */ - memset(req, 0, ELO_PACKET_SIZE); - req[1] = ELO_REPORT; - req[2] = priv->untouch_delay; - req[3] = priv->report_delay; - if (xf86EloSendControl(req, local->fd) != Success) { - ErrorF("Unable to change Elographics touchscreen reports timings\n"); - - not_success: - SYSCALL(close(local->fd)); - local->fd = -1; - return !Success; + /* + * Set the operating mode: Stream, no scaling, no calibration, + * no range checking, no trim, tracking enabled. + */ + memset(req, 0, ELO_PACKET_SIZE); + req[1] = ELO_MODE; + req[3] = ELO_TOUCH_MODE | ELO_STREAM_MODE | ELO_UNTOUCH_MODE; + req[4] = ELO_TRACKING_MODE; + if (xf86EloSendControl(req, local->fd) != Success) { + ErrorF("Unable to change Elographics touchscreen operating mode\n"); + goto not_success; + } + + /* + * Set the touch reports timings from configuration data. + */ + memset(req, 0, ELO_PACKET_SIZE); + req[1] = ELO_REPORT; + req[2] = priv->untouch_delay; + req[3] = priv->report_delay; + if (xf86EloSendControl(req, local->fd) != Success) { + ErrorF("Unable to change Elographics touchscreen reports timings\n"); + +not_success: + SYSCALL(close(local->fd)); + local->fd = -1; + return !Success; + } } xf86AddEnabledDevice(local); dev->public.on = TRUE; |