Linux Help
guides forums blogs
Home Desktops Distributions ISO Images Logos Newbies Reviews Software Support & Resources Linuxhelp Wiki

Welcome Guest ( Log In | Register )



Advanced DNS Management
New ZoneEdit. New Managment.

FREE DNS Is Back

Sign Up Now
> Fedora 8 Touchscreen egalax/evtouch driver not working, Touchscreen problems
NMangal
post Jun 12 2008, 02:26 PM
Post #1


Whats this Lie-nix Thing?
*

Group: Members
Posts: 1
Joined: 12-June 08
Member No.: 13,506



Hi there,
I am stuck tyring to figure out how to get my monitor's touchscreen working.
Driver: egalax 2.0.3.1712 Touchkit.
2.6.23.1-42.fc8
X-version :1.3.0



I have downloaded and copied an egalax_drv.so to /usr/lib/xorg/modules/input and modified my xorg.conf file as per instructions.

I get the folloiwng message in my /var/log/Xorg.0.log

[nmangal@localhost ~]$ cat /var/log/Xorg.0.log | grep egalax
(II) LoadModule: "egalax"
(II) Loading /usr/lib/xorg/modules//input/egalax_drv.so
dlopen: /usr/lib/xorg/modules//input/egalax_drv.so: wrong ELF class: ELFCLASS64
(EE) Failed to load /usr/lib/xorg/modules//input/egalax_drv.so
(II) UnloadModule: "egalax"
(EE) Failed to load module "egalax" (loader failed, 7)
(EE) No Input driver matching `egalax'

Has anyone faced similar problems before? Any help will be really really appreciated.


Also tried with evtouch driver and the module loaded up fine however I couldn't get the touchscreen working.

Thanks!
Go to the top of the page
 
+Quote Post
 
Start new topic
Replies
rlevanm
post Aug 13 2008, 04:37 PM
Post #2


Whats this Lie-nix Thing?
*

Group: Members
Posts: 1
Joined: 13-August 08
Member No.: 13,614



Yes but I was using XFree86/Xfbdev instead of Xorg and my platform was embedded with kernel 2.6.22. It took me awhile to figure out.
I hope that my solution could give you some clues.

To make the USB touchscreen from eGalax to work with my USB optical mouse, I had to make few changes to the kernel AND the XFree86/tinyx code.

1. Kernel: I followed http://www.gossamer-threads.com/lists/linux/kernel/940118 and made my usbtouchscreen driver to ignore the eGalax. The io /dev/hiddev0 will pick up the device instead.
Check the input with cat on console.

2. Tslib: download tslib (1.0) and use it in X as well as the calibration tool provided with this package. The original raw input plugin didn't work well with eGalax.
Taking clues from http://zalman.ostergaard.net/touch.htm, I added a pluggin tk-raw.c (to tslib/plugins) to read HID messages from /dev/hiddev0.
The incoming messages are of 8 bytes with bytes (0,1)=type, (2,3)=code, (4,5)=value, (6,7)=pad.

The types and codes looked something like this:

tk-raw.c

/* Event type */
#define HID_EVENT_TYPE_X 0x30
#define HID_EVENT_TYPE_Y 0x31
#define HID_EVENT_TYPE_PRESS 0x42
#define HID_EVENT_TYPE_SYNC 0x32

/* Event code */
#define HID_EVENT_CODE_ABS 0x1
#define HID_EVENT_CODE_PEN 0xd
...
static int
ts_read_bytes (int fd, struct input_event *ev, int timeout)
{
int n, i;
char b[HID_EVENT_MSG_SIZE];
int type1, code1, val1, pad1;

while(1)
{
if (timeout && (TsWaitForReadable (fd, timeout) != 0))
return -1;
n = read (fd, b, HID_EVENT_MSG_SIZE);
if (n <= 0)
return -1;

type1 = (int)((b[1]<<8)|b[0]);
code1 = (int)((b[3]<<8)|b[2]);
val1 = (int)((b[5]<<8)|b[4]);
pad1 = (int)((b[7]<<8)|b[6]);

switch(type1)
{
case HID_EVENT_TYPE_SYNC:
ev->type = EV_SYN;
return 1;
case HID_EVENT_TYPE_PRESS:
if (code1 == HID_EVENT_CODE_PEN)
{
ev->type = EV_ABS;
ev->code = ABS_PRESSURE;
ev->value = val1;
}
return 1;
case HID_EVENT_TYPE_X:
if (code1 == HID_EVENT_CODE_ABS)
{
ev->type = EV_ABS;
ev->code = ABS_X;
ev->value = val1;
}
return 1;
case HID_EVENT_TYPE_Y:
if (code1 == HID_EVENT_CODE_ABS)
{
ev->type = EV_ABS;
ev->code = ABS_Y;
ev->value = val1;
}
return 1;
}
}
}
...
static int ts_tk_read(struct tslib_module_info *inf,
struct ts_sample *samp, int nr)
{
struct tslib_input *i = (struct tslib_input *)inf;
struct tsdev *ts = inf->dev;
struct input_event ev;
int ret = nr;
int total = 0;

if (i->sane_fd == 0)
i->sane_fd = check_tk_fd(i);

if (i->sane_fd == -1)
return 0;

if (i->using_syn)
{
samp->x = 0;
samp->y = 0;
samp->pressure = 0;

while (total < nr)
{
ret = ts_read_bytes (ts->fd, &ev, 0);
if (ret != 1)
{
total = -1;
break;
}

switch (ev.type)
{
....
static const struct tslib_ops __ts_tk_ops = {
.read = ts_tk_read,
.fini = ts_tk_fini,
};
...

3. In /etc/ts.conf, I changed module_raw to use my newly created plugin tk-raw instead of input.

4. I cross-compiled tslib libraries and its tools. I installed the tool to my target platform (using make) and used ts_calibrate to generate the calibration file. Then used ts_test to check the calibration.
This should worked fine with the changes above.

5. To have my USB mouse working with the egalax using tslib, I added an option -ts to tinyx.c. I create a new KdMouseInfo container (KdTsInfo) in txinfo.c and use it in linux/tslib.c instead of KdMouseInfo.

6. I made sure that X used the generated tslib libraries. I then cross-compild XFree86 with option HasTsLib equals YES (xc/config/cf/host.def) and installed X on the target.

7. I tested >Xfbdev -mouse /dev/input/mice -ts /dev/hiddev0. And everything worked fine.

If there is less complicated ways to do it, I am all ears.
Go to the top of the page
 
+Quote Post
davidtgbe
post Sep 6 2008, 02:18 PM
Post #3


Whats this Lie-nix Thing?
*

Group: Members
Posts: 2
Joined: 6-September 08
Member No.: 13,653



Hi rlevanm, I would be very pleased to you if you could send me your tk-raw.c. I'm trying to make working a Lilliput with TSLIB using the HID RAW kernel driver, using /dev/usb/hiddev0. I have made it working on X windows without problem, but I would like to it with QT4 embedded as well using the framebuffer.

Thank you very much!
Go to the top of the page
 
+Quote Post

Posts in this topic


Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 15th December 2017 - 02:49 PM