SRU consideration for LP#218087

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

SRU consideration for LP#218087

Stefan Bader-2
https://bugs.launchpad.net/ubuntu/+bug/218087

SRU justfication:

Impact: Some tablets do not work right out of the box (rather weak)...

Fix: Backport driver from Intrepid/Upstream. Patch is attached. Changes
are not too big but big enough to make the kABI bump. Yuck. Everything
contained within the four driver files. Possibly only makes sense when
other changes would bump the kABI anyways. Additional benefit, the patch
adds some suspend/resume code.

Testcase: Try to use the mentioned Bamboo device. Won't be found in
Hardy but wil be in Intrepid.

diff --git a/drivers/input/tablet/wacom.h b/drivers/input/tablet/wacom.h
index 6542edb..706619d 100644
--- a/drivers/input/tablet/wacom.h
+++ b/drivers/input/tablet/wacom.h
@@ -11,7 +11,7 @@
  *  Copyright (c) 2000 Daniel Egger <[hidden email]>
  *  Copyright (c) 2001 Frederic Lepied <[hidden email]>
  *  Copyright (c) 2004 Panagiotis Issaris <[hidden email]>
- *  Copyright (c) 2002-2007 Ping Cheng <[hidden email]>
+ *  Copyright (c) 2002-2008 Ping Cheng <[hidden email]>
  *
  *  ChangeLog:
  *      v0.1 (vp)  - Initial release
@@ -65,6 +65,7 @@
  *   - and wacom_wac.c deals with Wacom specific code
  *   - Support Intuos3 4x6
  *      v1.47 (pc) - Added support for Bamboo
+ *      v1.48 (pc) - Added support for Bamboo1, BambooFun, and Cintiq 12WX
  */
 
 /*
@@ -85,7 +86,7 @@
 /*
  * Version Information
  */
-#define DRIVER_VERSION "v1.47"
+#define DRIVER_VERSION "v1.48"
 #define DRIVER_AUTHOR "Vojtech Pavlik <[hidden email]>"
 #define DRIVER_DESC "USB Wacom Graphire and Wacom Intuos tablet driver"
 #define DRIVER_LICENSE "GPL"
@@ -100,8 +101,11 @@ struct wacom {
  dma_addr_t data_dma;
  struct input_dev *dev;
  struct usb_device *usbdev;
+ struct usb_interface *intf;
  struct urb *irq;
  struct wacom_wac * wacom_wac;
+ struct mutex lock;
+ int open:1;
  char phys[32];
 };
 
@@ -125,6 +129,7 @@ extern void input_dev_i(struct input_dev *input_dev, struct wacom_wac *wacom_wac
 extern void input_dev_pl(struct input_dev *input_dev, struct wacom_wac *wacom_wac);
 extern void input_dev_pt(struct input_dev *input_dev, struct wacom_wac *wacom_wac);
 extern void input_dev_mo(struct input_dev *input_dev, struct wacom_wac *wacom_wac);
+extern void input_dev_bee(struct input_dev *input_dev, struct wacom_wac *wacom_wac);
 extern __u16 wacom_le16_to_cpu(unsigned char *data);
 extern __u16 wacom_be16_to_cpu(unsigned char *data);
 extern struct wacom_features * get_wacom_feature(const struct usb_device_id *id);
diff --git a/drivers/input/tablet/wacom_sys.c b/drivers/input/tablet/wacom_sys.c
index d64b1ea..71cc0c1 100644
--- a/drivers/input/tablet/wacom_sys.c
+++ b/drivers/input/tablet/wacom_sys.c
@@ -70,6 +70,7 @@ static void wacom_sys_irq(struct urb *urb)
  input_sync(get_input_dev(&wcombo));
 
  exit:
+ usb_mark_last_busy(wacom->usbdev);
  retval = usb_submit_urb (urb, GFP_ATOMIC);
  if (retval)
  err ("%s - usb_submit_urb failed with result %d",
@@ -124,10 +125,25 @@ static int wacom_open(struct input_dev *dev)
 {
  struct wacom *wacom = input_get_drvdata(dev);
 
+ mutex_lock(&wacom->lock);
+
  wacom->irq->dev = wacom->usbdev;
- if (usb_submit_urb(wacom->irq, GFP_KERNEL))
+
+ if (usb_autopm_get_interface(wacom->intf) < 0) {
+ mutex_unlock(&wacom->lock);
+ return -EIO;
+ }
+
+ if (usb_submit_urb(wacom->irq, GFP_KERNEL)) {
+ usb_autopm_put_interface(wacom->intf);
+ mutex_unlock(&wacom->lock);
  return -EIO;
+ }
 
+ wacom->open = 1;
+ wacom->intf->needs_remote_wakeup = 1;
+
+ mutex_unlock(&wacom->lock);
  return 0;
 }
 
@@ -135,7 +151,11 @@ static void wacom_close(struct input_dev *dev)
 {
  struct wacom *wacom = input_get_drvdata(dev);
 
+ mutex_lock(&wacom->lock);
  usb_kill_urb(wacom->irq);
+ wacom->open = 0;
+ wacom->intf->needs_remote_wakeup = 0;
+ mutex_unlock(&wacom->lock);
 }
 
 void input_dev_mo(struct input_dev *input_dev, struct wacom_wac *wacom_wac)
@@ -171,6 +191,7 @@ void input_dev_i3s(struct input_dev *input_dev, struct wacom_wac *wacom_wac)
  input_dev->keybit[BIT_WORD(BTN_LEFT)] |= BIT_MASK(BTN_0) |
  BIT_MASK(BTN_1) | BIT_MASK(BTN_2) | BIT_MASK(BTN_3);
  input_set_abs_params(input_dev, ABS_RX, 0, 4096, 0, 0);
+ input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0);
 }
 
 void input_dev_i3(struct input_dev *input_dev, struct wacom_wac *wacom_wac)
@@ -180,6 +201,11 @@ void input_dev_i3(struct input_dev *input_dev, struct wacom_wac *wacom_wac)
  input_set_abs_params(input_dev, ABS_RY, 0, 4096, 0, 0);
 }
 
+void input_dev_bee(struct input_dev *input_dev, struct wacom_wac *wacom_wac)
+{
+ input_dev->keybit[BIT_WORD(BTN_LEFT)] |= BIT_MASK(BTN_8) | BIT_MASK(BTN_9);
+}
+
 void input_dev_i(struct input_dev *input_dev, struct wacom_wac *wacom_wac)
 {
  input_dev->evbit[0] |= BIT_MASK(EV_MSC) | BIT_MASK(EV_REL);
@@ -237,6 +263,8 @@ static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *i
 
  wacom->usbdev = dev;
  wacom->dev = input_dev;
+ wacom->intf = intf;
+ mutex_init(&wacom->lock);
  usb_make_path(dev, wacom->phys, sizeof(wacom->phys));
  strlcat(wacom->phys, "/input0", sizeof(wacom->phys));
 
@@ -298,23 +326,57 @@ static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *i
 
 static void wacom_disconnect(struct usb_interface *intf)
 {
- struct wacom *wacom = usb_get_intfdata (intf);
+ struct wacom *wacom = usb_get_intfdata(intf);
 
  usb_set_intfdata(intf, NULL);
- if (wacom) {
- usb_kill_urb(wacom->irq);
- input_unregister_device(wacom->dev);
- usb_free_urb(wacom->irq);
- usb_buffer_free(interface_to_usbdev(intf), 10, wacom->wacom_wac->data, wacom->data_dma);
- kfree(wacom->wacom_wac);
- kfree(wacom);
- }
+
+ usb_kill_urb(wacom->irq);
+ input_unregister_device(wacom->dev);
+ usb_free_urb(wacom->irq);
+ usb_buffer_free(interface_to_usbdev(intf), 10, wacom->wacom_wac->data, wacom->data_dma);
+ kfree(wacom->wacom_wac);
+ kfree(wacom);
+}
+
+static int wacom_suspend(struct usb_interface *intf, pm_message_t message)
+{
+ struct wacom *wacom = usb_get_intfdata(intf);
+
+ mutex_lock(&wacom->lock);
+ usb_kill_urb(wacom->irq);
+ mutex_unlock(&wacom->lock);
+
+ return 0;
+}
+
+static int wacom_resume(struct usb_interface *intf)
+{
+ struct wacom *wacom = usb_get_intfdata(intf);
+ int rv;
+
+ mutex_lock(&wacom->lock);
+ if (wacom->open)
+ rv = usb_submit_urb(wacom->irq, GFP_NOIO);
+ else
+ rv = 0;
+ mutex_unlock(&wacom->lock);
+
+ return rv;
+}
+
+static int wacom_reset_resume(struct usb_interface *intf)
+{
+ return wacom_resume(intf);
 }
 
 static struct usb_driver wacom_driver = {
  .name = "wacom",
  .probe = wacom_probe,
  .disconnect = wacom_disconnect,
+ .suspend = wacom_suspend,
+ .resume = wacom_resume,
+ .reset_resume = wacom_reset_resume,
+ .supports_autosuspend = 1,
 };
 
 static int __init wacom_init(void)
diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c
index fc03ba2..192513e 100644
--- a/drivers/input/tablet/wacom_wac.c
+++ b/drivers/input/tablet/wacom_wac.c
@@ -163,7 +163,9 @@ static int wacom_graphire_irq(struct wacom_wac *wacom, void *wcombo)
  }
 
  id = STYLUS_DEVICE_ID;
