Package: tslib Version: 1.0-4 Tags: patch On 32 Bit PowerPC (or any other 32bit BE machine) the event module reports
|selected device is not a touchscreen I understand and does not process any input from the device. I've sent the following patch to upstram [1] at Thu May 8 13:14:04 CEST 2008 with no response so far. [1] https://lists.berlios.de/pipermail/tslib-general/2008-May/000036.html --- The bit / absbit is defined the same way as in kernel. {EV|ABS}_CNT is only exported in recent kernels. Signed-off-by: Sebastian Siewior <[EMAIL PROTECTED]> --- plugins/input-raw.c | 24 ++++++++++++++++-------- 1 files changed, 16 insertions(+), 8 deletions(-) diff --git a/plugins/input-raw.c b/plugins/input-raw.c index 6b01fd8..0539473 100644 --- a/plugins/input-raw.c +++ b/plugins/input-raw.c @@ -49,25 +49,33 @@ struct tslib_input { int grab_events; }; +#define BITS_PER_LONG (sizeof(long) * 8) +#ifndef EV_CNT +#define EV_CNT (EV_MAX+1) +#endif +#ifndef ABS_CNT +#define ABS_CNT (ABS_MAX+1) +#endif + static int check_fd(struct tslib_input *i) { struct tsdev *ts = i->module.dev; int version; - u_int32_t bit; - u_int64_t absbit; + unsigned long bit[EV_CNT / BITS_PER_LONG + 1]; + unsigned long absbit[ABS_MAX / BITS_PER_LONG + 1]; if (! ((ioctl(ts->fd, EVIOCGVERSION, &version) >= 0) && (version == EV_VERSION) && - (ioctl(ts->fd, EVIOCGBIT(0, sizeof(bit) * 8), &bit) >= 0) && - (bit & (1 << EV_ABS)) && - (ioctl(ts->fd, EVIOCGBIT(EV_ABS, sizeof(absbit) * 8), &absbit) >= 0) && - (absbit & (1 << ABS_X)) && - (absbit & (1 << ABS_Y)) && (absbit & (1 << ABS_PRESSURE)))) { + (ioctl(ts->fd, EVIOCGBIT(0, EV_CNT), bit) >= 0) && + (bit[0] & (1 << EV_ABS)) && + (ioctl(ts->fd, EVIOCGBIT(EV_ABS, ABS_CNT), absbit) >= 0) && + (absbit[0] & (1 << ABS_X)) && + (absbit[0] & (1 << ABS_Y)) && (absbit[0] & (1 << ABS_PRESSURE)))) { fprintf(stderr, "selected device is not a touchscreen I understand\n"); return -1; } - if (bit & (1 << EV_SYN)) + if (bit[0] & (1 << EV_SYN)) i->using_syn = 1; if (i->grab_events == GRAB_EVENTS_WANTED) { -- 1.6.0 -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

