GoboLinux Downloads Documentation Community Recipes Screenshots

GoboLinux Recipe & Package Search Tool

71 versions of Linux.

ProgramAgeSizeByWWWSummary
Linux 4.13.2-r1 806  88794 Luca...
The Linux Kernel.
Linux 4.9.16-r3 977  100651 Luca...
The Linux Kernel.
Linux 4.9.4-r5 1033  99374 Luca...
The Linux Kernel.
Linux 4.8.2-r2 1099  89394 Luca...
The Linux Kernel.
Linux 4.7.4-r1 1169  82767 Luca...
The Linux Kernel.
Linux 4.7.0-r4 1224  82585 Luca...
The Linux Kernel.
Linux 3.13.3-r1 2104  252629 Luca...
The Linux Kernel.
Linux 3.12.6-r1 2164  238949 Luca...
The Linux Kernel.
Linux 3.9.4-r2 2359  70048 Luca...
The Linux Kernel.
Linux 3.7.1-r2 2532  67579 Luca...
The Linux Kernel.
Linux 3.5.0-r1 2683  124391 Luca...
The Linux Kernel.
Linux 3.4.4-r1 2683  124348 Luca...
The Linux Kernel.
Linux 3.3.6-r1 2683  124410 Luca...
The Linux Kernel.
Linux 3.2.12-r2 2811  124345 Luca...
The Linux Kernel.
Linux 3.2.7-r1 2841  123550 Mich...
The Linux Kernel.
Linux 3.1.1-r1 2946  122907 Mich...
The Linux Kernel.
Linux 3.0.4-r4 3007  122754 Luca...
The Linux Kernel.
Linux 2.6.36.3-r1 3230  116087 Diog...
The Linux Kernel.
Linux 2.6.32.3-r1 3608  117990 Luca...
The Linux Kernel.
Linux 2.6.32-r1 3649  117751 Luca...
The Linux Kernel.
Linux 2.6.31.6-r3 3654  126499 Luca...
The Linux Kernel.
Linux 2.6.30.5-r1 3733  166102 Jona...
The Linux Kernel.
Linux 2.6.29.1-r1 3876  117500 Luca...
The Linux Kernel.
Linux 2.6.28.7-r1 3932  115518 Giam...
The Linux Kernel.
Linux 2.6.28.1-r1 3932  115487 Giam...
The Linux Kernel.
Linux 2.6.28-r1 3932  116681 Mich...
The Linux Kernel.
Linux 2.6.27.8-r1 3932  134160 Giam...
The Linux Kernel.
Linux 2.6.27.4-r3 3932  149529 Luca...
The Linux Kernel.
Linux 2.6.25.17-r1 3932  172834 Giam...
The Linux Kernel.
Linux 2.6.25.16-r1 3932  166500 Giam...
The Linux Kernel.
Linux 2.6.25.10-r2 3932  165320 Giam...
The Linux Kernel.
Linux 2.6.25.7-r1 3932  157294 Giam...
The Linux Kernel.
Linux 2.6.25.4-r1 3932  133017 Hopp...
The Linux Kernel.
Linux 2.6.25-r1 3932  133216 Luca...
The Linux Kernel.
Linux 2.6.24.4-r5 3932  150733
The Linux Kernel.
view entry at GitHub | download recipe.bz2 file
01-gobohide.patch
02-unionfs-2.3.2_for_2.6.24.4.patch
03-squashfs-3.3-cvs_20080310.patch
04-squashfs-3.3-cvs_20080310-fix.patch
04-thinkpad-acpi-0.19-20080107_v2.6.24.patch
05-applesmc-case-led.patch
06-applesmc_int.patch
07-applesmc-macbook2.patch
08-applesmc-retry-when-accessing-keys.patch
09-appletouch-add-macbook3-trackpad.patch
10-appletouch.patch
11-appletouch-new.patch
12-sigmatel_audio_display_all_controls_when_subsystem_id_is_wrong.patch
13-sigmatel_audio_fix_macbook_v2.patch
14-appletouch-2.6.24_rc8.patch
15-macbook3rd-2.6.24_rc8.patch
16-usbhid-macbook3_1-quirks.patch
17-applesmc_led_unregister.patch
18-vm_splice_fix.patch
Recipe
Resources/BuildInformation
Resources/Dependencies
Resources/Description
Resources/NewDependencies
i686/Recipe
i686/dot-config
ppc/Recipe
ppc/dot-config
New appletouch driver.