- if (data[1] & 0x80) { /* in prox */
+ if ((data[1] & 0x80) && ((data[1] & 0x07) || data[2] || data[3] || data[4]
+ || data[5] || data[6] || (data[7] & 0x07))) {
+ /* in prox and not a pad data */
 
  switch ((data[1] >> 5) & 3) {
 
@@ -233,7 +235,6 @@ static int wacom_graphire_irq(struct wacom_wac *wacom, void *wcombo)
  if (data[7] & 0xf8) {
  wacom_input_sync(wcombo); /* sync last event */
  wacom->id[1] = 1;
- wacom->serial[1] = (data[7] & 0xf8);
  wacom_report_key(wcombo, BTN_0, (data[7] & 0x40));
  wacom_report_key(wcombo, BTN_4, (data[7] & 0x80));
  rw = ((data[7] & 0x18) >> 3) - ((data[7] & 0x20) >> 3);
@@ -252,10 +253,9 @@ static int wacom_graphire_irq(struct wacom_wac *wacom, void *wcombo)
  }
  break;
     case WACOM_MO:
- if ((data[7] & 0xf8) || (data[8] & 0x80)) {
+ if ((data[7] & 0xf8) || (data[8] & 0xff)) {
  wacom_input_sync(wcombo); /* sync last event */
  wacom->id[1] = 1;
- wacom->serial[1] = (data[7] & 0xf8);
  wacom_report_key(wcombo, BTN_0, (data[7] & 0x08));
  wacom_report_key(wcombo, BTN_1, (data[7] & 0x20));
  wacom_report_key(wcombo, BTN_4, (data[7] & 0x10));
@@ -434,10 +434,12 @@ static int wacom_intuos_irq(struct wacom_wac *wacom, void *wcombo)
  wacom_report_key(wcombo, BTN_5, (data[6] & 0x02));
  wacom_report_key(wcombo, BTN_6, (data[6] & 0x04));
  wacom_report_key(wcombo, BTN_7, (data[6] & 0x08));
+ wacom_report_key(wcombo, BTN_8, (data[5] & 0x10));
+ wacom_report_key(wcombo, BTN_9, (data[6] & 0x10));
  wacom_report_abs(wcombo, ABS_RX, ((data[1] & 0x1f) << 8) | data[2]);
  wacom_report_abs(wcombo, ABS_RY, ((data[3] & 0x1f) << 8) | data[4]);
 
- if((data[5] & 0x0f) | (data[6] & 0x0f) | (data[1] & 0x1f) |
+ if ((data[5] & 0x1f) | (data[6] & 0x1f) | (data[1] & 0x1f) |
  data[2] | (data[3] & 0x1f) | data[4])
  wacom_report_key(wcombo, wacom->tool[1], 1);
  else
@@ -481,13 +483,11 @@ static int wacom_intuos_irq(struct wacom_wac *wacom, void *wcombo)
  if (data[1] & 0x02) {
  /* Rotation packet */
  if (wacom->features->type >= INTUOS3S) {
- /* I3 marker pen rotation reported as wheel
- * due to valuator limitation
- */
+ /* I3 marker pen rotation */
  t = (data[6] << 3) | ((data[7] >> 5) & 7);
  t = (data[7] & 0x20) ? ((t > 900) ? ((t-1) / 2 - 1350) :
  ((t-1) / 2 + 450)) : (450 - t / 2) ;
- wacom_report_abs(wcombo, ABS_WHEEL, t);
+ wacom_report_abs(wcombo, ABS_Z, t);
  } else {
  /* 4D mouse rotation packet */
  t = (data[6] << 3) | ((data[7] >> 5) & 7);
@@ -558,6 +558,7 @@ int wacom_wac_irq(struct wacom_wac *wacom_wac, void *wcombo)
  case INTUOS3:
  case INTUOS3L:
  case CINTIQ:
+ case WACOM_BEE:
  return (wacom_intuos_irq(wacom_wac, wcombo));
  break;
  default:
@@ -577,6 +578,8 @@ void wacom_init_input_dev(struct input_dev *input_dev, struct wacom_wac *wacom_w
  case GRAPHIRE:
  input_dev_g(input_dev, wacom_wac);
  break;
+ case WACOM_BEE:
+ input_dev_bee(input_dev, wacom_wac);
  case INTUOS3:
  case INTUOS3L:
  case CINTIQ:
@@ -607,12 +610,15 @@ static struct wacom_features wacom_features[] = {
  { "Wacom Graphire3 6x8", 8,  16704, 12064,  511, 63, GRAPHIRE },
  { "Wacom Graphire4 4x5", 8,  10208,  7424,  511, 63, WACOM_G4 },
  { "Wacom Graphire4 6x8", 8,  16704, 12064,  511, 63, WACOM_G4 },
+ { "Wacom BambooFun 4x5", 9,  14760,  9225,  511, 63, WACOM_MO },
+ { "Wacom BambooFun 6x8", 9,  21648, 13530,  511, 63, WACOM_MO },
  { "Wacom Volito",        8,   5104,  3712,  511, 63, GRAPHIRE },
  { "Wacom PenStation2",   8,   3250,  2320,  255, 63, GRAPHIRE },
  { "Wacom Volito2 4x5",   8,   5104,  3712,  511, 63, GRAPHIRE },
  { "Wacom Volito2 2x3",   8,   3248,  2320,  511, 63, GRAPHIRE },
- { "Wacom PenPartner2",   8,   3250,  2320,  255, 63, GRAPHIRE },
+ { "Wacom PenPartner2",   8,   3250,  2320,  511, 63, GRAPHIRE },
  { "Wacom Bamboo",        9,  14760,  9225,  511, 63, WACOM_MO },
+ { "Wacom Bamboo1",       8,   5104,  3712,  511, 63, GRAPHIRE },
  { "Wacom Intuos 4x5",   10,  12700, 10600, 1023, 31, INTUOS },
  { "Wacom Intuos 6x8",   10,  20320, 16240, 1023, 31, INTUOS },
  { "Wacom Intuos 9x12",  10,  30480, 24060, 1023, 31, INTUOS },
@@ -643,6 +649,8 @@ static struct wacom_features wacom_features[] = {
  { "Wacom Intuos3 6x11",  10, 54204, 31750, 1023, 63, INTUOS3 },
  { "Wacom Intuos3 4x6",   10, 31496, 19685, 1023, 63, INTUOS3S },
  { "Wacom Cintiq 21UX",   10, 87200, 65600, 1023, 63, CINTIQ },
+ { "Wacom Cintiq 20WSX",  10, 86680, 54180, 1023, 63, WACOM_BEE },
+ { "Wacom Cintiq 12WX",   10, 53020, 33440, 1023, 63, WACOM_BEE },
  { "Wacom Intuos2 6x8",   10, 20320, 16240, 1023, 31, INTUOS },
  { }
 };
@@ -656,12 +664,15 @@ static struct usb_device_id wacom_ids[] = {
  { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x14) },
  { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x15) },
  { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x16) },
+ { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x17) },
+ { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x18) },
  { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x60) },
  { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x61) },
  { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x62) },
  { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x63) },
  { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x64) },
  { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x65) },
+ { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x69) },
  { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x20) },
  { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x21) },
  { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x22) },
@@ -692,6 +703,8 @@ static struct usb_device_id wacom_ids[] = {
  { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xB5) },
  { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xB7) },
  { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x3F) },
+ { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xC5) },
+ { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xC6) },
  { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x47) },
  { }
 };
diff --git a/drivers/input/tablet/wacom_wac.h b/drivers/input/tablet/wacom_wac.h
index a302e22..3342bc0 100644
--- a/drivers/input/tablet/wacom_wac.h
+++ b/drivers/input/tablet/wacom_wac.h
@@ -25,6 +25,7 @@ enum {
  INTUOS3,
  INTUOS3L,
  CINTIQ,
+ WACOM_BEE,
  WACOM_MO,
  MAX_TYPE
 };

--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

Re: SRU consideration for LP#218087

Tim Gardner-6
Stefan Bader wrote:

> https://bugs.launchpad.net/ubuntu/+bug/218087
>
> SRU justfication:
>
> Impact: Some tablets do not work right out of the box (rather weak)...
>
> Fix: Backport driver from Intrepid/Upstream. Patch is attached. Changes
> are not too big but big enough to make the kABI bump. Yuck. Everything
> contained within the four driver files. Possibly only makes sense when
> other changes would bump the kABI anyways. Additional benefit, the patch
> adds some suspend/resume code.
>
> Testcase: Try to use the mentioned Bamboo device. Won't be found in
> Hardy but wil be in Intrepid.
>

