Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:steffens:lvermgeo:client
waltoptablet-kmp
waltoptablet.c.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File waltoptablet.c.patch of Package waltoptablet-kmp
--- waltoptablet.c.orig 2010-05-26 11:49:20.000000000 +0200 +++ waltoptablet.c 2010-05-26 11:49:36.000000000 +0200 @@ -16,7 +16,10 @@ MODULE_DESCRIPTION(DRIVER_DESC); MODULE_LICENSE("GPL"); -#define waltop_LENGTH 9 +#define waltop_LENGTH 7 +#ifndef SERIO_WALTOP +#define SERIO_WALTOP 0x3f +#endif /* Defined a Tablet data structure. */ struct waltop { @@ -35,14 +38,20 @@ struct input_dev *dev = mywaltop->dev; unsigned int x_coord, y_coord, sw_status, pressurevalue; // GaryYeh: for parse the data packet + if (mywaltop->idx == 0) { - if ((data & 0xf0) != 0x80) return IRQ_HANDLED; /* resync skip until start of frame */ + if ((data & 0xf0) != 0x90) + { + printk(KERN_INFO "waltop resync skip until start of frame\n"); + return IRQ_HANDLED; /* resync skip until start of frame */ + } } else { if (data & 0x80) { + printk(KERN_INFO "waltop resync skip garbage\n"); mywaltop->idx = 0; /* resync skip garbage */ return IRQ_HANDLED; } @@ -52,29 +61,26 @@ if (mywaltop->idx == waltop_LENGTH) { - x_coord = (mywaltop->data[1] & 0x7F) << 9; // GaryYeh: high byte - x_coord |= (mywaltop->data[2] & 0x7F) << 2; // GaryYeh: low byte - x_coord |= (mywaltop->data[6] & 0x60) >> 5; // GaryYeh: lowest 2 bit at byte6 + x_coord = mywaltop->data[1] << 1; + x_coord |= (mywaltop->data[6] & 0x02)<<7; + x_coord |= (mywaltop->data[6] & 0x01); + x_coord |= mywaltop->data[2] << 9; input_report_abs(dev, ABS_X, x_coord); - y_coord = (mywaltop->data[3] & 0x7F) << 9; // GaryYeh: high byte - y_coord |= (mywaltop->data[4] & 0x7F) << 2; // GaryYeh: low byte - y_coord |= (mywaltop->data[6] & 0x60) >> 3; // GaryYeh: lowest 2 bit at byte6 + + y_coord = mywaltop->data[3]<<1; + y_coord |= (mywaltop->data[6] & 0x08) << 5; + y_coord |= (mywaltop->data[6] & 0x04)>>2; + y_coord |= mywaltop->data[4] << 9; input_report_abs(dev, ABS_Y, y_coord); - pressurevalue = (mywaltop->data[5] & 0x7F); // GaryYeh: Acturally, this byte is enough... - pressurevalue |= (mywaltop->data[6] & 0x07) << 7; + + pressurevalue = mywaltop->data[5]; + pressurevalue |= (mywaltop->data[6] & 0xf0) << 7; input_report_abs(dev, ABS_PRESSURE, pressurevalue); - sw_status = (mywaltop->data[0] & 0x07); - if ( sw_status == 0 ) - { - input_report_key(dev, BTN_TOUCH, 0); - printk(KERN_INFO "X COORD=%d, Y COORD=%d, SW=%d,,,,,\n", x_coord, y_coord, sw_status); - } - else - { - input_report_key(dev, BTN_TOUCH, 1); - printk(KERN_INFO "x_coord=%d, y_coord=%d, sw=%d.....\n", x_coord, y_coord, sw_status); - } - + + sw_status = (mywaltop->data[0] & 0x03); + input_report_key(dev, BTN_LEFT, sw_status & 1); + input_report_key(dev, BTN_RIGHT, sw_status & 2); + input_sync(dev); /* GaryYeh: To prevent it be interpreted seperately.*/ mywaltop->idx = 0; /* GaryYeh: reset index value. */ } @@ -120,7 +126,8 @@ input_dev->id.product = 0; input_dev->id.version = 0x0100; input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS); // using BIT_MASK to shift several bits - input_dev->keybit[BIT_WORD(BTN_TOUCH)] = BIT_MASK(BTN_TOUCH); + input_dev->keybit[BIT_WORD(BTN_LEFT)] = BIT_MASK(BTN_LEFT); + input_dev->keybit[BIT_WORD(BTN_RIGHT)] |= BIT_MASK(BTN_RIGHT); input_set_abs_params(input_dev, ABS_PRESSURE, 0, 256-1, 0, 0); // pressure maximum levels input_set_abs_params(input_dev, ABS_X, 0, 12300-1, 0, 0); // X Maximum coordinates
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor