As you may know by reading this group, a few people are impacted by a
misbehavior or their eGalax touchscreen where X and Y axis are swapped
and/or one or two axis direction is inverted.
The Pointer Location utility (in Dev Tools) is a nice program that
shows the problem but lets some hope in its fixing if the input,
although inverted, is smooth and linear.
My context:
- 800x480 screen
- USB eGalax resistive touchscreen (EEF:1)
- configuration cloned from asus_laptop
In this configuration, the eGalax USB device is handled by the HID
subsystem as a regular HID that sends "HID reports" when the screen is
touched.
After having determined the path from the report to the Input
Subsystem, I added the following code to the hidinput_hid_event()
function in kernel/drivers/hid/hid-input.c:
--- hid-input.c 2011-11-28 18:27:46.237516103 +0100
+++ hid-input.c.ori 2011-11-11 11:45:38.000000000 +0100
@@ -782,18 +782,6 @@
if (usage->type == EV_KEY && !!test_bit(usage->code, input->key) !=
value)
input_event(input, EV_MSC, MSC_SCAN, usage->hid);
-//+RDG: patch for eGalax touchscreen: swap X and Y, invert X
direction
-if (usage->type == EV_ABS)
-{
- if (usage->hid == HID_GD_X) {
- usage->code = 1; // vs 0 (X becomes Y)
- value = 4096 - value;
- } else if (usage->hid == HID_GD_Y) {
- usage->code = 0; // vs 1 (Y becomes X)
- }
-//printk("RDG: hidinput_hid_event: type = %d, code = %d, value = %d
(hid = 0x%x)\n", usage->type, usage->code, value, usage->hid);
-}
-//-RDG
input_event(input, usage->type, usage->code, value);
if ((field->flags & HID_MAIN_ITEM_RELATIVE) && (usage->type ==
EV_KEY))
This patch addresses my very own problem (X/Y swap and X inversion)
and you may have to adjust it to meet your needs.
Obviously, yet efficient, this patch is rather ugly. I am not a Linux
expert at all and I can imagine there are other ways to achieve the
same result more cleanly, the cleaner way probably being to create a
specific driver to address the problem. Any suggestion from actual
experts are welcome ;-)
Remi
on which version did you get this working? honycomb by any chance?
Alexandre
A
On 29 nov, 02:50, Chih-Wei Huang <cwhu...@android-x86.org> wrote:
> Hi Benjamin,
> Could you comment it? Thanks!
>
> 2011/11/29 rdg <gravela...@gmail.com>:
This patch is not so nice, as it should diserve a more stringent test
to actually decide when to activate the special processing: currently,
it is just a quick and dirty patch :-(
I put it in a place that is potentially shared by every HID in the
system (mouse, keyboard, etc.) and the only discrimination I made is
the EV_ABS test. It's OK in my system as the touchscreen is the only
source of EV_ABS input events but I really should try to make sure
that these events actually come from the touchscreen.
I got it working on Gingerbread but it is a Linux kernel patch and I
suppose it will work with any version of Android, including Honeycomb.
You just have to add a few lines to kernel/drivers/hid/hid-input.c,
rebuild the kernel and move it to your device.
Remi
On 30 nov, 10:08, Alexandre Chappaz <alexandrechap...@gmail.com>
wrote:
In this thread, the egalax TS is event not registered.
Seems like some big changes occured in the driver in the kernel ( hid-
egalax module is not avalaible any more in kernel 3.0 and is merged
into hid-multitouch ).
see http://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=commit;h=7fd23a24717a327a66f3c32d11a20a2f169c824f.
This is why I was asking which version you tried.
when I installed android-x86 version 2.2_RC2, I could use correctly
the calibration procedure (
http://groups.google.com/group/android-x86/browse_thread/thread/a0f110144ae40b5c/cc52495dec1a93bf?lnk=gst&q=chappaz#cc52495dec1a93bf
)
Just wanted to try the honeycomb image.
Je ferais ca qd je trouverai le temps!
++
@Alexandre:
In my kernel configuration, the eGalax device is handled has a generic
HID and there is no special processing done in usbtouchscreen.c, even
if CONFIG_TOUCHSCREEN_USB_EGALAX is true (0x0eef, 0x0001 is
DEVTYPE_IGNORE.) I tried to add my own device handling at this level
but something I still don't understand makes that the rare packets I
can see in my read_data routine are unusable (not all touches gives
packets here and packet contents seems irrelevant.)
As far as I understand, the pointercal file generated by ts_calibrate
is not used by Gingerbread and Honeycomb as it was in Froyo. The patch
advised by Max may be a clue on how to do it.
A+
Remi
On 30 nov, 12:11, Alexandre Chappaz <alexandrechap...@gmail.com>
wrote:
> Yes I understood it is a quite ugly patch, but anyway my device is
> also touchonly device ( modded eeepc 701)
> I was asking about the version because of what I read in another
> thead, ppl having issues having TS working in honeycomb (http://groups.google.com/group/android-x86/browse_thread/thread/b6308...).
>
> In this thread, the egalax TS is event not registered.
> Seems like some big changes occured in the driver in the kernel ( hid-
> egalax module is not avalaible any more in kernel 3.0 and is merged
> into hid-multitouch ).
> seehttp://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=c....
>
> This is why I was asking which version you tried.
>
> when I installed android-x86 version 2.2_RC2, I could use correctly
> the calibration procedure (http://groups.google.com/group/android-x86/browse_thread/thread/a0f11...
Hi!
I'm very new to android x86, and I'm wondering if it's possible to patch an already running system for the eGalax axis switch. I have an eee pc 701 with the 7" eGalax, so I'm pretty sure my problem is the same as yours. So - is it possible to change a file in the built system to make this switch or do I have to re-build the kernel? That seems a bit extreme and the only linux machine I have is the aforementioned eee pc.
Thank you for answering,
Jure
--To view this discussion on the web visit https://groups.google.com/d/msg/android-x86/-/p1N3UJK5XhkJ.
You received this message because you are subscribed to the Google Groups "Android-x86" group.
To post to this group, send email to andro...@googlegroups.com.
To unsubscribe from this group, send email to android-x86...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-x86?hl=en.
To unsubscribe from this group, send email to android-x86+unsubscribe@googlegroups.com.
--
- Andrew Trimble
It looks like you've copied the code into the file instead of applying it as a patch. To do it this way, all you must copy is this
//+RDG: patch for eGalax touchscreen: swap X and Y, invert X direction
if (usage->type == EV_ABS)
{
if (usage->hid == HID_GD_X) {
usage->code = 1; // vs 0 (X becomes Y)
value = 4096 - value;
} else if (usage->hid == HID_GD_Y) {
usage->code = 0; // vs 1 (Y becomes X)
}
}
//-RDG
In between the blue bits. The errors are generated by the symbols in the patch syntax - @,-,+, and new lines being distorted when copying and pasting.
Josh