Skip to contentSkip to conversation

fix appletouch regression bugzilla.kernel.org#10825

PATCH Oliver Neukum 4 participants 5 messages Jun 6, 2008 – Jun 9, 2008 2 messages not in the archive

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

Hi,

this touchpad needs, probably due to a change in timing of suspension, a quirk in 2.6.25 and later. To use this quirk the driver needs to implement reset_resume(). I had written a patch that does that and implements USB autosuspend. The reporter tested it and found it to work.
If you want me to I can't isolate the implementation of reset_resume() from the rest but I can't test it.

Regards
Oliver

---

drivers/usb/core/quirks.c +3 -0
@@ -47,6 +47,9 @@ static const struct usb_device_id usb_qu
 	/* Edirol SD-20 */
 	{ USB_DEVICE(0x0582, 0x0027), .driver_info = USB_QUIRK_RESET_RESUME },
 
+	/* appletouch */
+	{ USB_DEVICE(0x05ac, 0x021a), .driver_info = USB_QUIRK_RESET_RESUME },
+
 	/* Avision AV600U */
 	{ USB_DEVICE(0x0638, 0x0a13), .driver_info =
 	  USB_QUIRK_STRING_FETCH_255 },
drivers/input/mouse/appletouch.c +96 -11

186 lines not on this page · raw message

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): 200806061213.18066.oliver-GvhC2dPhHPQdnm+yROfE0A@public.gmane.org

#2 lore raw

Hi Oliver,

Quoted 9 lines · Oliver Neukum

Hi,

this touchpad needs, probably due to a change in timing of suspension, a quirk in 2.6.25 and later. To use this quirk the driver needs to implement reset_resume(). I had written a patch that does that and implements USB autosuspend. The reporter tested it and found it to work.
If you want me to I can't isolate the implementation of reset_resume() from the rest but I can't test it.

Yes, that'd be great since I'd like the regression fix to show up in .26 while the autosuspend can wait till .27.

Thanks!

Signature · 5 lines
Dmitry
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#3 lore raw

Am Freitag 06 Juni 2008 16:07:08 schrieb Dmitry Torokhov:

Quoted 13 lines

Hi Oliver,

Quoted 9 lines · Oliver Neukum

Hi,

this touchpad needs, probably due to a change in timing of suspension, a quirk in 2.6.25 and later. To use this quirk the driver needs to implement reset_resume(). I had written a patch that does that and implements USB autosuspend. The reporter tested it and found it to work.
If you want me to I can't isolate the implementation of reset_resume() from the rest but I can't test it.

Quoted 2 lines

Yes, that'd be great since I'd like the regression fix to show up in .26 while the autosuspend can wait till .27.

Very well, this is the minimal patch. It needs to be retested and if it works it should go into 2.6.26 and the stable series.

Regards
Oliver

---

drivers/usb/core/quirks.c +3 -0
@@ -47,6 +47,9 @@ static const struct usb_device_id usb_qu
 	/* Edirol SD-20 */
 	{ USB_DEVICE(0x0582, 0x0027), .driver_info = USB_QUIRK_RESET_RESUME },
 
+	/* appletouch */
+	{ USB_DEVICE(0x05ac, 0x021a), .driver_info = USB_QUIRK_RESET_RESUME },
+
 	/* Avision AV600U */
 	{ USB_DEVICE(0x0638, 0x0a13), .driver_info =
 	  USB_QUIRK_STRING_FETCH_255 },
drivers/input/mouse/appletouch.c renamed from drivers/input/mouse/appletouch.c.alt +36 -0
@@ -589,6 +589,20 @@ static void atp_close(struct input_dev *
 	dev->open = 0;
 }
 