In general this doesn't look too bad, though there might be
possibilities for regressions. Does this patch have any mileage on it?
I'm pretty sure doko has one of these wacom tablets on a Thinkpad,
though I'm not sure its a bamboo device. He could at least test for
regressions.

The ABI bump is fine since there are already a couple of ABI bumpers in
the SRU queue.

rtg
--
Tim Gardner [hidden email]

--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

Re: SRU consideration for LP#218087

Stefan Bader-2
Tim Gardner wrote:

> Stefan Bader wrote:
>> https://bugs.launchpad.net/ubuntu/+bug/218087
>>
>> SRU justfication:
>>
>> Impact: Some tablets do not work right out of the box (rather weak)...
>>
>> Fix: Backport driver from Intrepid/Upstream. Patch is attached. Changes
>> are not too big but big enough to make the kABI bump. Yuck. Everything
>> contained within the four driver files. Possibly only makes sense when
>> other changes would bump the kABI anyways. Additional benefit, the patch
>> adds some suspend/resume code.
>>
>> Testcase: Try to use the mentioned Bamboo device. Won't be found in
>> Hardy but wil be in Intrepid.
>>
>
> In general this doesn't look too bad, though there might be
> possibilities for regressions. Does this patch have any mileage on it?
> I'm pretty sure doko has one of these wacom tablets on a Thinkpad,
> though I'm not sure its a bamboo device. He could at least test for
> regressions.
>
Not much of testing in the report. I asked whether there is more.

Doko: Do you have that HW (or at least anything that uses the wacom driver?)

> The ABI bump is fine since there are already a couple of ABI bumpers in
> the SRU queue.
>
> rtg


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

Re: SRU consideration for LP#218087

Matthias Klose-5
Stefan Bader schrieb:

> Tim Gardner wrote:
>> Stefan Bader wrote:
>>> https://bugs.launchpad.net/ubuntu/+bug/218087
>>>
>>> SRU justfication:
>>>
>>> Impact: Some tablets do not work right out of the box (rather weak)...
>>>
>>> Fix: Backport driver from Intrepid/Upstream. Patch is attached. Changes
>>> are not too big but big enough to make the kABI bump. Yuck. Everything
>>> contained within the four driver files. Possibly only makes sense when
>>> other changes would bump the kABI anyways. Additional benefit, the patch
>>> adds some suspend/resume code.
>>>
>>> Testcase: Try to use the mentioned Bamboo device. Won't be found in
>>> Hardy but wil be in Intrepid.
>>>
>> In general this doesn't look too bad, though there might be
>> possibilities for regressions. Does this patch have any mileage on it?
>> I'm pretty sure doko has one of these wacom tablets on a Thinkpad,
>> though I'm not sure its a bamboo device. He could at least test for
>> regressions.
>>
> Not much of testing in the report. I asked whether there is more.
>
> Doko: Do you have that HW (or at least anything that uses the wacom driver?)

I can test on a X61 Tablet PC, if wanted (to see if this one still works); don't
own other wacom hw.

  Matthias

--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

Re: SRU consideration for LP#218087

Stefan Bader-2
Matthias Klose wrote:

> Stefan Bader schrieb:
>> Tim Gardner wrote:
>>> Stefan Bader wrote:
>>>> https://bugs.launchpad.net/ubuntu/+bug/218087
>>>>
>>>> SRU justfication:
>>>>
>>>> Impact: Some tablets do not work right out of the box (rather weak)...
>>>>
>>>> Fix: Backport driver from Intrepid/Upstream. Patch is attached. Changes
>>>> are not too big but big enough to make the kABI bump. Yuck. Everything
>>>> contained within the four driver files. Possibly only makes sense when
>>>> other changes would bump the kABI anyways. Additional benefit, the patch
>>>> adds some suspend/resume code.
>>>>
>>>> Testcase: Try to use the mentioned Bamboo device. Won't be found in
>>>> Hardy but wil be in Intrepid.
>>>>
>>> In general this doesn't look too bad, though there might be
>>> possibilities for regressions. Does this patch have any mileage on it?
>>> I'm pretty sure doko has one of these wacom tablets on a Thinkpad,
>>> though I'm not sure its a bamboo device. He could at least test for
>>> regressions.
>>>
>> Not much of testing in the report. I asked whether there is more.
>>
>> Doko: Do you have that HW (or at least anything that uses the wacom driver?)
>
> I can test on a X61 Tablet PC, if wanted (to see if this one still works); don't
> own other wacom hw.
>
>   Matthias

There is a replacement kernel (with the new wacom driver and some
printk's for another problem at http://people.ubuntu.com/~smb/bug191137.
If you could test whether this still works, taht would be great. Thanks!

Stefan

--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team