From: Kyle E. <ke...@an...> - 2013-01-24 16:02:49
|
In reference to bug 3363508 - TPC93 finger coordinates do not match pen I had a patch that fixed the issue, but it does not work with newer code. The quirk is processed and input_set_abs_params is getting the min & max values, but x_max is the only knob that affects the cursor position. Does anyone have any insight as to why this is? Following is the updated patch: TPC93 has two tools, finger and pen. Pen reports it's limits correctly, but finger does not. This patch enables setting the min along with the max and defines those values for Tablet PC93. --- drivers/input/tablet/wacom.h | 2 +- drivers/input/tablet/wacom_sys.c | 2 +- drivers/input/tablet/wacom_wac.c | 14 +++++++++++--- drivers/input/tablet/wacom_wac.h | 2 ++ 4 files changed, 15 insertions(+), 5 deletions(-) diff --git a/drivers/input/tablet/wacom.h b/drivers/input/tablet/wacom.h index b79d451..2883c70 100644 --- a/drivers/input/tablet/wacom.h +++ b/drivers/input/tablet/wacom.h @@ -134,7 +134,7 @@ static inline void wacom_schedule_work(struct wacom_wac *wacom_wac) extern const struct usb_device_id wacom_ids[]; void wacom_wac_irq(struct wacom_wac *wacom_wac, size_t len); -void wacom_setup_device_quirks(struct wacom_features *features); +void wacom_setup_device_quirks(struct wacom_features *features, int product_id); int wacom_setup_input_capabilities(struct input_dev *input_dev, struct wacom_wac *wacom_wac); #endif diff --git a/drivers/input/tablet/wacom_sys.c b/drivers/input/tablet/wacom_sys.c index f92d34f..6dcc1b4 100644 --- a/drivers/input/tablet/wacom_sys.c +++ b/drivers/input/tablet/wacom_sys.c @@ -1321,7 +1321,7 @@ static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *i } } - wacom_setup_device_quirks(features); + wacom_setup_device_quirks(features, id->idProduct); strlcpy(wacom_wac->name, features->name, sizeof(wacom_wac->name)); diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c index 264138f..0baf6a6 100644 --- a/drivers/input/tablet/wacom_wac.c +++ b/drivers/input/tablet/wacom_wac.c @@ -1401,7 +1401,7 @@ static void wacom_setup_intuos(struct wacom_wac *wacom_wac) input_set_abs_params(input_dev, ABS_THROTTLE, -1023, 1023, 0, 0); } -void wacom_setup_device_quirks(struct wacom_features *features) +void wacom_setup_device_quirks(struct wacom_features *features, int product_id) { /* touch device found but size is not defined. use default */ @@ -1426,6 +1426,14 @@ void wacom_setup_device_quirks(struct wacom_features *features) features->quirks |= WACOM_QUIRK_BBTOUCH_LOWRES; } + /* physical limits for the finger device of TPC93 */ + if ( product_id == 0x93 && features->device_type == BTN_TOOL_FINGER) { + features->x_min = 160; + features->x_max = 3960; + features->y_min = 160; + features->y_max = 3960; + } + if (features->type == WIRELESS) { /* monitor never has input and pen/touch have delayed create */ @@ -1454,9 +1462,9 @@ int wacom_setup_input_capabilities(struct input_dev *input_dev, __set_bit(BTN_TOUCH, input_dev->keybit); - input_set_abs_params(input_dev, ABS_X, 0, features->x_max, + input_set_abs_params(input_dev, ABS_X, features->x_min, features->x_max, features->x_fuzz, 0); - input_set_abs_params(input_dev, ABS_Y, 0, features->y_max, + input_set_abs_params(input_dev, ABS_Y, features->y_min, features->y_max, features->y_fuzz, 0); if (features->device_type == BTN_TOOL_PEN) { diff --git a/drivers/input/tablet/wacom_wac.h b/drivers/input/tablet/wacom_wac.h index 9396d77..3af5aef 100644 --- a/drivers/input/tablet/wacom_wac.h +++ b/drivers/input/tablet/wacom_wac.h @@ -116,6 +116,8 @@ struct wacom_features { unsigned touch_max; int oVid; int oPid; + int x_min; + int y_min; }; struct wacom_shared { -- 1.7.3.4 |