+static int handle_geyser(struct atp *dev)
+{
+	struct usb_device *udev = dev->udev;
+
+	if (!atp_is_fountain(dev)) {
+		/* switch to raw sensor mode */
+		if (atp_geyser_init(udev))
+			return -EIO;
+
+		printk(KERN_INFO "appletouch: Geyser mode initialized.\n");
+	}
+	return 0;
+}
+
 static int atp_probe(struct usb_interface *iface, const struct usb_device_id *id)
 {
 	struct atp *dev;
@@ -744,6 +758,20 @@ static void atp_disconnect(struct usb_in
 	printk(KERN_INFO "input: appletouch disconnected\n");
 }
 
+static int recover_dev(struct atp *dev)
+{
+	int rv;
+
+	rv = handle_geyser(dev);
+	if (rv < 0)
+		return rv;
+
+	if (dev->open && usb_submit_urb(dev->urb, GFP_NOIO))
+		return -EIO;
+
+	return 0;	
+}
+
 static int atp_suspend(struct usb_interface *iface, pm_message_t message)
 {
 	struct atp *dev = usb_get_intfdata(iface);
@@ -764,12 +792,20 @@ static int atp_resume(struct usb_interfa
 	return 0;
 }
 
+static int atp_reset_resume(struct usb_interface *iface)
+{
+	struct atp *dev = usb_get_intfdata(iface);
+
+	return recover_dev(dev);
+}
+
 static struct usb_driver atp_driver = {
 	.name		= "appletouch",
 	.probe		= atp_probe,
 	.disconnect	= atp_disconnect,
 	.suspend	= atp_suspend,
 	.resume		= atp_resume,
+	.reset_resume	= atp_reset_resume,
 	.id_table	= atp_table,
 };
 
#4 lore raw
In reply to a message not in the archive
Quoted 19 lines · Oliver Neukum

Hi,

this touchpad needs, probably due to a change in timing of suspension, a quirk in 2.6.25 and later. To use this quirk the driver needs to implement reset_resume(). I had written a patch that does that and implements USB autosuspend. The reporter tested it and found it to work.
If you want me to I can't isolate the implementation of reset_resume() from the rest but I can't test it.

Regards
Oliver

---

drivers/usb/core/quirks.c static const struct usb_device_id usb_qu · line 55

Quoted 9 lines
drivers/usb/core/quirks.c +3 -0
@@ -47,6 +47,9 @@ static const struct usb_device_id usb_qu
 	/* Edirol SD-20 */
 	{ USB_DEVICE(0x0582, 0x0027), .driver_info = USB_QUIRK_RESET_RESUME },
 
+	/* appletouch */
+	{ USB_DEVICE(0x05ac, 0x021a), .driver_info = USB_QUIRK_RESET_RESUME },
+
 	/* Avision AV600U */
 	{ USB_DEVICE(0x0638, 0x0a13), .driver_info =
 	  USB_QUIRK_STRING_FETCH_255 },

So should this portion go into 2.6.26 now, and in .25-stable as well?

Or are the changes to the driver also needed?

thanks,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): [email protected]

#6 lore raw

Am Freitag 06 Juni 2008 20:53:54 schrieb Greg KH:

Quoted 32 lines · Oliver Neukum
Quoted 19 lines

Hi,

this touchpad needs, probably due to a change in timing of suspension, a quirk in 2.6.25 and later. To use this quirk the driver needs to implement reset_resume(). I had written a patch that does that and implements USB autosuspend. The reporter tested it and found it to work.
If you want me to I can't isolate the implementation of reset_resume() from the rest but I can't test it.

Regards
Oliver

---

drivers/usb/core/quirks.c static const struct usb_device_id usb_qu · line 55

Quoted 9 lines
drivers/usb/core/quirks.c +3 -0
@@ -47,6 +47,9 @@ static const struct usb_device_id usb_qu
 	/* Edirol SD-20 */
 	{ USB_DEVICE(0x0582, 0x0027), .driver_info = USB_QUIRK_RESET_RESUME },
 
+	/* appletouch */
+	{ USB_DEVICE(0x05ac, 0x021a), .driver_info = USB_QUIRK_RESET_RESUME },
+
 	/* Avision AV600U */
 	{ USB_DEVICE(0x0638, 0x0a13), .driver_info =
 	  USB_QUIRK_STRING_FETCH_255 },

So should this portion go into 2.6.26 now, and in .25-stable as well?

Quoted 1 line

Or are the changes to the driver also needed?

This part alone is useless.

Regards
Oliver
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html