summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpingc <pingc>2007-01-15 21:46:24 +0000
committerpingc <pingc>2007-01-15 21:46:24 +0000
commitff4595036b04cda5fc1d5ff3986b28db15e73a82 (patch)
tree3837c5abb9597a106135ec9c22e2b844ef0e7766
parent8d5b18e87378245b377a39dd6d81e4e8db54c4e2 (diff)
downloadxf86-input-wacom-ff4595036b04cda5fc1d5ff3986b28db15e73a82.tar.gz
Fixed bugs in wacom_sys.c and multiarea supportdev-0_7_7-3dev-0.7.7-3
-rw-r--r--ChangeLog5
-rwxr-xr-xsrc/2.6.11/wacom_sys.c46
-rwxr-xr-xsrc/2.6.13/wacom_sys.c34
-rwxr-xr-xsrc/xdrv/wcmConfig.c11
-rwxr-xr-xsrc/xdrv/xf86Wacom.c7
5 files changed, 57 insertions, 46 deletions
diff --git a/ChangeLog b/ChangeLog
index 8cc70a2..2b45adc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2007-01-15 Ping Cheng <pingc@wacom.com>
+ * Split wacom.c for 2.6.14
+ * Fixed wacom_sys.c in 2.6.11 and 2.6.13
+ * Fixed bugs related to multiarea support
+
2007-01-11 Ping Cheng <pingc@wacom.com>
* Incorporated patches 1630928, 1630926, and 1614296
* Updated xidump to ignore uninitialized tools
diff --git a/src/2.6.11/wacom_sys.c b/src/2.6.11/wacom_sys.c
index cf8f089..6a14d59 100755
--- a/src/2.6.11/wacom_sys.c
+++ b/src/2.6.11/wacom_sys.c
@@ -213,7 +213,6 @@ static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *i
struct usb_endpoint_descriptor *endpoint;
struct wacom *wacom;
struct wacom_wac *wacom_wac;
- struct input_dev input_dev;
char rep_data[2], limit = 0;
char path[64];
@@ -221,13 +220,16 @@ static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *i
return -ENOMEM;
memset(wacom, 0, sizeof(struct wacom));
- if (!(wacom_wac = kmalloc(sizeof(struct wacom_wac), GFP_KERNEL)))
+ if (!(wacom_wac = kmalloc(sizeof(struct wacom_wac), GFP_KERNEL))) {
+ kfree(wacom);
return -ENOMEM;
+ }
memset(wacom_wac, 0, sizeof(struct wacom_wac));
wacom_wac->data = usb_buffer_alloc(dev, 10, GFP_KERNEL, &wacom->data_dma);
if (!wacom_wac->data) {
kfree(wacom);
+ kfree(wacom_wac);
return -ENOMEM;
}
@@ -235,37 +237,37 @@ static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *i
if (!wacom->irq) {
usb_buffer_free(dev, 10, wacom_wac->data, wacom->data_dma);
kfree(wacom);
+ kfree(wacom_wac);
return -ENOMEM;
}
wacom->usbdev = dev;
- wacom->dev = input_dev;
usb_make_path(dev, path, 64);
sprintf(wacom->phys, "%s/input0", path);
wacom_wac->features = get_wacom_feature(id);
BUG_ON(wacom_wac->features->pktlen > 10);
- input_dev.name = wacom_wac->features->name;
+ wacom->dev.name = wacom_wac->features->name;
wacom->wacom_wac = wacom_wac;
- input_dev.phys = wacom->phys;
- input_dev.id.bustype = BUS_USB;
- input_dev.id.vendor = le16_to_cpu(dev->descriptor.idVendor);
- input_dev.id.product = le16_to_cpu(dev->descriptor.idProduct);
- input_dev.id.version = le16_to_cpu(dev->descriptor.bcdDevice);
- input_dev.dev = &intf->dev;
- input_dev.private = wacom;
- input_dev.open = wacom_open;
- input_dev.close = wacom_close;
-
- input_dev.evbit[0] |= BIT(EV_KEY) | BIT(EV_ABS);
- input_dev.keybit[LONG(BTN_DIGI)] |= BIT(BTN_TOOL_PEN) | BIT(BTN_TOUCH) | BIT(BTN_STYLUS);
- input_set_abs_params(&input_dev, ABS_X, 0, wacom_wac->features->x_max, 4, 0);
- input_set_abs_params(&input_dev, ABS_Y, 0, wacom_wac->features->y_max, 4, 0);
- input_set_abs_params(&input_dev, ABS_PRESSURE, 0, wacom_wac->features->pressure_max, 0, 0);
- input_dev.absbit[LONG(ABS_MISC)] |= BIT(ABS_MISC);
-
- wacom_init_input_dev(&input_dev, wacom_wac);
+ wacom->dev.phys = wacom->phys;
+ wacom->dev.id.bustype = BUS_USB;
+ wacom->dev.id.vendor = le16_to_cpu(dev->descriptor.idVendor);
+ wacom->dev.id.product = le16_to_cpu(dev->descriptor.idProduct);
+ wacom->dev.id.version = le16_to_cpu(dev->descriptor.bcdDevice);
+ wacom->dev.dev = &intf->dev;
+ wacom->dev.private = wacom;
+ wacom->dev.open = wacom_open;
+ wacom->dev.close = wacom_close;
+
+ wacom->dev.evbit[0] |= BIT(EV_KEY) | BIT(EV_ABS);
+ wacom->dev.keybit[LONG(BTN_DIGI)] |= BIT(BTN_TOOL_PEN) | BIT(BTN_TOUCH) | BIT(BTN_STYLUS);
+ input_set_abs_params(&wacom->dev, ABS_X, 0, wacom_wac->features->x_max, 4, 0);
+ input_set_abs_params(&wacom->dev, ABS_Y, 0, wacom_wac->features->y_max, 4, 0);
+ input_set_abs_params(&wacom->dev, ABS_PRESSURE, 0, wacom_wac->features->pressure_max, 0, 0);
+ wacom->dev.absbit[LONG(ABS_MISC)] |= BIT(ABS_MISC);
+
+ wacom_init_input_dev(&wacom->dev, wacom_wac);
endpoint = &intf->cur_altsetting->endpoint[0].desc;
diff --git a/src/2.6.13/wacom_sys.c b/src/2.6.13/wacom_sys.c
index eab83fb..6583b22 100755
--- a/src/2.6.13/wacom_sys.c
+++ b/src/2.6.13/wacom_sys.c
@@ -213,7 +213,6 @@ static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *i
struct usb_endpoint_descriptor *endpoint;
struct wacom *wacom;
struct wacom_wac *wacom_wac;
- struct input_dev input_dev;
char rep_data[2], limit = 0;
char path[64];
@@ -243,30 +242,29 @@ static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *i
}
wacom->usbdev = dev;
- wacom->dev = input_dev;
usb_make_path(dev, path, 64);
sprintf(wacom->phys, "%s/input0", path);
wacom_wac->features = get_wacom_feature(id);
BUG_ON(wacom_wac->features->pktlen > 10);
- input_dev.name = wacom_wac->features->name;
+ wacom->dev.name = wacom_wac->features->name;
wacom->wacom_wac = wacom_wac;
- input_dev.phys = wacom->phys;
- usb_to_input_id(dev, &input_dev.id);
- input_dev.dev = &intf->dev;
- input_dev.private = wacom;
- input_dev.open = wacom_open;
- input_dev.close = wacom_close;
-
- input_dev.evbit[0] |= BIT(EV_KEY) | BIT(EV_ABS);
- input_dev.keybit[LONG(BTN_DIGI)] |= BIT(BTN_TOOL_PEN) | BIT(BTN_TOUCH) | BIT(BTN_STYLUS);
- input_set_abs_params(&input_dev, ABS_X, 0, wacom_wac->features->x_max, 4, 0);
- input_set_abs_params(&input_dev, ABS_Y, 0, wacom_wac->features->y_max, 4, 0);
- input_set_abs_params(&input_dev, ABS_PRESSURE, 0, wacom_wac->features->pressure_max, 0, 0);
- input_dev.absbit[LONG(ABS_MISC)] |= BIT(ABS_MISC);
-
- wacom_init_input_dev(&input_dev, wacom_wac);
+ wacom->dev.phys = wacom->phys;
+ usb_to_input_id(dev, &wacom->dev.id);
+ wacom->dev.dev = &intf->dev;
+ wacom->dev.private = wacom;
+ wacom->dev.open = wacom_open;
+ wacom->dev.close = wacom_close;
+
+ wacom->dev.evbit[0] |= BIT(EV_KEY) | BIT(EV_ABS);
+ wacom->dev.keybit[LONG(BTN_DIGI)] |= BIT(BTN_TOOL_PEN) | BIT(BTN_TOUCH) | BIT(BTN_STYLUS);
+ input_set_abs_params(&wacom->dev, ABS_X, 0, wacom_wac->features->x_max, 4, 0);
+ input_set_abs_params(&wacom->dev, ABS_Y, 0, wacom_wac->features->y_max, 4, 0);
+ input_set_abs_params(&wacom->dev, ABS_PRESSURE, 0, wacom_wac->features->pressure_max, 0, 0);
+ wacom->dev.absbit[LONG(ABS_MISC)] |= BIT(ABS_MISC);
+
+ wacom_init_input_dev(&wacom->dev, wacom_wac);
endpoint = &intf->cur_altsetting->endpoint[0].desc;
diff --git a/src/xdrv/wcmConfig.c b/src/xdrv/wcmConfig.c
index f612424..d42d6ac 100755
--- a/src/xdrv/wcmConfig.c
+++ b/src/xdrv/wcmConfig.c
@@ -277,6 +277,11 @@ static Bool xf86WcmAreasOverlap(WacomToolAreaPtr area1, WacomToolAreaPtr area2)
xf86WcmPointInArea(area1, area2->bottomX, area2->topY) ||
xf86WcmPointInArea(area1, area2->bottomX, area2->bottomY))
return 1;
+ if (xf86WcmPointInArea(area2, area1->topX, area1->topY) ||
+ xf86WcmPointInArea(area2, area1->topX, area1->bottomY) ||
+ xf86WcmPointInArea(area2, area1->bottomX, area1->topY) ||
+ xf86WcmPointInArea(area2, area1->bottomX, area1->bottomY))
+ return 1;
return 0;
}
@@ -284,8 +289,10 @@ static Bool xf86WcmAreasOverlap(WacomToolAreaPtr area1, WacomToolAreaPtr area2)
Bool xf86WcmAreaListOverlap(WacomToolAreaPtr area, WacomToolAreaPtr list)
{
- for (; list; list = list->next)
- if (area != list && xf86WcmAreasOverlap(list, area))
+ WacomToolAreaPtr localList;
+
+ for (localList = list; localList; localList = localList->next)
+ if (area != localList && xf86WcmAreasOverlap(localList, area))
return 1;
return 0;
}
diff --git a/src/xdrv/xf86Wacom.c b/src/xdrv/xf86Wacom.c
index fa437c8..f9272f4 100755
--- a/src/xdrv/xf86Wacom.c
+++ b/src/xdrv/xf86Wacom.c
@@ -213,7 +213,7 @@ static int xf86WcmInitArea(LocalDevicePtr local)
}
} /* end keep shape */
- if (xf86WcmAreaListOverlap(area, priv->tool->arealist))
+ if ((area != priv->tool->arealist) && xf86WcmAreaListOverlap(area, priv->tool->arealist))
{
int i, j;
/* remove this area from the list */
@@ -247,7 +247,7 @@ static int xf86WcmInitArea(LocalDevicePtr local)
priv->topY, priv->bottomX, priv->bottomY);
return TRUE;
}
-
+ return TRUE;
}
/*****************************************************************************
@@ -629,7 +629,6 @@ static int xf86WcmDevProc(DeviceIntPtr pWcm, int what)
if (!xf86WcmDevOpen(pWcm))
{
DBG(1, ErrorF("xf86WcmProc INIT FAILED\n"));
- DisableDevice(pWcm);
priv->common = NULL;
return !Success;
}
@@ -640,7 +639,7 @@ static int xf86WcmDevProc(DeviceIntPtr pWcm, int what)
if (!xf86WcmDevOpen(pWcm))
{
DBG(1, ErrorF("xf86WcmProc ON FAILED\n"));
- DisableDevice(pWcm);
+ priv->common = NULL;
return !Success;
}
priv->wcmDevOpenCount++;