From: Sven Anders <anders@anduras.de>


---

 drivers/input/mouse/appletouch.c |  160 +++++++++++++++++++++++++++++---------
 1 files changed, 121 insertions(+), 39 deletions(-)

diff --git a/drivers/input/mouse/appletouch.c b/drivers/input/mouse/appletouch.c
index dcd9a0d..5a3459c 100644
--- a/drivers/input/mouse/appletouch.c
+++ b/drivers/input/mouse/appletouch.c
@@ -8,6 +8,7 @@
  * Copyright (C) 2005      Peter Osterlund (petero2@telia.com)
  * Copyright (C) 2005      Michael Hanselmann (linux-kernel@hansmi.ch)
  * Copyright (C) 2006      Nicolas Boichat (nicolas@boichat.ch)
+ * Copyright (C) 2007-2008 Sven Anders (anders@anduras.de)
  *
  * Thanks to Alex Harper <basilisk@foobox.net> for his inputs.
  *
@@ -38,16 +39,18 @@
 #define APPLE_VENDOR_ID		0x05AC
 
 /* These names come from Info.plist in AppleUSBTrackpad.kext */
+
+/* PowerBooks Feb 2005 / iBooks */
 #define FOUNTAIN_ANSI_PRODUCT_ID	0x020E
 #define FOUNTAIN_ISO_PRODUCT_ID		0x020F
-
 #define FOUNTAIN_TP_ONLY_PRODUCT_ID	0x030A
 
 #define GEYSER1_TP_ONLY_PRODUCT_ID	0x030B
 
-#define GEYSER_ANSI_PRODUCT_ID		0x0214
-#define GEYSER_ISO_PRODUCT_ID		0x0215
-#define GEYSER_JIS_PRODUCT_ID		0x0216
+/* PowerBooks Oct 2005 */
+#define GEYSER2_ANSI_PRODUCT_ID		0x0214
+#define GEYSER2_ISO_PRODUCT_ID		0x0215
+#define GEYSER2_JIS_PRODUCT_ID		0x0216
 
 /* MacBook devices */
 #define GEYSER3_ANSI_PRODUCT_ID		0x0217
@@ -58,9 +61,14 @@
  * Geyser IV: same as Geyser III according to Info.plist in AppleUSBTrackpad.kext
  * -> same IOClass (AppleUSBGrIIITrackpad), same acceleration tables
  */
-#define GEYSER4_ANSI_PRODUCT_ID	0x021A
-#define GEYSER4_ISO_PRODUCT_ID	0x021B
-#define GEYSER4_JIS_PRODUCT_ID	0x021C
+#define GEYSER4_ANSI_PRODUCT_ID		0x021A
+#define GEYSER4_ISO_PRODUCT_ID		0x021B
+#define GEYSER4_JIS_PRODUCT_ID		0x021C
+
+/* Macbook3,1 devices */
+#define GEYSER4_HF_ANSI_PRODUCT_ID	0x0229
+#define GEYSER4_HF_ISO_PRODUCT_ID	0x022A
+#define GEYSER4_HF_JIS_PRODUCT_ID	0x021B
 
 /* Macbook3,1 devices */
 #define GEYSER4_HF_ANSI_PRODUCT_ID	0x0229
@@ -78,15 +86,17 @@
 
 /* table of devices that work with this driver */
 static struct usb_device_id atp_table [] = {
+
+	/* PowerBooks Feb 2005, iBooks G4 */
 	{ ATP_DEVICE(FOUNTAIN_ANSI_PRODUCT_ID) },
 	{ ATP_DEVICE(FOUNTAIN_ISO_PRODUCT_ID) },
 	{ ATP_DEVICE(FOUNTAIN_TP_ONLY_PRODUCT_ID) },
 	{ ATP_DEVICE(GEYSER1_TP_ONLY_PRODUCT_ID) },
 
 	/* PowerBooks Oct 2005 */
-	{ ATP_DEVICE(GEYSER_ANSI_PRODUCT_ID) },
-	{ ATP_DEVICE(GEYSER_ISO_PRODUCT_ID) },
-	{ ATP_DEVICE(GEYSER_JIS_PRODUCT_ID) },
+	{ ATP_DEVICE(GEYSER2_ANSI_PRODUCT_ID) },
+	{ ATP_DEVICE(GEYSER2_ISO_PRODUCT_ID) },
+	{ ATP_DEVICE(GEYSER2_JIS_PRODUCT_ID) },
 
 	/* Core Duo MacBook & MacBook Pro */
 	{ ATP_DEVICE(GEYSER3_ANSI_PRODUCT_ID) },
@@ -103,6 +113,11 @@ static struct usb_device_id atp_table [] = {
 	{ ATP_DEVICE(GEYSER4_HF_ISO_PRODUCT_ID) },
 	{ ATP_DEVICE(GEYSER4_HF_JIS_PRODUCT_ID) },
 
+	/* Core2 Duo MacBook3,1 */
+	{ ATP_DEVICE(GEYSER4_HF_ANSI_PRODUCT_ID) },
+	{ ATP_DEVICE(GEYSER4_HF_ISO_PRODUCT_ID) },
+	{ ATP_DEVICE(GEYSER4_HF_JIS_PRODUCT_ID) },
+
 	/* Terminating entry */
 	{ }
 };
@@ -146,12 +161,21 @@ MODULE_DEVICE_TABLE (usb, atp_table);
 #define ATP_GEYSER_MODE_REQUEST_INDEX		0
 #define ATP_GEYSER_MODE_VENDOR_VALUE		0x04
 
+/*
+ * Meaning of the status bits (only Geyser 3/4?)
+ */
+#define ATP_STATUS_BIT_BUTTON		0x01	/* The button was pressed */
+#define ATP_STATUS_BIT_UNKNOWN1		0x02	/* Unknown or unused */
+#define ATP_STATUS_BIT_BASE_UPDATE	0x04	/* Update of the base values (untouched \
pad) */
+#define ATP_STATUS_BIT_UNKNOWN2		0x08	/* Unknown or unused */
+#define ATP_STATUS_BIT_FROM_RESET	0x10	/* Reset previously performed */
+
 /* Structure to hold all of our device specific stuff */
 struct atp {
 	char			phys[64];
 	struct usb_device *	udev;		/* usb device */
 	struct urb *		urb;		/* usb request block */
-	signed char *		data;		/* transferred data */
+	u8 *			data;		/* transferred data */
 	struct input_dev *	input;		/* input dev */
 	unsigned char		open;		/* non-zero if opened */
 	unsigned char		valid;		/* are the sensors valid ? */
@@ -166,8 +190,8 @@ struct atp {
 						/* accumulated sensors */
 	int			xy_acc[ATP_XSENSORS + ATP_YSENSORS];
 	int			datalen;	/* size of an USB urb transfer */
-	int			idlecount;      /* number of empty packets */
-	struct work_struct      work;
+	int			idle_counter;	/* number of empty packets */
+	struct work_struct      work;		/* kernel workqueue entry (for re-init) */
 };
 
 #define dbg_dump(msg, tab) \
@@ -184,8 +208,12 @@ struct atp {
 		if (debug) printk(KERN_DEBUG format, ##a);		\
 	} while (0)
 
-MODULE_AUTHOR("Johannes Berg, Stelian Pop, Frank Arnold, Michael Hanselmann");
-MODULE_DESCRIPTION("Apple PowerBooks USB touchpad driver");
+MODULE_AUTHOR("Johannes Berg");
+MODULE_AUTHOR("Stelian Pop");
+MODULE_AUTHOR("Frank Arnold");
+MODULE_AUTHOR("Michael Hanselmann");
+MODULE_AUTHOR("Sven Anders");
+MODULE_DESCRIPTION("Apple PowerBook and MacBook USB touchpad driver");
 MODULE_LICENSE("GPL");
 
 /*
@@ -195,7 +223,7 @@ static int threshold = ATP_THRESHOLD;
 module_param(threshold, int, 0644);
 MODULE_PARM_DESC(threshold, "Discards any change in data from a sensor (trackpad \
has hundreds of these sensors) less than this value");
 
-static int debug = 1;
+static int debug;
 module_param(debug, int, 0644);
 MODULE_PARM_DESC(debug, "Activate debugging output");
 
@@ -213,12 +241,12 @@ static inline int atp_is_geyser_2(struct atp *dev)
 {
 	u16 productId = le16_to_cpu(dev->udev->descriptor.idProduct);
 
-	return (productId == GEYSER_ANSI_PRODUCT_ID) ||
-		(productId == GEYSER_ISO_PRODUCT_ID) ||
-		(productId == GEYSER_JIS_PRODUCT_ID);
+	return (productId == GEYSER2_ANSI_PRODUCT_ID) ||
+		(productId == GEYSER2_ISO_PRODUCT_ID) ||
+		(productId == GEYSER2_JIS_PRODUCT_ID);
 }
 
-static inline int atp_is_geyser_3(struct atp *dev)
+static inline int atp_is_geyser_3_4(struct atp *dev)
 {
 	u16 productId = le16_to_cpu(dev->udev->descriptor.idProduct);
 
@@ -242,7 +270,7 @@ static int atp_geyser_init(struct usb_device *udev)
 {
 	char data[8];
 	int size;
-
+ 
 	size = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0),
 			ATP_GEYSER_MODE_READ_REQUEST_ID,
 			USB_DIR_IN | USB_TYPE_CLASS | USB_RECIP_INTERFACE,
@@ -250,6 +278,13 @@ static int atp_geyser_init(struct usb_device *udev)
 			ATP_GEYSER_MODE_REQUEST_INDEX, &data, 8, 5000);
 
 	if (size != 8) {
+		if (debug)
+		{
+			int i;
+			printk("appletouch atp_geyser_init READ error\n");
+			for (i=0; i<8; i++)
+				printk("appletouch[%d]: %d\n", i, (int) data[i]);
+		}
 		err("Could not do mode read request from device"
 		    " (Geyser Raw mode)");
 		return -EIO;
@@ -265,6 +300,13 @@ static int atp_geyser_init(struct usb_device *udev)
 			ATP_GEYSER_MODE_REQUEST_INDEX, &data, 8, 5000);
 
 	if (size != 8) {
+		if (debug)
+		{
+			int i;
+			printk("appletouch atp_geyser_init WRITE error\n");
+			for (i=0; i<8; i++)
+				printk("appletouch[%d]: %d\n", i, (int) data[i]);
+		}
 		err("Could not do mode write request to device"
 		    " (Geyser Raw mode)");
 		return -EIO;
@@ -282,8 +324,7 @@ static void atp_reinit(struct work_struct *work)
 	struct usb_device *udev = dev->udev;
 	int retval;
 
-	dev->idlecount = 0;
-
+	dprintk("appletouch: putting appletouch to sleep (reinit)\n");
 	atp_geyser_init(udev);
 
 	retval = usb_submit_urb(dev->urb, GFP_ATOMIC);
@@ -398,7 +439,7 @@ static void atp_complete(struct urb* urb)
 	}
 
 	/* reorder the sensors values */
-	if (atp_is_geyser_3(dev)) {
+	if (atp_is_geyser_3_4(dev)) {
 		memset(dev->xy_cur, 0, sizeof(dev->xy_cur));
 
 		/*
@@ -455,13 +496,20 @@ static void atp_complete(struct urb* urb)
 	dbg_dump("sample", dev->xy_cur);
 
 	if (!dev->valid) {
-		/* first sample */
+		/* first sample after init or resume */
 		dev->valid = 1;
 		dev->x_old = dev->y_old = -1;
 		memcpy(dev->xy_old, dev->xy_cur, sizeof(dev->xy_old));
+		dev->idle_counter = 0;
+
+		/* store first sample on older Geyser */
+		if ((dev->data[dev->datalen-1] & ATP_STATUS_BIT_BASE_UPDATE) ||
+		    !atp_is_geyser_3_4(dev))
+			memcpy(dev->xy_old, dev->xy_cur, sizeof(dev->xy_old));
+
 
 		if (dev->size_detect_done ||
-		    atp_is_geyser_3(dev)) /* No 17" Macbooks (yet) */
+		    atp_is_geyser_3_4(dev)) /* No 17" Macbooks (yet) */
 			goto exit;
 
 		/* 17" Powerbooks have extra X sensors */
@@ -487,26 +535,47 @@ static void atp_complete(struct urb* urb)
 		goto exit;
 	}
 
+	/* Just update the base values (i.e. touchpad in untouched state) */
+	if (dev->data[dev->datalen-1] & ATP_STATUS_BIT_BASE_UPDATE)
+	{
+		if (debug > 0) printk("appletouch: updated base values\n");
+
+		memcpy(dev->xy_old, dev->xy_cur, sizeof(dev->xy_old));
+		goto exit;
+	}
+
 	for (i = 0; i < ATP_XSENSORS + ATP_YSENSORS; i++) {
-		/* accumulate the change */
-		signed char change = dev->xy_old[i] - dev->xy_cur[i];
-		dev->xy_acc[i] -= change;
+		/* calculate the change */
+		dev->xy_acc[i] = dev->xy_cur[i] - dev->xy_old[i];
+
+		/* this is a round-robin value, so couple with that */
+		if (dev->xy_acc[i] > 127)
+			dev->xy_acc[i] -= 256;
+
+		if (dev->xy_acc[i] < -127)
+			dev->xy_acc[i] += 256;
+
+		/* Needed for the older Geyser */
+		if (!atp_is_geyser_3_4(dev))
+		{
+			/* store new 'untouched' value, if any new */
+			if (dev->xy_acc[i] < -1)
+				dev->xy_old[i] = dev->xy_cur[i];
+		}
 
 		/* prevent down drifting */
 		if (dev->xy_acc[i] < 0)
 			dev->xy_acc[i] = 0;
 	}
 
-	memcpy(dev->xy_old, dev->xy_cur, sizeof(dev->xy_old));
-
 	dbg_dump("accumulator", dev->xy_acc);
 
 	x = atp_calculate_abs(dev->xy_acc, ATP_XSENSORS,
 			      ATP_XFACT, &x_z, &x_f);
 	y = atp_calculate_abs(dev->xy_acc + ATP_XSENSORS, ATP_YSENSORS,
 			      ATP_YFACT, &y_z, &y_f);
-	key = dev->data[dev->datalen - 1] & 1;
-
+	key = dev->data[dev->datalen - 1] & ATP_STATUS_BIT_BUTTON;
+ 
 	if (x && y) {
 		if (dev->x_old != -1) {
 			x = (dev->x_old * 3 + x) >> 2;
@@ -551,16 +620,28 @@ static void atp_complete(struct urb* urb)
 	 * work on Fountain touchpads.
 	 */
 	if (!atp_is_fountain(dev)) {
+
+		/* Button must not be pressed when entering suspend,
+		   otherwise we will never release the button. */
 		if (!x && !y && !key) {
-			dev->idlecount++;
-			if (dev->idlecount == 10) {
-				dev->valid = 0;
+
+			/* Idle counter */
+			dev->idle_counter++;
+
+			/* Wait for 10 more packages before suspending */
+			if (dev->idle_counter > 10) {
+
+				/* Reset counter */
+				dev->idle_counter = 0;
+
+				/* Prepare for device reset */
 				schedule_work(&dev->work);
+
 				/* Don't resubmit urb here, wait for reinit */
 				return;
 			}
 		} else
-			dev->idlecount = 0;
+			dev->idle_counter = 0;
 	}
 
 exit:
@@ -628,7 +709,7 @@ static int atp_probe(struct usb_interface *iface, const struct \
usb_device_id *id
 	dev->udev = udev;
 	dev->input = input_dev;
 	dev->overflowwarn = 0;
-	if (atp_is_geyser_3(dev))
+	if (atp_is_geyser_3_4(dev))
 		dev->datalen = 64;
 	else if (atp_is_geyser_2(dev))
 		dev->datalen = 64;
@@ -671,7 +752,7 @@ static int atp_probe(struct usb_interface *iface, const struct \
usb_device_id *id
 
 	set_bit(EV_ABS, input_dev->evbit);
 
-	if (atp_is_geyser_3(dev)) {
+	if (atp_is_geyser_3_4(dev)) {
 		/*
 		 * MacBook have 20 X sensors, 10 Y sensors
 		 */
@@ -714,6 +795,7 @@ static int atp_probe(struct usb_interface *iface, const struct \
usb_device_id *id
 	/* save our data pointer in this interface device */
 	usb_set_intfdata(iface, dev);
 
+	/* initialize kernel work queue for re-init out of interrupt context */
 	INIT_WORK(&dev->work, atp_reinit);
 
 	return 0;
Linux 2.6.24.3-r5 3932  150221 Luca...
The Linux Kernel.
Linux 2.6.24.2-r3 3932  146488 Giam...
The Linux Kernel.
Linux 2.6.24.1-r1 3932  146454 Giam...
The Linux Kernel.
Linux 2.6.24-r1 3932  146428 Luca...
The Linux Kernel.
Linux 2.6.23.8-r4 3932  155842 Luca...
The Linux Kernel.
Linux 2.6.22.7-r4 3932  114727 Luca...
The Linux Kernel.
Linux 2.6.22.1-r1 3932  121391 Luca...
The Linux Kernel.
Linux 2.6.21.1-r3 3932  118854 Luca...
The Linux Kernel.
Linux 2.6.20.7-r1 3932  117945 Luca...
The Linux Kernel.
Linux 2.6.20.4-r3 3932  151150 Luca...
The Linux Kernel.
Linux 2.6.20-r1 3932  106429 Luca...
The Linux Kernel.
Linux 2.6.18.3-r2 3932  111124 Luca...
The Linux Kernel.
Linux 2.6.17.11-r1 3932  164053 Luca...
The Linux Kernel.
Linux 2.6.17.3-r1 3932  165067 Luca...
The Linux Kernel.
Linux 2.6.16.20-r1 3932  133625 Luca...
The Linux Kernel.
Linux 2.6.16.14-r1 3932  168270 Luca...
The Linux Kernel.
Linux 2.6.15.5-r1 3932  224686 Jona...
The Linux Kernel.
Linux 2.6.15.2-r1 3932  177165 Carl...
The Linux Kernel.
Linux 2.6.15.1-r1 3932  149219 Jona...
The Linux Kernel.
Linux 2.6.15-r1 3932  149214 Luca...
The Linux Kernel.
Linux 2.6.14.4-r1 3932  150166 Jona...
The Linux Kernel.
Linux 2.6.14.3-r1 3932  150060 Jona...
The Linux Kernel.
Linux 2.6.14.2-r1 3932  149791 Carl...
The Linux Kernel.
Linux 2.6.13.4-r1 3932  149559 Luca...
The Linux Kernel.
Linux 2.6.13.2-r1 3932  56611 Jona...
The Linux Kernel.
Linux 2.6.13.1-r1 3932  56378 Luca...
The Linux Kernel.
Linux 2.6.12.2-r1 3932  50355 Luca...
The Linux Kernel.
Linux 2.6.11.9-r1 3932  98969 Luca...
The Linux Kernel.
Linux 2.6.11.8-r1 3932  109424 Jona...
The Linux Kernel.
Linux 2.6.11-r1 3932  99032 Luca...
The Linux Kernel.
Linux 2.6.10-r1 3932  65969 Luca...
The Linux Kernel.
Linux 2.6.9-r1 3932  278461 Luca...
The Linux Kernel.
Linux 2.6.8.1-r1 3932  35576 Luca...
The Linux Kernel.
Linux 2.6.7-r1 3932  22610 Luca...
The Linux Kernel.
Linux 2.6.6-r1 3932  21958 Luca...
The Linux Kernel.
Linux 2.4.26-r1 3932  22359 Luca...
The Linux Kernel.