diff options
author | Jeffrey Gardner <je_fro@gentoo.org> | 2008-04-10 16:55:11 +0000 |
---|---|---|
committer | Jeffrey Gardner <je_fro@gentoo.org> | 2008-04-10 16:55:11 +0000 |
commit | 8bbab3f8b4ad7c7c80a756d43ff0b6d5299785b5 (patch) | |
tree | 15a597212d1304a3ebcbb7520dff62c849830509 | |
parent | latest svn (diff) | |
download | je_fro-8bbab3f8b4ad7c7c80a756d43ff0b6d5299785b5.tar.gz je_fro-8bbab3f8b4ad7c7c80a756d43ff0b6d5299785b5.tar.bz2 je_fro-8bbab3f8b4ad7c7c80a756d43ff0b6d5299785b5.zip |
latest svn patchset
svn path=/; revision=200
20 files changed, 935 insertions, 1070 deletions
diff --git a/sys-kernel/mactel-linux-sources/Manifest b/sys-kernel/mactel-linux-sources/Manifest index 860029f..5a79f72 100644 --- a/sys-kernel/mactel-linux-sources/Manifest +++ b/sys-kernel/mactel-linux-sources/Manifest @@ -36,6 +36,20 @@ AUX 2.6.24-mactel-patches-r153/export-lookup_dev.patch 423 RMD160 b0362beae6dfac AUX 2.6.24-mactel-patches-r153/hid-add-new-apple-keyboard.patch 8440 RMD160 78b893ab1e6d7d8a2b217c01a0f2b15a9fd6863f SHA1 e662407bb1a610d93569fd82a4a8e8c9c61d07dd SHA256 9691663c497723c200543ea2869f180f0b77997e2374aa7ddfa78990eb68910c AUX 2.6.24-mactel-patches-r153/sigmatel_audio_display_all_controls_when_subsystem_id_is_wrong.patch 820 RMD160 94de76a57d94cfedf6261cc849e9316c100d3f0f SHA1 250486062646728b0d8fb4aad4cfa7bcd861238a SHA256 af3f2cc085444027d712ed1a1e078608f8141f4253292d0043e5b992d11396c6 AUX 2.6.24-mactel-patches-r153/sigmatel_audio_fix_macbook_v2.patch 856 RMD160 8d343c8b0f4eec70a449e2bda987edeb9fafbd6f SHA1 eda6c5f026936addff8ad090df24d2c5658ca5fe SHA256 9bd96288b95d94111b19c1d055d98088d414bbfed5d38c2bbf82a1563ec1fb5a +AUX 2.6.24-mactel-patches-r155/applesmc-int-protect.patch 8678 RMD160 560e38277bfb9f917744771406f6eaed4dbad6ed SHA1 d13f3d2b4c6ae5e835305ef16f19b387ab3297c7 SHA256 a760fe387d8af9bc07262905c6562a933d9da4cce6b64207d270f83b2dd5b74d +AUX 2.6.24-mactel-patches-r155/applesmc-macbook2.patch 3088 RMD160 447b80e268c997780a2b48d518e5a5c1956fb119 SHA1 df37a98f40ab1d118274e2f240b1878d8af25d0c SHA256 84a025192e47dcfbfcc39a4b638434df8e034057bded9eb31a9be3cf81c93374 +AUX 2.6.24-mactel-patches-r155/applesmc-remove-debugging-messages.patch 2347 RMD160 359b19b4b6b0af6d628f8aefbba91c3c3fc85a74 SHA1 0d6f56fa6fe0f8286aa7e2e3aee65dc7d440d17b SHA256 cad9a2861e1108fa3826f3a5877a31ebe25bfbf0bd7504afbbc57653e0d28778 +AUX 2.6.24-mactel-patches-r155/applesmc-retry-when-accessing-keys.patch 3005 RMD160 7edff70b59f6bb1e27e9594d5ac3789207a2d203 SHA1 103d650a667b86b454ecbfd8ffacaf3894f21236 SHA256 5d6395ceba951ebd6d75e7d5f97f1dae8a4971dd2d4a3abae59f96a53c663c44 +AUX 2.6.24-mactel-patches-r155/applesmc_int.patch 11496 RMD160 20b19d6d5f5cd93f0138e5dc40192c6e1e2dd971 SHA1 f0c0484f7d85a18bd9c3d8fae611aafe2f0b7909 SHA256 fc601217e23a267cf4f08815a53b1bda803a82b87576260cc0ef1885ba2a9b00 +AUX 2.6.24-mactel-patches-r155/appletouch-new.patch 11927 RMD160 ada04ab11c9602b8d9e5e9f8a0fce5769200dde6 SHA1 6582d125c5edce8b32db396ddd28884d434279ff SHA256 585dc12ec28f3b4dfa377deccae1ac8b8d5a37190dd6cfdfdc0d302215bde8a6 +AUX 2.6.24-mactel-patches-r155/appletouch.patch 654 RMD160 71fe6e4b886063601fa71dde4401d0003c17b5ba SHA1 fd599a2b5ff9dea91ff4b8eff956bebededf9abd SHA256 5143872df96fa8e79a0602af15ef9bc9cd880bd88e39c1d3a0bbc4659516d4c8 +AUX 2.6.24-mactel-patches-r155/disk-protect-fix-2.6.24-crash.patch 1690 RMD160 cfc272937096214b6a90b90a8fec45946d727f6b SHA1 a53e30d013e910e4089cb62eb0a8eb5075bde2bd SHA256 21f319713860d982dea4ee8293be72354605c91cd112fd40b0370ffe1a89b641 +AUX 2.6.24-mactel-patches-r155/disk-protect-update.patch 1130 RMD160 ea48d721ef45a80a8a341a0e62e47483e19f8441 SHA1 4428a17a9ed5ff3c09b48e563ee8e6dd9d64f614 SHA256 02b91671fc86186b7547a0468b3dbd4804959d076807140c271433b96a11aa6a +AUX 2.6.24-mactel-patches-r155/disk-protect.patch 24637 RMD160 7e43c5ca0ed7a01c01a397faa54174e5bf4cf8e7 SHA1 150dfe2897262da5404d122be858b1281a1d54c0 SHA256 ad5f2d8f3c0acbffaaf2fadbe26ec2fa0bb5ca6c8c90eeb97d0c9576368e0078 +AUX 2.6.24-mactel-patches-r155/export-lookup_dev.patch 423 RMD160 b0362beae6dfac8be4d37ec34337c0fa48ae1be9 SHA1 4a521886503f2675dcf7ec3cee9469fa86311781 SHA256 bd5015342217a7df1596b0be8c122c64bc52b09e0921afada64e3ba176e8b2b9 +AUX 2.6.24-mactel-patches-r155/hid-add-new-apple-keyboard.patch 8440 RMD160 78b893ab1e6d7d8a2b217c01a0f2b15a9fd6863f SHA1 e662407bb1a610d93569fd82a4a8e8c9c61d07dd SHA256 9691663c497723c200543ea2869f180f0b77997e2374aa7ddfa78990eb68910c +AUX 2.6.24-mactel-patches-r155/sigmatel_audio_display_all_controls_when_subsystem_id_is_wrong.patch 820 RMD160 94de76a57d94cfedf6261cc849e9316c100d3f0f SHA1 250486062646728b0d8fb4aad4cfa7bcd861238a SHA256 af3f2cc085444027d712ed1a1e078608f8141f4253292d0043e5b992d11396c6 +AUX 2.6.24-mactel-patches-r155/sigmatel_audio_fix_macbook_v2.patch 856 RMD160 8d343c8b0f4eec70a449e2bda987edeb9fafbd6f SHA1 eda6c5f026936addff8ad090df24d2c5658ca5fe SHA256 9bd96288b95d94111b19c1d055d98088d414bbfed5d38c2bbf82a1563ec1fb5a AUX mactel-patches-r147/applesmc-for-mac-pro-2-x-quad-core.patch 7939 RMD160 f6974a36923a13d82565c7828e74656bf422df88 SHA1 146adfb5bab85466fefaff3f1066f52c74b0ddeb SHA256 5af5d1a007507126745cd29bbb2972e64232d83b7fb32e69f2fd0d147806f346 AUX mactel-patches-r147/applesmc-int-protect.patch 8677 RMD160 43683284d005614ecea1098c99b884561536b7c9 SHA1 b52899fd258ffed5dde19c5d8f9958a46a35accd SHA256 7d4079e50cfc9f26ca68ce08cb7f4dbe1ae02ce06762be90a8678ae0290a2c75 AUX mactel-patches-r147/applesmc-macbook2.patch 3087 RMD160 a9f6f3932c83306cc3f6e86793204d460893d750 SHA1 381bd9d153fca5b51820152855bdd346f7bb94f1 SHA256 513eba6bc15f9d37d537657450227e23d7aaddf25e99b1a1f2d7fceaac9f99f7 @@ -56,8 +70,11 @@ DIST genpatches-2.6.24-3.base.tar.bz2 22714 RMD160 826ab844e3f4d96f94e09d8763a01 DIST genpatches-2.6.24-3.extras.tar.bz2 43587 RMD160 a41366bb7372c168d4ede2de420256e25560122c SHA1 3a048660019206344a065beaa8dbaadbfa0a7f3b SHA256 8cee70233f609bd01c1645e9cb90c4637ee6f989b4583d652ea2df57a8894296 DIST genpatches-2.6.24-4.base.tar.bz2 39369 RMD160 c6c0bd063edbd4a2d1606cc53580530e6b0e01c4 SHA1 b6e0d72b5d452648ca3f33a529e4b6a063b10ed7 SHA256 bae9b6d932d18089283ca5ec4a8999b888dbf8d5ae3f5be8302c823f14b6f082 DIST genpatches-2.6.24-4.extras.tar.bz2 43587 RMD160 a41366bb7372c168d4ede2de420256e25560122c SHA1 3a048660019206344a065beaa8dbaadbfa0a7f3b SHA256 8cee70233f609bd01c1645e9cb90c4637ee6f989b4583d652ea2df57a8894296 +DIST genpatches-2.6.24-6.base.tar.bz2 70308 RMD160 5d849f178c1227a28d97b0a77020f104d27207e1 SHA1 d06c9f02193323af7f09a75328c23e40f70c0639 SHA256 6dbb8b7a8c43c7c500c628d4ac3e052bf8b3db8b3764067eea21651aac63e579 +DIST genpatches-2.6.24-6.extras.tar.bz2 50248 RMD160 8d95c79873dcaffdd01278ef2101eb72da5459f8 SHA1 b88da6f302390d6b26670d92065b9a80f108bf17 SHA256 080962ededdc2b9b69a7269f0920c102e10d1869c2ff204e3444ceb1ce416126 DIST linux-2.6.24.tar.bz2 46737783 RMD160 0e5194c69c3d82c41ece689c4f84e638f8776d34 SHA1 351aebc784a5395fe4c92d1e514a89680482f7e2 SHA256 413c64fbbcf81244cb5571be4963644a1e81166a2b0f008a016528363b65c5d3 EBUILD mactel-linux-sources-2.6.24-r1.ebuild 1151 RMD160 6ef9ab524a56008e0536378cfa3e112fc835dc45 SHA1 c18c164d49f76106c15110b44d83ab4311cc45c7 SHA256 b7520cdb8c33451468f85fbe8d7af1cdf47ca10a815e740cd53bedbc9f1a9b17 EBUILD mactel-linux-sources-2.6.24-r2.ebuild 1151 RMD160 3062875a537f2bc7b2f70eabbc3b92fdf18c1efe SHA1 8402bc13eecff1b22d86204971e5fae1fc5161aa SHA256 f8a459ee7d302c6ab1dff77ad2f632cbec43655ed02854548f55cef3fbfa5293 EBUILD mactel-linux-sources-2.6.24-r3.ebuild 1196 RMD160 f5e02f5dc00c27d1af90a7fda0c259f5f79b6b3a SHA1 0b90bd716953e5fad55ac6ea05265a9db162191c SHA256 62933738e49924e7b33d0af3bcec6d43671bb82df2d9bf745f7014bad832a82f EBUILD mactel-linux-sources-2.6.24-r4.ebuild 1347 RMD160 089274c3635fb12e86479a8cec253a64d47dc0a4 SHA1 b1c1db8e05c9d0a591b54b8a191178bd200fc324 SHA256 3c9fa5098addc57c818c761fe3e5f879750c5a896b7620dbccd6ee50f1a69ea4 +EBUILD mactel-linux-sources-2.6.24-r5.ebuild 1401 RMD160 e661f5bfe3cb0f90bdb606fa828516031eaa2ade SHA1 609ecc0d5121f8cba2cb67a812564d76320b638f SHA256 ef0de6f7260fab64869877ce6db6ab83965ec37f9e45b5e23af7a55fc8496837 diff --git a/sys-kernel/mactel-linux-sources/files/mactel-patches-r147/applesmc-int-protect.patch b/sys-kernel/mactel-linux-sources/files/2.6.24-mactel-patches-r155/applesmc-int-protect.patch index 29c7f61..a3a4104 100644 --- a/sys-kernel/mactel-linux-sources/files/mactel-patches-r147/applesmc-int-protect.patch +++ b/sys-kernel/mactel-linux-sources/files/2.6.24-mactel-patches-r155/applesmc-int-protect.patch @@ -10,11 +10,12 @@ From: Nicolas Boichat <nicolas@boichat.ch> drivers/hwmon/applesmc.c | 155 +++++++++++++++++++++++++++++++++++++++++++--- 3 files changed, 156 insertions(+), 10 deletions(-) + diff --git a/drivers/hwmon/Kconfig b/drivers/hwmon/Kconfig -index e74a89d..690135c 100644 +index a0445be..1e857c0 100644 --- a/drivers/hwmon/Kconfig +++ b/drivers/hwmon/Kconfig -@@ -685,6 +685,13 @@ config SENSORS_APPLESMC +@@ -754,6 +754,13 @@ config SENSORS_APPLESMC Say Y here if you have an applicable laptop and want to experience the awesome power of applesmc. @@ -29,10 +30,10 @@ index e74a89d..690135c 100644 bool "Hardware Monitoring Chip debugging messages" default n diff --git a/drivers/hwmon/Makefile b/drivers/hwmon/Makefile -index d04f900..5fc1231 100644 +index 55595f6..4225f3d 100644 --- a/drivers/hwmon/Makefile +++ b/drivers/hwmon/Makefile -@@ -67,3 +67,7 @@ ifeq ($(CONFIG_HWMON_DEBUG_CHIP),y) +@@ -73,3 +73,7 @@ ifeq ($(CONFIG_HWMON_DEBUG_CHIP),y) EXTRA_CFLAGS += -DDEBUG endif @@ -41,7 +42,7 @@ index d04f900..5fc1231 100644 +endif + diff --git a/drivers/hwmon/applesmc.c b/drivers/hwmon/applesmc.c -index 00ce2d1..e195af0 100644 +index 9ed7c84..62c8bd1 100644 --- a/drivers/hwmon/applesmc.c +++ b/drivers/hwmon/applesmc.c @@ -40,6 +40,12 @@ @@ -57,7 +58,7 @@ index 00ce2d1..e195af0 100644 /* data port used by Apple SMC */ #define APPLESMC_DATA_PORT 0x300 -@@ -170,6 +176,11 @@ static unsigned int applesmc_light; +@@ -171,6 +177,11 @@ static unsigned int applesmc_light; /* Indicates which temperature sensors set to use. */ static unsigned int applesmc_temperature_set; @@ -69,7 +70,7 @@ index 00ce2d1..e195af0 100644 static DEFINE_MUTEX(applesmc_lock); /* -@@ -450,6 +461,35 @@ static int applesmc_init_check_key_value(const char *key, u8 *buffer, u8 len) +@@ -446,6 +457,35 @@ static int applesmc_init_check_key_value(const char *key, u8 *buffer, u8 len) return -EIO; } @@ -105,7 +106,7 @@ index 00ce2d1..e195af0 100644 irqreturn_t applesmc_irq_handler(int irq, void *dev_id) { u8 int_type = inb(APPLESMC_INT_PORT); -@@ -471,14 +511,24 @@ irqreturn_t applesmc_irq_handler(int irq, void *dev_id) +@@ -467,14 +507,24 @@ irqreturn_t applesmc_irq_handler(int irq, void *dev_id) int_type); } @@ -131,7 +132,7 @@ index 00ce2d1..e195af0 100644 { int total; int ret = -ENXIO; -@@ -553,17 +603,21 @@ static int applesmc_device_init(void) +@@ -549,17 +599,21 @@ static int applesmc_device_init(void) goto out; } @@ -160,7 +161,7 @@ index 00ce2d1..e195af0 100644 out: mutex_unlock(&applesmc_lock); return ret; -@@ -594,7 +648,7 @@ static int applesmc_probe(struct platform_device *dev) +@@ -590,7 +644,7 @@ static int applesmc_probe(struct platform_device *dev) { int ret; @@ -169,7 +170,7 @@ index 00ce2d1..e195af0 100644 if (ret) return ret; -@@ -604,7 +658,7 @@ static int applesmc_probe(struct platform_device *dev) +@@ -600,7 +654,7 @@ static int applesmc_probe(struct platform_device *dev) static int applesmc_resume(struct platform_device *dev) { @@ -178,7 +179,7 @@ index 00ce2d1..e195af0 100644 } static int applesmc_remove(struct platform_device *dev) -@@ -901,6 +955,46 @@ static ssize_t applesmc_calibrate_store(struct device *dev, +@@ -897,6 +951,46 @@ static ssize_t applesmc_calibrate_store(struct device *dev, return count; } @@ -225,7 +226,7 @@ index 00ce2d1..e195af0 100644 /* Store the next backlight value to be written by the work */ static unsigned int backlight_value; -@@ -1206,6 +1300,10 @@ static DEVICE_ATTR(name, 0444, applesmc_name_show, NULL); +@@ -1201,6 +1295,10 @@ static DEVICE_ATTR(name, 0444, applesmc_name_show, NULL); static DEVICE_ATTR(position, 0444, applesmc_position_show, NULL); static DEVICE_ATTR(calibrate, 0644, applesmc_calibrate_show, applesmc_calibrate_store); @@ -236,7 +237,7 @@ index 00ce2d1..e195af0 100644 static SENSOR_DEVICE_ATTR(low_norm_trigger_interval, 0644, applesmc_accelerometer_show, applesmc_accelerometer_store, 0); static SENSOR_DEVICE_ATTR(high_norm_trigger_interval, 0644, -@@ -1218,6 +1316,9 @@ static SENSOR_DEVICE_ATTR(high_norm_trigger, 0644, +@@ -1213,6 +1311,9 @@ static SENSOR_DEVICE_ATTR(high_norm_trigger, 0644, static struct attribute *accelerometer_attributes[] = { &dev_attr_position.attr, &dev_attr_calibrate.attr, @@ -246,7 +247,7 @@ index 00ce2d1..e195af0 100644 &sensor_dev_attr_low_norm_trigger.dev_attr.attr, &sensor_dev_attr_high_norm_trigger.dev_attr.attr, &sensor_dev_attr_low_norm_trigger_interval.dev_attr.attr, -@@ -1458,6 +1559,10 @@ static int applesmc_create_accelerometer(void) +@@ -1453,6 +1554,10 @@ static int applesmc_create_accelerometer(void) { struct input_dev *idev; int ret; @@ -257,7 +258,7 @@ index 00ce2d1..e195af0 100644 ret = sysfs_create_group(&pdev->dev.kobj, &accelerometer_attributes_group); -@@ -1491,6 +1596,30 @@ static int applesmc_create_accelerometer(void) +@@ -1486,6 +1591,30 @@ static int applesmc_create_accelerometer(void) if (ret) goto out_idev; @@ -288,7 +289,7 @@ index 00ce2d1..e195af0 100644 return 0; out_idev: -@@ -1510,6 +1639,12 @@ static void applesmc_release_accelerometer(void) +@@ -1505,6 +1634,12 @@ static void applesmc_release_accelerometer(void) input_unregister_polled_device(applesmc_idev); input_free_polled_device(applesmc_idev); sysfs_remove_group(&pdev->dev.kobj, &accelerometer_attributes_group); diff --git a/sys-kernel/mactel-linux-sources/files/mactel-patches-r147/applesmc-macbook2.patch b/sys-kernel/mactel-linux-sources/files/2.6.24-mactel-patches-r155/applesmc-macbook2.patch index 860b246..0733cbe 100644 --- a/sys-kernel/mactel-linux-sources/files/mactel-patches-r147/applesmc-macbook2.patch +++ b/sys-kernel/mactel-linux-sources/files/2.6.24-mactel-patches-r155/applesmc-macbook2.patch @@ -8,8 +8,9 @@ From: Riki Oktarianto <rkoktarianto@gmail.com> drivers/hwmon/applesmc.c | 29 +++++++++++++++++++---------- 1 files changed, 19 insertions(+), 10 deletions(-) + diff --git a/drivers/hwmon/applesmc.c b/drivers/hwmon/applesmc.c -index 3c9ba72..ce0fe69 100644 +index 86c66c3..c0dd9b1 100644 --- a/drivers/hwmon/applesmc.c +++ b/drivers/hwmon/applesmc.c @@ -84,12 +84,15 @@ static const char* temperature_sensors_sets[][36] = { @@ -31,7 +32,7 @@ index 3c9ba72..ce0fe69 100644 { "TA0P", "TCAG", "TCAH", "TCBG", "TCBH", "TC0C", "TC0D", "TC0P", "TC1C", "TC1D", "TC2C", "TC2D", "TC3C", "TC3D", "THTG", "TH0P", "TH1P", "TH2P", "TH3P", "TMAP", "TMAS", "TMBS", "TM0P", "TM0S", -@@ -1237,12 +1240,14 @@ static void applesmc_release_accelerometer(void) +@@ -1212,12 +1215,14 @@ static void applesmc_release_accelerometer(void) static __initdata struct dmi_match_data applesmc_dmi_data[] = { /* MacBook Pro: accelerometer, backlight and temperature set 0 */ { .accelerometer = 1, .light = 1, .temperature_set = 0 }, @@ -50,7 +51,7 @@ index 3c9ba72..ce0fe69 100644 }; /* Note that DMI_MATCH(...,"MacBook") will match "MacBookPro1,1". -@@ -1254,16 +1259,20 @@ static __initdata struct dmi_system_id applesmc_whitelist[] = { +@@ -1229,16 +1234,20 @@ static __initdata struct dmi_system_id applesmc_whitelist[] = { (void*)&applesmc_dmi_data[0]}, { applesmc_dmi_match, "Apple MacBook", { DMI_MATCH(DMI_BOARD_VENDOR,"Apple"), diff --git a/sys-kernel/mactel-linux-sources/files/2.6.24-mactel-patches-r155/applesmc-remove-debugging-messages.patch b/sys-kernel/mactel-linux-sources/files/2.6.24-mactel-patches-r155/applesmc-remove-debugging-messages.patch new file mode 100644 index 0000000..8b6f6c4 --- /dev/null +++ b/sys-kernel/mactel-linux-sources/files/2.6.24-mactel-patches-r155/applesmc-remove-debugging-messages.patch @@ -0,0 +1,92 @@ +Remove debugging messages. + +From: Nicolas Boichat <nicolas@boichat.ch> + + +--- + + drivers/hwmon/applesmc.c | 24 ++++++++++-------------- + 1 files changed, 10 insertions(+), 14 deletions(-) + + +diff --git a/drivers/hwmon/applesmc.c b/drivers/hwmon/applesmc.c +index 3b09cdb..25204b4 100644 +--- a/drivers/hwmon/applesmc.c ++++ b/drivers/hwmon/applesmc.c +@@ -133,7 +133,8 @@ struct dmi_match_data { + int temperature_set; + }; + +-static const int debug; ++static int debug = 0; ++module_param(debug, int, S_IRUGO|S_IWUSR); + static struct platform_device *pdev; + static s16 rest_x; + static s16 rest_y; +@@ -172,7 +173,7 @@ static int __wait_status(u8 val) + + for (i = 0; i < 200; i++) { + if ((inb(APPLESMC_CMD_PORT) & APPLESMC_STATUS_MASK) == val) { +- if (debug) ++ if (debug >= 9) + printk(KERN_DEBUG + "Waited %d us for status %x\n", + i*10, val); +@@ -181,7 +182,8 @@ static int __wait_status(u8 val) + udelay(10); + } + +- printk(KERN_WARNING "applesmc: wait status failed: %x != %x\n", ++ if (debug >= 1) ++ printk(KERN_WARNING "applesmc: wait status failed: %x != %x\n", + val, inb(APPLESMC_CMD_PORT)); + + return -EIO; +@@ -219,11 +221,11 @@ static int applesmc_read_key(const char* key, u8* buffer, u8 len) + goto wait_fail; + } + } +- if (debug) ++ if (debug >= 9) + printk(KERN_DEBUG "<%s", key); + + outb(len, APPLESMC_DATA_PORT); +- if (debug) ++ if (debug >= 9) + printk(KERN_DEBUG ">%x", len); + + for (i = 0; i < len; i++) { +@@ -232,22 +234,16 @@ static int applesmc_read_key(const char* key, u8* buffer, u8 len) + goto wait_fail; + } + buffer[i] = inb(APPLESMC_DATA_PORT); +- if (debug) ++ if (debug >= 9) + printk(KERN_DEBUG "<%x", buffer[i]); + } +- if (debug) ++ if (debug >= 9) + printk(KERN_DEBUG "\n"); + + break; + + wait_fail: + msleep(ACCESS_WAIT_MSECS); +- continue; +- } +- +- if (total != ACCESS_TIMEOUT_MSECS) { +- printk(KERN_DEBUG "Read: Waited %d ms for the value\n", +- ACCESS_TIMEOUT_MSECS-total); + } + + return ret; +@@ -399,7 +395,7 @@ static int applesmc_device_init(void) + mutex_lock(&applesmc_lock); + + for (total = INIT_TIMEOUT_MSECS; total > 0; total -= INIT_WAIT_MSECS) { +- if (debug) ++ if (debug >= 9) + printk(KERN_DEBUG "applesmc try %d\n", total); + if (!applesmc_read_key(MOTION_SENSOR_KEY, buffer, 2) && + (buffer[0] != 0x00 || buffer[1] != 0x00)) { diff --git a/sys-kernel/mactel-linux-sources/files/mactel-patches-r147/applesmc-retry-when-accessing-keys.patch b/sys-kernel/mactel-linux-sources/files/2.6.24-mactel-patches-r155/applesmc-retry-when-accessing-keys.patch index f6b145b..a5ee733 100644 --- a/sys-kernel/mactel-linux-sources/files/mactel-patches-r147/applesmc-retry-when-accessing-keys.patch +++ b/sys-kernel/mactel-linux-sources/files/2.6.24-mactel-patches-r155/applesmc-retry-when-accessing-keys.patch @@ -8,11 +8,12 @@ From: Nicolas Boichat <nicolas@boichat.ch> drivers/hwmon/applesmc.c | 69 +++++++++++++++++++++++++++++++--------------- 1 files changed, 47 insertions(+), 22 deletions(-) + diff --git a/drivers/hwmon/applesmc.c b/drivers/hwmon/applesmc.c -index 4b90444..3c9ba72 100644 +index c0dd9b1..3b09cdb 100644 --- a/drivers/hwmon/applesmc.c +++ b/drivers/hwmon/applesmc.c -@@ -109,6 +109,9 @@ static const char* fan_speed_keys[] = { +@@ -112,6 +112,9 @@ static const char* fan_speed_keys[] = { #define INIT_TIMEOUT_MSECS 5000 /* wait up to 5s for device init ... */ #define INIT_WAIT_MSECS 50 /* ... in 50ms increments */ @@ -22,7 +23,7 @@ index 4b90444..3c9ba72 100644 #define APPLESMC_POLL_INTERVAL 50 /* msecs */ #define APPLESMC_INPUT_FUZZ 4 /* input event threshold */ #define APPLESMC_INPUT_FLAT 4 -@@ -183,12 +186,13 @@ static int __wait_status(u8 val) +@@ -186,12 +189,13 @@ static int __wait_status(u8 val) /* * applesmc_read_key - reads len bytes from a given key, and put them in buffer. @@ -37,7 +38,7 @@ index 4b90444..3c9ba72 100644 if (len > APPLESMC_MAX_DATA_LENGTH) { printk(KERN_ERR "applesmc_read_key: cannot read more than " -@@ -196,33 +200,54 @@ static int applesmc_read_key(const char* key, u8* buffer, u8 len) +@@ -199,33 +203,54 @@ static int applesmc_read_key(const char* key, u8* buffer, u8 len) return -EINVAL; } diff --git a/sys-kernel/mactel-linux-sources/files/mactel-patches-r147/applesmc_int.patch b/sys-kernel/mactel-linux-sources/files/2.6.24-mactel-patches-r155/applesmc_int.patch index 80aad72..2f2d3dc 100644 --- a/sys-kernel/mactel-linux-sources/files/mactel-patches-r147/applesmc_int.patch +++ b/sys-kernel/mactel-linux-sources/files/2.6.24-mactel-patches-r155/applesmc_int.patch @@ -5,11 +5,12 @@ From: Nicolas Boichat <nicolas@boichat.ch> --- - drivers/hwmon/applesmc.c | 321 +++++++++++++++++++++++++++++++++++++++++++--- - 1 files changed, 298 insertions(+), 23 deletions(-) + drivers/hwmon/applesmc.c | 322 +++++++++++++++++++++++++++++++++++++++++++--- + 1 files changed, 298 insertions(+), 24 deletions(-) + diff --git a/drivers/hwmon/applesmc.c b/drivers/hwmon/applesmc.c -index ce0fe69..00ce2d1 100644 +index 25204b4..9ed7c84 100644 --- a/drivers/hwmon/applesmc.c +++ b/drivers/hwmon/applesmc.c @@ -39,14 +39,20 @@ @@ -62,7 +63,7 @@ index ce0fe69..00ce2d1 100644 #define FANS_COUNT "FNum" /* r-o ui8 */ #define FANS_MANUAL "FS! " /* r-w ui16 */ #define FAN_ACTUAL_SPEED "F0Ac" /* r-o fpe2 (2 bytes) */ -@@ -385,12 +406,83 @@ static int applesmc_read_motion_sensor(int index, s16* value) +@@ -381,12 +402,83 @@ static int applesmc_read_motion_sensor(int index, s16* value) } /* @@ -147,14 +148,14 @@ index ce0fe69..00ce2d1 100644 u8 buffer[2]; if (!applesmc_accelerometer) -@@ -398,32 +490,79 @@ static int applesmc_device_init(void) +@@ -394,32 +486,79 @@ static int applesmc_device_init(void) mutex_lock(&applesmc_lock); + /* Accept interrupts */ + buffer[0] = 0x01; for (total = INIT_TIMEOUT_MSECS; total > 0; total -= INIT_WAIT_MSECS) { -- if (debug) +- if (debug >= 9) - printk(KERN_DEBUG "applesmc try %d\n", total); - if (!applesmc_read_key(MOTION_SENSOR_KEY, buffer, 2) && - (buffer[0] != 0x00 || buffer[1] != 0x00)) { @@ -176,7 +177,7 @@ index ce0fe69..00ce2d1 100644 - buffer[1] = 0x00; - applesmc_write_key(MOTION_SENSOR_KEY, buffer, 2); + ret1 = applesmc_write_key(INTERRUPT_OK_KEY, buffer, 1); - msleep(INIT_WAIT_MSECS); ++ msleep(INIT_WAIT_MSECS); + + if (!ret1) + break; @@ -198,9 +199,8 @@ index ce0fe69..00ce2d1 100644 + printk(KERN_WARNING "applesmc: Cannot set motion sensor " + "interrupt interval, might not receive " + "some interrupts."); - } - -- printk(KERN_WARNING "applesmc: failed to init the device\n"); ++ } ++ + buffer[0] = 0x00; + buffer[1] = 0x60; + ret1 = applesmc_init_check_key_value(MOTION_LOW_NORM, buffer, 2); @@ -219,7 +219,7 @@ index ce0fe69..00ce2d1 100644 + buffer[0] = 0x01; + for (total = INIT_TIMEOUT_MSECS; total > 0; total -= INIT_WAIT_MSECS) { + ret1 = applesmc_write_key(MSDW_KEY, buffer, 1); -+ msleep(INIT_WAIT_MSECS); + msleep(INIT_WAIT_MSECS); + + if (!ret1) + break; @@ -234,8 +234,9 @@ index ce0fe69..00ce2d1 100644 + printk(KERN_WARNING "applesmc: failed to init " + "the accelerometer\n"); + goto out; -+ } -+ + } + +- printk(KERN_WARNING "applesmc: failed to init the device\n"); + ret1 = request_irq(APPLESMC_IRQ, applesmc_irq_handler, IRQF_DISABLED, + "applesmc_irq_handler", NULL); + @@ -249,7 +250,7 @@ index ce0fe69..00ce2d1 100644 out: mutex_unlock(&applesmc_lock); -@@ -468,9 +607,16 @@ static int applesmc_resume(struct platform_device *dev) +@@ -464,9 +603,16 @@ static int applesmc_resume(struct platform_device *dev) return applesmc_device_init(); } @@ -266,7 +267,16 @@ index ce0fe69..00ce2d1 100644 .driver = { .name = "applesmc", .owner = THIS_MODULE, -@@ -932,6 +1078,123 @@ static ssize_t applesmc_key_at_index_store(struct device *dev, +@@ -774,7 +920,7 @@ static void applesmc_brightness_set(struct led_classdev *led_cdev, + backlight_value = value; + ret = queue_work(applesmc_led_wq, &backlight_work); + +- if (debug && (!ret)) ++ if ((debug >= 9) && (!ret)) + printk(KERN_DEBUG "applesmc: work was already on the queue.\n"); + } + +@@ -928,6 +1074,122 @@ static ssize_t applesmc_key_at_index_store(struct device *dev, return count; } @@ -386,11 +396,10 @@ index ce0fe69..00ce2d1 100644 + else + return count; +} -+ static struct led_classdev applesmc_backlight = { .name = "smc:kbd_backlight", .default_trigger = "nand-disk", -@@ -943,10 +1206,22 @@ static DEVICE_ATTR(name, 0444, applesmc_name_show, NULL); +@@ -939,10 +1201,22 @@ static DEVICE_ATTR(name, 0444, applesmc_name_show, NULL); static DEVICE_ATTR(position, 0444, applesmc_position_show, NULL); static DEVICE_ATTR(calibrate, 0644, applesmc_calibrate_show, applesmc_calibrate_store); diff --git a/sys-kernel/mactel-linux-sources/files/2.6.24-mactel-patches-r155/appletouch-new.patch b/sys-kernel/mactel-linux-sources/files/2.6.24-mactel-patches-r155/appletouch-new.patch new file mode 100644 index 0000000..f995c7a --- /dev/null +++ b/sys-kernel/mactel-linux-sources/files/2.6.24-mactel-patches-r155/appletouch-new.patch @@ -0,0 +1,377 @@ + + +From: Sven Anders <anders@anduras.de> + + +--- + + drivers/input/mouse/appletouch.c | 165 +++++++++++++++++++++++++++++--------- + 1 files changed, 125 insertions(+), 40 deletions(-) + + +diff --git a/drivers/input/mouse/appletouch.c b/drivers/input/mouse/appletouch.c +index b4423a4..b42c1ed 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 0x022B + + #define ATP_DEVICE(prod) \ + .match_flags = USB_DEVICE_ID_MATCH_DEVICE | \ +@@ -73,15 +81,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) }, +@@ -93,6 +103,11 @@ static struct usb_device_id atp_table [] = { + { ATP_DEVICE(GEYSER4_ISO_PRODUCT_ID) }, + { ATP_DEVICE(GEYSER4_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 */ + { } + }; +@@ -136,12 +151,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 ? */ +@@ -156,8 +180,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) \ +@@ -174,8 +198,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"); + + /* +@@ -185,7 +213,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"); + +@@ -203,12 +231,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); + +@@ -217,7 +245,10 @@ static inline int atp_is_geyser_3(struct atp *dev) + (productId == GEYSER3_JIS_PRODUCT_ID) || + (productId == GEYSER4_ANSI_PRODUCT_ID) || + (productId == GEYSER4_ISO_PRODUCT_ID) || +- (productId == GEYSER4_JIS_PRODUCT_ID); ++ (productId == GEYSER4_JIS_PRODUCT_ID) || ++ (productId == GEYSER4_HF_ANSI_PRODUCT_ID) || ++ (productId == GEYSER4_HF_ISO_PRODUCT_ID) || ++ (productId == GEYSER4_HF_JIS_PRODUCT_ID); + } + + /* +@@ -229,7 +260,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, +@@ -237,6 +268,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; +@@ -252,6 +290,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; +@@ -269,8 +314,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); +@@ -385,7 +429,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)); + + /* +@@ -442,13 +486,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 */ +@@ -474,26 +525,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; +@@ -538,16 +610,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: +@@ -615,7 +699,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; +@@ -658,7 +742,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 + */ +@@ -701,6 +785,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; diff --git a/sys-kernel/mactel-linux-sources/files/mactel-patches-r147/appletouch.patch b/sys-kernel/mactel-linux-sources/files/2.6.24-mactel-patches-r155/appletouch.patch index 0ec50e0..036655a 100644 --- a/sys-kernel/mactel-linux-sources/files/mactel-patches-r147/appletouch.patch +++ b/sys-kernel/mactel-linux-sources/files/2.6.24-mactel-patches-r155/appletouch.patch @@ -8,16 +8,17 @@ From: Ortwin Glück <odi@odi.ch> drivers/input/mouse/appletouch.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) + diff --git a/drivers/input/mouse/appletouch.c b/drivers/input/mouse/appletouch.c -index a1804bf..51cc7c3 100644 +index b42c1ed..805cc5e 100644 --- a/drivers/input/mouse/appletouch.c +++ b/drivers/input/mouse/appletouch.c -@@ -127,7 +127,7 @@ MODULE_DEVICE_TABLE (usb, atp_table); +@@ -142,7 +142,7 @@ MODULE_DEVICE_TABLE (usb, atp_table); * Threshold for the touchpad sensors. Any change less than ATP_THRESHOLD is * ignored. */ -#define ATP_THRESHOLD 5 +#define ATP_THRESHOLD 3 - /* MacBook Pro (Geyser 3 & 4) initialization constants */ - #define ATP_GEYSER3_MODE_READ_REQUEST_ID 1 + /* Geyser initialization constants */ + #define ATP_GEYSER_MODE_READ_REQUEST_ID 1 diff --git a/sys-kernel/mactel-linux-sources/files/2.6.24-mactel-patches-r155/disk-protect-fix-2.6.24-crash.patch b/sys-kernel/mactel-linux-sources/files/2.6.24-mactel-patches-r155/disk-protect-fix-2.6.24-crash.patch new file mode 100644 index 0000000..0c6c494 --- /dev/null +++ b/sys-kernel/mactel-linux-sources/files/2.6.24-mactel-patches-r155/disk-protect-fix-2.6.24-crash.patch @@ -0,0 +1,49 @@ +Elias Oltmanns linux-thinkpad@linux-thinkpad.org + +From: Nicolas Boichat <nicolas@boichat.ch> + +Wed, 13 Feb 2008 12:39:17 +0100 + +Anyway, there is a temporary solution to this problem. If you apply the +little patch attached to this email, the usual disk-protect patch will +work on 2.6.24. This change is supposed to fix a generic problem in +libata and may eventually be merged upstream, but Tejun Heo (libata +developer) said that some testing was required first. + +This change is absolutely safe for everyone using a non-NCQ capable +system. In particular, ata_piix doesn't support NCQ. If you are using +ahci and /sys/class/scsi_disk/.../device/queue_depth reports a value +greater than 1, i.e. NCQ is enabled, then the patch shouldn't cause any +harm either but it may or may not affect I/O performance. + +Enjoy, + +Elias +--- + + drivers/ata/libata-scsi.c | 4 ++-- + 1 files changed, 2 insertions(+), 2 deletions(-) + + +diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c +index 6b02998..82ec82a 100644 +--- a/drivers/ata/libata-scsi.c ++++ b/drivers/ata/libata-scsi.c +@@ -823,7 +823,7 @@ static void ata_scsi_sdev_config(struct scsi_device *sdev) + * prevent SCSI midlayer from automatically deferring + * requests. + */ +- sdev->max_device_blocked = 1; ++ sdev->max_device_blocked = 2; + } + + static void ata_scsi_dev_config(struct scsi_device *sdev, +@@ -3156,7 +3156,7 @@ int ata_scsi_add_hosts(struct ata_host *host, struct scsi_host_template *sht) + * Set host_blocked to 1 to prevent SCSI midlayer from + * automatically deferring requests. + */ +- shost->max_host_blocked = 1; ++ shost->max_host_blocked = 2; + + rc = scsi_add_host(ap->scsi_host, ap->host->dev); + if (rc) diff --git a/sys-kernel/mactel-linux-sources/files/mactel-patches-r147/disk-protect-update.patch b/sys-kernel/mactel-linux-sources/files/2.6.24-mactel-patches-r155/disk-protect-update.patch index 5daf810..af6afd4 100644 --- a/sys-kernel/mactel-linux-sources/files/mactel-patches-r147/disk-protect-update.patch +++ b/sys-kernel/mactel-linux-sources/files/2.6.24-mactel-patches-r155/disk-protect-update.patch @@ -9,11 +9,12 @@ From: Nicolas Boichat <nicolas@boichat.ch> include/linux/blkdev.h | 2 ++ 2 files changed, 3 insertions(+), 0 deletions(-) + diff --git a/block/ll_rw_blk.c b/block/ll_rw_blk.c -index 3a3afd8..c4c9d71 100644 +index 31f0c22..9d7864a 100644 --- a/block/ll_rw_blk.c +++ b/block/ll_rw_blk.c -@@ -4218,6 +4218,7 @@ static ssize_t queue_protect_show(struct request_queue *q, char *page) +@@ -4308,6 +4308,7 @@ static ssize_t queue_protect_show(struct request_queue *q, char *page) spin_unlock_irq(q->queue_lock); return queue_var_show(seconds, (page)); } @@ -22,10 +23,10 @@ index 3a3afd8..c4c9d71 100644 /* * When writing the 'protect' attribute, input is the number of seconds diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h -index 2fa892d..8626bac 100644 +index e10f40b..3e53289 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h -@@ -128,6 +128,8 @@ struct io_context *get_io_context(gfp_t gfp_flags, int node); +@@ -114,6 +114,8 @@ struct io_context *get_io_context(gfp_t gfp_flags, int node); void copy_io_context(struct io_context **pdst, struct io_context **psrc); void swap_io_context(struct io_context **ioc1, struct io_context **ioc2); diff --git a/sys-kernel/mactel-linux-sources/files/mactel-patches-r147/disk-protect.patch b/sys-kernel/mactel-linux-sources/files/2.6.24-mactel-patches-r155/disk-protect.patch index cb6fb25..c7c9ae7 100644 --- a/sys-kernel/mactel-linux-sources/files/mactel-patches-r147/disk-protect.patch +++ b/sys-kernel/mactel-linux-sources/files/2.6.24-mactel-patches-r155/disk-protect.patch @@ -1,126 +1,43 @@ +From: Elias Oltmanns <eo@...> +From: Nicolas Boichat <nicolas@boichat.ch> -From: Elias Oltmanns <eo@nebensachen.de> - +Subject: disk-protect patch for kernel 2.6.24-rc3 +Newsgroups: gmane.linux.drivers.hdaps.devel +Date: 2007-11-18 16:19:24 GMT (16 weeks, 20 hours and 52 minutes ago) +For those who can't wait. Mind you, it's compile tested only. But then +you all know about rc versions and the usual disclaimers with regard to +your precious data. --- - Documentation/block/disk-protection.txt | 79 +++++++++++ - block/ll_rw_blk.c | 224 +++++++++++++++++++++++++++++++ - drivers/ata/libata-scsi.c | 36 +++++ - drivers/ide/ide-disk.c | 142 ++++++++++++++++++++ - drivers/ide/ide-io.c | 14 ++ - drivers/scsi/scsi_lib.c | 169 +++++++++++++++++++++++ - include/linux/ata.h | 1 - include/linux/blkdev.h | 14 ++ - include/linux/ide.h | 1 - 9 files changed, 680 insertions(+), 0 deletions(-) + block/ll_rw_blk.c | 236 ++++++++++++++++++++++++++++++++++++++++++++- + drivers/ata/libata-scsi.c | 36 +++++++ + drivers/ide/ide-disk.c | 142 +++++++++++++++++++++++++++ + drivers/ide/ide-io.c | 14 +++ + drivers/scsi/scsi_lib.c | 169 ++++++++++++++++++++++++++++++++ + include/linux/ata.h | 12 ++ + include/linux/blkdev.h | 14 +++ + include/linux/ide.h | 1 + 8 files changed, 621 insertions(+), 3 deletions(-) + -diff --git a/Documentation/block/disk-protection.txt b/Documentation/block/disk-protection.txt -new file mode 100644 -index 0000000..508cc5b ---- /dev/null -+++ b/Documentation/block/disk-protection.txt -@@ -0,0 +1,79 @@ -+Hard disk protection -+==================== -+ -+ -+Intro -+----- -+ATA/ATAPI-7 specifies the IDLE IMMEDIATE command with UNLOAD FEATURE. -+Issuing this command should cause the drive to switch to idle mode and -+unload disk heads. This feature is being used in modern laptops in -+conjunction with accelerometers and appropriate software to implement -+a shock protection facility. The idea is to stop all I/O operations on -+the internal hard drive and park its heads on the ramp when critical -+situations are anticipated. The desire to have such a feature -+available on GNU/Linux systems has been the original motivation to -+implement a generic disk parking interface in the Linux kernel. -+ -+ -+The interface -+------------- -+The interface works as follows: Writing an integer value to -+/sys/block/*/queue/protect will park the respective drive and freeze -+the block layer queue for the specified number of seconds. When the -+timeout expires and no further disk park request has been issued in -+the meantime, the queue is unfrozen and accumulated I/O operations are -+performed. -+ -+IMPORTANT NOTE: -+Not all ATA drives implement IDLE IMMEDIATE with UNLOAD FEATURE and -+quite a few of those that do so, don't report this capability as -+described in the specs. When a disk park has been requested through -+sysfs as described above, the kernel will try to determine if the -+drive supports the UNLOAD FEATURE by default. The kernel will only -+rely on the IDLE IMMEDIATE with UNLOAD FEATURE command if it is -+convinced that this command is actually supported by the disk drive; -+otherwise, it will fall back to STANDBY IMMEDIATE. Resuming from the -+latter will take much longer and it is generally more likely to have a -+negative impact on the drive's lifetime due to the inclease of spin -+down and up cycles. If you want to use this interface in a shock -+protection framework and you know that your drive does indeed support -+the IDLE IMMEDIATE with UNLOAD FEATURE command despite not saying so, -+you can force the kernel to issue that command by doing the following -+on the command line: -+# echo -n unload > /sys/block/sda/queue/protect_method -+(replace sda by the drive identifier as appropriate). -+ -+/sys/block/*/queue/protect_method accepts auto, unload and standby -+respectively. Reading from protect_method shows the available options -+surrounding the active one with brackets. When auto is active, this -+will change to whatever the kernel sees fit after the next disk park -+command has been issued. -+ -+ -+References -+---------- -+ -+There are several laptops from different brands featuring shock -+protection capabilities. As manufacturers have refused to support open -+source development of the required software components so far, Linux -+support for shock protection varies considerably between different -+hardware implementations. Ideally, this section should contain a list -+of poiters at different projects aiming at an implementation of shock -+protection on different systeems. Unfortunately, I only know of a -+single project which, although still considered experimental, is fit -+for use. Please feel free to add projects that have been the victims -+of my ignorance. -+ -+- http://www.thinkwiki.org/wiki/HDAPS -+ See this page for information about Linux support of the hard disk -+ active protection syystem as implemented in IBM/Lenovo Thinkpads. -+ -+ -+CREDITS -+------- -+ -+The patch to implement the interface described in this file has -+originally been published by Jon Escombe <lists@dresco.co.uk>. -+ -+ -+05 Dec 2006, Elias Oltmanns <eo@nebensachen.de> diff --git a/block/ll_rw_blk.c b/block/ll_rw_blk.c -index 026cf24..3a3afd8 100644 +index 8b91994..31f0c22 100644 --- a/block/ll_rw_blk.c +++ b/block/ll_rw_blk.c -@@ -38,10 +38,14 @@ +@@ -39,6 +39,10 @@ static void blk_unplug_work(struct work_struct *work); static void blk_unplug_timeout(unsigned long data); +static void blk_unfreeze_work(struct work_struct *work); +static void blk_unfreeze_timeout(unsigned long data); - static void drive_stat_acct(struct request *rq, int nr_sectors, int new_io); - static void init_request_from_bio(struct request *req, struct bio *bio); - static int __make_request(struct request_queue *q, struct bio *bio); - static struct io_context *current_io_context(gfp_t gfp_flags, int node); +static int blk_protect_register(struct request_queue *q); +static void blk_protect_unregister(struct request_queue *q); - - /* - * For the allocated request tables -@@ -227,6 +231,16 @@ void blk_queue_make_request(struct request_queue * q, make_request_fn * mfn) + static void drive_stat_acct(struct request *rq, int new_io); + static void init_request_from_bio(struct request *req, struct bio *bio); + static int __make_request(struct request_queue *q, struct bio *bio); +@@ -231,6 +235,16 @@ void blk_queue_make_request(struct request_queue * q, make_request_fn * mfn) q->unplug_timer.function = blk_unplug_timeout; q->unplug_timer.data = (unsigned long)q; @@ -137,9 +54,9 @@ index 026cf24..3a3afd8 100644 /* * by default assume old behaviour and bounce for any highmem page */ -@@ -318,6 +332,18 @@ void blk_queue_issue_flush_fn(struct request_queue *q, issue_flush_fn *iff) - - EXPORT_SYMBOL(blk_queue_issue_flush_fn); +@@ -263,6 +277,18 @@ static void rq_init(struct request_queue *q, struct request *rq) + rq->next_rq = NULL; + } +void blk_queue_issue_protect_fn(struct request_queue *q, issue_protect_fn *ipf) +{ @@ -153,26 +70,43 @@ index 026cf24..3a3afd8 100644 +} +EXPORT_SYMBOL(blk_queue_issue_unprotect_fn); + - /* - * Cache flushing for ordered writes handling - */ -@@ -1849,6 +1875,7 @@ struct request_queue *blk_alloc_queue_node(gfp_t gfp_mask, int node_id) - return NULL; + /** + * blk_queue_ordered - does this queue support ordered writes + * @q: the request queue +@@ -1861,6 +1887,7 @@ struct request_queue *blk_alloc_queue_node(gfp_t gfp_mask, int node_id) + } init_timer(&q->unplug_timer); + init_timer(&q->unfreeze_timer); - snprintf(q->kobj.name, KOBJ_NAME_LEN, "%s", "queue"); + kobject_set_name(&q->kobj, "%s", "queue"); q->kobj.ktype = &queue_ktype; -@@ -4114,6 +4141,7 @@ int blk_register_queue(struct gendisk *disk) - return ret; +@@ -4191,13 +4218,21 @@ int blk_register_queue(struct gendisk *disk) + kobject_uevent(&q->kobj, KOBJ_ADD); + + ret = elv_register_queue(q); ++ if (ret) ++ goto err; ++ ++ ret = blk_protect_register(q); + if (ret) { +- kobject_uevent(&q->kobj, KOBJ_REMOVE); +- kobject_del(&q->kobj); +- return ret; ++ elv_unregister_queue(q); ++ goto err; } -+ blk_protect_register(q); return 0; ++ ++err: ++ kobject_uevent(&q->kobj, KOBJ_REMOVE); ++ kobject_del(&q->kobj); ++ return ret; } -@@ -4122,6 +4150,7 @@ void blk_unregister_queue(struct gendisk *disk) + void blk_unregister_queue(struct gendisk *disk) +@@ -4205,6 +4240,7 @@ void blk_unregister_queue(struct gendisk *disk) struct request_queue *q = disk->queue; if (q && q->request_fn) { @@ -180,7 +114,7 @@ index 026cf24..3a3afd8 100644 elv_unregister_queue(q); kobject_uevent(&q->kobj, KOBJ_REMOVE); -@@ -4129,3 +4158,198 @@ void blk_unregister_queue(struct gendisk *disk) +@@ -4212,3 +4248,197 @@ void blk_unregister_queue(struct gendisk *disk) kobject_put(&disk->kobj); } } @@ -345,7 +279,7 @@ index 026cf24..3a3afd8 100644 + + /* check that the lower level driver has a protect handler */ + if (!q->issue_protect_fn) -+ return 1; ++ return 0; + + /* create the attributes */ + error = sysfs_create_file(&q->kobj, &queue_protect_entry.attr); @@ -354,10 +288,10 @@ index 026cf24..3a3afd8 100644 + "blk_protect_register(): failed to create protect queue attribute!\n"); + return error; + } -+ kobject_get(&q->kobj); + + error = sysfs_create_file(&q->kobj, &queue_protect_method_entry.attr); + if (error) { ++ sysfs_remove_file(&q->kobj, &queue_protect_entry.attr); + printk(KERN_ERR + "blk_protect_register(): failed to create protect_method attribute!\n"); + return error; @@ -375,15 +309,14 @@ index 026cf24..3a3afd8 100644 + + /* remove the attributes */ + sysfs_remove_file(&q->kobj, &queue_protect_method_entry.attr); -+ kobject_put(&q->kobj); + sysfs_remove_file(&q->kobj, &queue_protect_entry.attr); + kobject_put(&q->kobj); +} diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c -index e836476..c587bf1 100644 +index 14daf48..6b02998 100644 --- a/drivers/ata/libata-scsi.c +++ b/drivers/ata/libata-scsi.c -@@ -781,6 +781,38 @@ static void ata_scsi_dev_config(struct scsi_device *sdev, +@@ -856,6 +856,38 @@ static void ata_scsi_dev_config(struct scsi_device *sdev, } } @@ -422,7 +355,7 @@ index e836476..c587bf1 100644 /** * ata_scsi_slave_config - Set SCSI device attributes * @sdev: SCSI device to examine -@@ -806,6 +838,10 @@ int ata_scsi_slave_config(struct scsi_device *sdev) +@@ -877,6 +909,10 @@ int ata_scsi_slave_config(struct scsi_device *sdev) if (dev) ata_scsi_dev_config(sdev, dev); @@ -434,10 +367,10 @@ index e836476..c587bf1 100644 return 0; /* scsi layer doesn't check return value, sigh */ } diff --git a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c -index 4754769..938408d 100644 +index b178190..1ef536f 100644 --- a/drivers/ide/ide-disk.c +++ b/drivers/ide/ide-disk.c -@@ -743,6 +743,145 @@ static int idedisk_issue_flush(struct request_queue *q, struct gendisk *disk, +@@ -675,6 +675,145 @@ static void idedisk_prepare_flush(struct request_queue *q, struct request *rq) } /* @@ -583,7 +516,7 @@ index 4754769..938408d 100644 * This is tightly woven into the driver->do_special can not touch. * DON'T do it again until a total personality rewrite is committed. */ -@@ -1017,6 +1156,9 @@ static void idedisk_setup (ide_drive_t *drive) +@@ -943,6 +1082,9 @@ static void idedisk_setup (ide_drive_t *drive) drive->wcache = 1; write_cache(drive, 1); @@ -594,10 +527,10 @@ index 4754769..938408d 100644 static void ide_cacheflush_p(ide_drive_t *drive) diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c -index aa9f5f0..e664f5c 100644 +index bef781f..873764e 100644 --- a/drivers/ide/ide-io.c +++ b/drivers/ide/ide-io.c -@@ -1276,6 +1276,17 @@ static void ide_do_request (ide_hwgroup_t *hwgroup, int masked_irq) +@@ -1271,6 +1271,17 @@ static void ide_do_request (ide_hwgroup_t *hwgroup, int masked_irq) } /* @@ -615,7 +548,7 @@ index aa9f5f0..e664f5c 100644 * Sanity: don't accept a request that isn't a PM request * if we are currently power managed. This is very important as * blk_stop_queue() doesn't prevent the elv_next_request() -@@ -1773,6 +1784,9 @@ int ide_do_drive_cmd (ide_drive_t *drive, struct request *rq, ide_action_t actio +@@ -1768,6 +1779,9 @@ int ide_do_drive_cmd (ide_drive_t *drive, struct request *rq, ide_action_t actio where = ELEVATOR_INSERT_FRONT; rq->cmd_flags |= REQ_PREEMPT; } @@ -626,10 +559,10 @@ index aa9f5f0..e664f5c 100644 ide_do_request(hwgroup, IDE_NO_IRQ); spin_unlock_irqrestore(&ide_lock, flags); diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c -index a417a6f..ac5cd9c 100644 +index a9ac5b1..58049e7 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c -@@ -2024,7 +2024,13 @@ EXPORT_SYMBOL(scsi_device_set_state); +@@ -2268,7 +2268,13 @@ EXPORT_SYMBOL_GPL(sdev_evt_send_simple); int scsi_device_quiesce(struct scsi_device *sdev) { @@ -643,7 +576,7 @@ index a417a6f..ac5cd9c 100644 if (err) return err; -@@ -2273,3 +2279,166 @@ void scsi_kunmap_atomic_sg(void *virt) +@@ -2518,3 +2524,166 @@ void scsi_kunmap_atomic_sg(void *virt) kunmap_atomic(virt, KM_BIO_SRC_IRQ); } EXPORT_SYMBOL(scsi_kunmap_atomic_sg); @@ -811,23 +744,34 @@ index a417a6f..ac5cd9c 100644 +} +EXPORT_SYMBOL_GPL(scsi_protect_queue); diff --git a/include/linux/ata.h b/include/linux/ata.h -index c043c1c..618906f 100644 +index e672e80..aa16cbb 100644 --- a/include/linux/ata.h +++ b/include/linux/ata.h -@@ -344,6 +344,7 @@ struct ata_taskfile { - #define ata_id_rahead_enabled(id) ((id)[85] & (1 << 6)) - #define ata_id_wcache_enabled(id) ((id)[85] & (1 << 5)) - #define ata_id_hpa_enabled(id) ((id)[85] & (1 << 10)) -+#define ata_id_has_unload(id) ((id)[84] & (1 << 13)) - #define ata_id_has_fua(id) ((id)[84] & (1 << 6)) - #define ata_id_has_flush(id) ((id)[83] & (1 << 12)) - #define ata_id_has_flush_ext(id) ((id)[83] & (1 << 13)) +@@ -395,6 +395,18 @@ struct ata_taskfile { + + #define ata_id_cdb_intr(id) (((id)[0] & 0x60) == 0x20) + ++static inline int ata_id_has_unload(const u16 *id) ++{ ++ /* ATA-7 specifies two places to indicate unload feature support. ++ * Since I don't really understand the difference, I'll just check ++ * both and only return zero if none of them indicates otherwise. */ ++ if ((id[84] & 0xC000) == 0x4000 && id[84] & (1 << 13)) ++ return id[84] & (1 << 13); ++ if ((id[87] & 0xC000) == 0x4000) ++ return id[87] & (1 << 13); ++ return 0; ++} ++ + static inline bool ata_id_has_hipm(const u16 *id) + { + u16 val = id[76]; diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h -index d26bbb0..2fa892d 100644 +index d18ee67..e10f40b 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h -@@ -347,6 +347,8 @@ typedef int (merge_bvec_fn) (struct request_queue *, struct bio *, struct bio_ve - typedef int (issue_flush_fn) (struct request_queue *, struct gendisk *, sector_t *); +@@ -332,6 +332,8 @@ struct bio_vec; + typedef int (merge_bvec_fn) (struct request_queue *, struct bio *, struct bio_vec *); typedef void (prepare_flush_fn) (struct request_queue *, struct request *); typedef void (softirq_done_fn)(struct request *); +typedef int (issue_protect_fn) (struct request_queue *); @@ -835,8 +779,8 @@ index d26bbb0..2fa892d 100644 enum blk_queue_state { Queue_down, -@@ -384,6 +386,8 @@ struct request_queue - issue_flush_fn *issue_flush_fn; +@@ -368,6 +370,8 @@ struct request_queue + merge_bvec_fn *merge_bvec_fn; prepare_flush_fn *prepare_flush_fn; softirq_done_fn *softirq_done_fn; + issue_protect_fn *issue_protect_fn; @@ -844,7 +788,7 @@ index d26bbb0..2fa892d 100644 /* * Dispatch queue sorting -@@ -399,6 +403,14 @@ struct request_queue +@@ -383,6 +387,14 @@ struct request_queue unsigned long unplug_delay; /* After this many jiffies */ struct work_struct unplug_work; @@ -859,7 +803,7 @@ index d26bbb0..2fa892d 100644 struct backing_dev_info backing_dev_info; /* -@@ -774,6 +786,8 @@ extern int blk_do_ordered(struct request_queue *, struct request **); +@@ -773,6 +785,8 @@ extern int blk_do_ordered(struct request_queue *, struct request **); extern unsigned blk_ordered_cur_seq(struct request_queue *); extern unsigned blk_ordered_req_seq(struct request *); extern void blk_ordered_complete_seq(struct request_queue *, unsigned, int); @@ -869,10 +813,10 @@ index d26bbb0..2fa892d 100644 extern int blk_rq_map_sg(struct request_queue *, struct request *, struct scatterlist *); extern void blk_dump_rq_flags(struct request *, char *); diff --git a/include/linux/ide.h b/include/linux/ide.h -index 20528c0..ee846d5 100644 +index 9a6a41e..a8f12f5 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h -@@ -1110,6 +1110,7 @@ extern u64 ide_get_error_location(ide_drive_t *, char *); +@@ -1045,6 +1045,7 @@ extern void ide_init_drive_cmd (struct request *rq); */ typedef enum { ide_wait, /* insert rq at end of list, and wait for it */ diff --git a/sys-kernel/mactel-linux-sources/files/mactel-patches-r147/export-lookup_dev.patch b/sys-kernel/mactel-linux-sources/files/2.6.24-mactel-patches-r155/export-lookup_dev.patch index f6f2a0c..38e671a 100644 --- a/sys-kernel/mactel-linux-sources/files/mactel-patches-r147/export-lookup_dev.patch +++ b/sys-kernel/mactel-linux-sources/files/2.6.24-mactel-patches-r155/export-lookup_dev.patch @@ -8,11 +8,12 @@ From: Nicolas Boichat <nicolas@boichat.ch> fs/block_dev.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) + diff --git a/fs/block_dev.c b/fs/block_dev.c -index 2980eab..5a928ac 100644 +index 993f78c..3df9250 100644 --- a/fs/block_dev.c +++ b/fs/block_dev.c -@@ -1405,6 +1405,8 @@ fail: +@@ -1417,6 +1417,8 @@ fail: goto out; } diff --git a/sys-kernel/mactel-linux-sources/files/2.6.24-mactel-patches-r155/hid-add-new-apple-keyboard.patch b/sys-kernel/mactel-linux-sources/files/2.6.24-mactel-patches-r155/hid-add-new-apple-keyboard.patch new file mode 100644 index 0000000..e2fbf92 --- /dev/null +++ b/sys-kernel/mactel-linux-sources/files/2.6.24-mactel-patches-r155/hid-add-new-apple-keyboard.patch @@ -0,0 +1,182 @@ + + +From: Nicolas Boichat <nicolas@boichat.ch> + + +--- + + drivers/hid/hid-input.c | 48 +++++++++++++++++++++++++++++++++--- + drivers/hid/usbhid/hid-quirks.c | 52 +++++++++++++++++++++++++++++++++++++++ + include/linux/hid.h | 1 + + 3 files changed, 97 insertions(+), 4 deletions(-) + + +diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c +index 0b27da7..a39de6c 100644 +--- a/drivers/hid/hid-input.c ++++ b/drivers/hid/hid-input.c +@@ -119,6 +119,30 @@ static struct hidinput_key_translation powerbook_fn_keys[] = { + { } + }; + ++static struct hidinput_key_translation apple_keyboard_fn_keys[] = { ++ { KEY_BACKSPACE, KEY_DELETE }, ++ { KEY_F1, KEY_BRIGHTNESSDOWN, POWERBOOK_FLAG_FKEY }, ++ { KEY_F2, KEY_BRIGHTNESSUP, POWERBOOK_FLAG_FKEY }, ++ { KEY_F3, KEY_CYCLEWINDOWS, POWERBOOK_FLAG_FKEY }, ++ { KEY_F4, KEY_CONFIG, POWERBOOK_FLAG_FKEY }, ++ { KEY_F7, KEY_PREVIOUSSONG, POWERBOOK_FLAG_FKEY }, ++ { KEY_F8, KEY_PLAYPAUSE, POWERBOOK_FLAG_FKEY }, ++ { KEY_F9, KEY_NEXTSONG, POWERBOOK_FLAG_FKEY }, ++ { KEY_F10, KEY_MUTE, POWERBOOK_FLAG_FKEY }, ++ { KEY_F11, KEY_VOLUMEDOWN, POWERBOOK_FLAG_FKEY }, ++ { KEY_F12, KEY_VOLUMEUP, POWERBOOK_FLAG_FKEY }, ++ { KEY_UP, KEY_PAGEUP }, ++ { KEY_DOWN, KEY_PAGEDOWN }, ++ { KEY_LEFT, KEY_HOME }, ++ { KEY_RIGHT, KEY_END }, ++ { } ++}; ++ ++static struct hidinput_key_translation apple_keyboard[] = { ++ { KEY_VOLUMEUP, KEY_EJECTCD }, ++ { } ++}; ++ + static struct hidinput_key_translation powerbook_numlock_keys[] = { + { KEY_J, KEY_KP1 }, + { KEY_K, KEY_KP2 }, +@@ -176,8 +200,10 @@ static int hidinput_pb_event(struct hid_device *hid, struct input_dev *input, + + if (hid_pb_fnmode) { + int do_translate; +- +- trans = find_translation(powerbook_fn_keys, usage->code); ++ if (hid->quirks & HID_QUIRK_APPLE_KEYBOARD) ++ trans = find_translation(apple_keyboard_fn_keys, usage->code); ++ else ++ trans = find_translation(powerbook_fn_keys, usage->code); + if (trans) { + if (test_bit(usage->code, hid->pb_pressed_fn)) + do_translate = 1; +@@ -200,8 +226,8 @@ static int hidinput_pb_event(struct hid_device *hid, struct input_dev *input, + } + } + +- if (test_bit(usage->code, hid->pb_pressed_numlock) || +- test_bit(LED_NUML, input->led)) { ++ if (!(hid->quirks & HID_QUIRK_APPLE_KEYBOARD) && (test_bit(usage->code, hid->pb_pressed_numlock) || ++ test_bit(LED_NUML, input->led))) { + trans = find_translation(powerbook_numlock_keys, usage->code); + + if (trans) { +@@ -217,6 +243,14 @@ static int hidinput_pb_event(struct hid_device *hid, struct input_dev *input, + } + } + ++ if (hid->quirks & HID_QUIRK_APPLE_KEYBOARD) { ++ trans = find_translation(apple_keyboard, usage->code); ++ if (trans) { ++ input_event(input, usage->type, trans->to, value); ++ return 1; ++ } ++ } ++ + if (hid->quirks & HID_QUIRK_POWERBOOK_ISO_KEYBOARD) { + trans = find_translation(powerbook_iso_keyboard, usage->code); + if (trans) { +@@ -241,6 +275,12 @@ static void hidinput_pb_setup(struct input_dev *input) + for (trans = powerbook_numlock_keys; trans->from; trans++) + set_bit(trans->to, input->keybit); + ++ for (trans = apple_keyboard_fn_keys; trans->from; trans++) ++ set_bit(trans->to, input->keybit); ++ ++ for (trans = apple_keyboard; trans->from; trans++) ++ set_bit(trans->to, input->keybit); ++ + for (trans = powerbook_iso_keyboard; trans->from; trans++) + set_bit(trans->to, input->keybit); + +diff --git a/drivers/hid/usbhid/hid-quirks.c b/drivers/hid/usbhid/hid-quirks.c +index a255285..8d21c83 100644 +--- a/drivers/hid/usbhid/hid-quirks.c ++++ b/drivers/hid/usbhid/hid-quirks.c +@@ -59,6 +59,32 @@ + #define USB_DEVICE_ID_APPLE_GEYSER4_ANSI 0x021a + #define USB_DEVICE_ID_APPLE_GEYSER4_ISO 0x021b + #define USB_DEVICE_ID_APPLE_GEYSER4_JIS 0x021c ++ ++/* Apple 2007 Wired keyboards */ ++#define USB_DEVICE_ID_APPLE_KEYBOARD_ANSI 0x0220 ++#define USB_DEVICE_ID_APPLE_KEYBOARD_ISO 0x0221 ++#define USB_DEVICE_ID_APPLE_KEYBOARD_JIS 0x0222 ++ ++/* macbook3,1 keyboards */ ++#define USB_DEVICE_ID_APPLE_GEYSER4_HF_ANSI 0x0229 ++#define USB_DEVICE_ID_APPLE_GEYSER4_HF_ISO 0x022a ++#define USB_DEVICE_ID_APPLE_GEYSER4_HF_JIS 0x022b ++ ++/* Apple WellSpring keyboard + trackpad */ ++#define USB_PRODUCT_ID_WELLSPRING_ANSI 0x0223 ++#define USB_PRODUCT_ID_WELLSPRING_ISO 0x0224 ++#define USB_PRODUCT_ID_WELLSPRING_JIS 0x0225 ++ ++/* Apple WellSpring II keyboard + trackpad */ ++#define USB_PRODUCT_ID_WELLSPRING2_ANSI 0x0230 ++#define USB_PRODUCT_ID_WELLSPRING2_ISO 0x0231 ++#define USB_PRODUCT_ID_WELLSPRING2_JIS 0x0232 ++ ++/* Apple 2007 Wireless keyboards */ ++#define USB_DEVICE_ID_APPLE_WIRELESS_KEYBOARD_ANSI 0x022c ++#define USB_DEVICE_ID_APPLE_WIRELESS_KEYBOARD_ISO 0x022d ++#define USB_DEVICE_ID_APPLE_WIRELESS_KEYBOARD_JIS 0x022e ++ + #define USB_DEVICE_ID_APPLE_FOUNTAIN_TP_ONLY 0x030a + #define USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY 0x030b + #define USB_DEVICE_ID_APPLE_IRCONTROL4 0x8242 +@@ -551,6 +577,32 @@ static const struct hid_blacklist { + { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_ANSI, HID_QUIRK_POWERBOOK_HAS_FN | HID_QUIRK_IGNORE_MOUSE }, + { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_ISO, HID_QUIRK_POWERBOOK_HAS_FN | HID_QUIRK_IGNORE_MOUSE | HID_QUIRK_POWERBOOK_ISO_KEYBOARD}, + { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_JIS, HID_QUIRK_POWERBOOK_HAS_FN | HID_QUIRK_IGNORE_MOUSE }, ++ ++ /* Apple 2007 Wired keyboards */ ++ { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_KEYBOARD_ANSI, HID_QUIRK_POWERBOOK_HAS_FN | HID_QUIRK_IGNORE_MOUSE | HID_QUIRK_APPLE_KEYBOARD}, ++ { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_KEYBOARD_ISO, HID_QUIRK_POWERBOOK_HAS_FN | HID_QUIRK_IGNORE_MOUSE | HID_QUIRK_APPLE_KEYBOARD | HID_QUIRK_POWERBOOK_ISO_KEYBOARD}, ++ { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_KEYBOARD_JIS, HID_QUIRK_POWERBOOK_HAS_FN | HID_QUIRK_IGNORE_MOUSE | HID_QUIRK_APPLE_KEYBOARD}, ++ ++ /* macbook3,1 keyboards */ ++ { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_HF_ANSI, HID_QUIRK_POWERBOOK_HAS_FN | HID_QUIRK_IGNORE_MOUSE | HID_QUIRK_APPLE_KEYBOARD}, ++ { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_HF_ISO, HID_QUIRK_POWERBOOK_HAS_FN | HID_QUIRK_IGNORE_MOUSE | HID_QUIRK_APPLE_KEYBOARD | HID_QUIRK_POWERBOOK_ISO_KEYBOARD}, ++ { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_HF_JIS, HID_QUIRK_POWERBOOK_HAS_FN | HID_QUIRK_IGNORE_MOUSE | HID_QUIRK_APPLE_KEYBOARD}, ++ ++ /* Apple 2007 Wireless keyboards */ ++ { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WIRELESS_KEYBOARD_ANSI, HID_QUIRK_POWERBOOK_HAS_FN | HID_QUIRK_IGNORE_MOUSE | HID_QUIRK_APPLE_KEYBOARD}, ++ { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WIRELESS_KEYBOARD_ISO, HID_QUIRK_POWERBOOK_HAS_FN | HID_QUIRK_IGNORE_MOUSE | HID_QUIRK_APPLE_KEYBOARD | HID_QUIRK_POWERBOOK_ISO_KEYBOARD}, ++ { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WIRELESS_KEYBOARD_JIS, HID_QUIRK_POWERBOOK_HAS_FN | HID_QUIRK_IGNORE_MOUSE | HID_QUIRK_APPLE_KEYBOARD}, ++ ++ /* Apple WellSpring keyboard + trackpad */ ++ { USB_VENDOR_ID_APPLE, USB_PRODUCT_ID_WELLSPRING_ANSI, HID_QUIRK_POWERBOOK_HAS_FN | HID_QUIRK_APPLE_KEYBOARD}, ++ { USB_VENDOR_ID_APPLE, USB_PRODUCT_ID_WELLSPRING_ISO, HID_QUIRK_POWERBOOK_HAS_FN | HID_QUIRK_APPLE_KEYBOARD | HID_QUIRK_POWERBOOK_ISO_KEYBOARD}, ++ { USB_VENDOR_ID_APPLE, USB_PRODUCT_ID_WELLSPRING_JIS, HID_QUIRK_POWERBOOK_HAS_FN | HID_QUIRK_APPLE_KEYBOARD}, ++ ++ /* Apple WellSpring II keyboard + trackpad */ ++ { USB_VENDOR_ID_APPLE, USB_PRODUCT_ID_WELLSPRING2_ANSI, HID_QUIRK_POWERBOOK_HAS_FN | HID_QUIRK_APPLE_KEYBOARD}, ++ { USB_VENDOR_ID_APPLE, USB_PRODUCT_ID_WELLSPRING2_ISO, HID_QUIRK_POWERBOOK_HAS_FN | HID_QUIRK_APPLE_KEYBOARD | HID_QUIRK_POWERBOOK_ISO_KEYBOARD}, ++ { USB_VENDOR_ID_APPLE, USB_PRODUCT_ID_WELLSPRING2_JIS, HID_QUIRK_POWERBOOK_HAS_FN | HID_QUIRK_APPLE_KEYBOARD}, ++ + { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_FOUNTAIN_TP_ONLY, HID_QUIRK_POWERBOOK_HAS_FN | HID_QUIRK_IGNORE_MOUSE }, + { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY, HID_QUIRK_POWERBOOK_HAS_FN | HID_QUIRK_IGNORE_MOUSE }, + +diff --git a/include/linux/hid.h b/include/linux/hid.h +index 6e35b92..04b26b5 100644 +--- a/include/linux/hid.h ++++ b/include/linux/hid.h +@@ -281,6 +281,7 @@ struct hid_item { + #define HID_QUIRK_LOGITECH_IGNORE_DOUBLED_WHEEL 0x00400000 + #define HID_QUIRK_LOGITECH_EXPANDED_KEYMAP 0x00800000 + #define HID_QUIRK_IGNORE_HIDINPUT 0x01000000 ++#define HID_QUIRK_APPLE_KEYBOARD 0x02000000 + + /* + * Separate quirks for runtime report descriptor fixup diff --git a/sys-kernel/mactel-linux-sources/files/mactel-patches-r147/sigmatel_audio_display_all_controls_when_subsystem_id_is_wrong.patch b/sys-kernel/mactel-linux-sources/files/2.6.24-mactel-patches-r155/sigmatel_audio_display_all_controls_when_subsystem_id_is_wrong.patch index d484af8..235146d 100644 --- a/sys-kernel/mactel-linux-sources/files/mactel-patches-r147/sigmatel_audio_display_all_controls_when_subsystem_id_is_wrong.patch +++ b/sys-kernel/mactel-linux-sources/files/2.6.24-mactel-patches-r155/sigmatel_audio_display_all_controls_when_subsystem_id_is_wrong.patch @@ -8,11 +8,12 @@ From: Nicolas Boichat <nicolas@boichat.ch> sound/pci/hda/patch_sigmatel.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) + diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c -index d46e7e4..78c5b45 100644 +index 0401223..c0e626b 100644 --- a/sound/pci/hda/patch_sigmatel.c +++ b/sound/pci/hda/patch_sigmatel.c -@@ -2132,10 +2132,12 @@ static int patch_stac922x(struct hda_codec *codec) +@@ -2587,10 +2587,12 @@ static int patch_stac922x(struct hda_codec *codec) case 0x106b1700: case 0x106b0200: case 0x106b1e00: diff --git a/sys-kernel/mactel-linux-sources/files/mactel-patches-r147/sigmatel_audio_fix_macbook_v2.patch b/sys-kernel/mactel-linux-sources/files/2.6.24-mactel-patches-r155/sigmatel_audio_fix_macbook_v2.patch index e7a7783..e35465b 100644 --- a/sys-kernel/mactel-linux-sources/files/mactel-patches-r147/sigmatel_audio_fix_macbook_v2.patch +++ b/sys-kernel/mactel-linux-sources/files/2.6.24-mactel-patches-r155/sigmatel_audio_fix_macbook_v2.patch @@ -8,20 +8,21 @@ From: Marek Sterzik <marek@milimetr.org> sound/pci/hda/patch_sigmatel.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) + diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c -index 78c5b45..d747b19 100644 +index c0e626b..e7995f6 100644 --- a/sound/pci/hda/patch_sigmatel.c +++ b/sound/pci/hda/patch_sigmatel.c -@@ -69,6 +69,7 @@ enum { - /* for backward compitability */ +@@ -81,6 +81,7 @@ enum { + /* for backward compatibility */ STAC_MACMINI, STAC_MACBOOK, + STAC_MACBOOK_V2, STAC_MACBOOK_PRO_V1, STAC_MACBOOK_PRO_V2, STAC_IMAC_INTEL, -@@ -625,6 +626,7 @@ static const char *stac922x_models[STAC_922X_MODELS] = { - /* for backward compitability */ +@@ -905,6 +906,7 @@ static const char *stac922x_models[STAC_922X_MODELS] = { + /* for backward compatibility */ [STAC_MACMINI] = "macmini", [STAC_MACBOOK] = "macbook", + [STAC_MACBOOK_V2] = "macbook-v2", diff --git a/sys-kernel/mactel-linux-sources/files/mactel-patches-r147/applesmc-for-mac-pro-2-x-quad-core.patch b/sys-kernel/mactel-linux-sources/files/mactel-patches-r147/applesmc-for-mac-pro-2-x-quad-core.patch deleted file mode 100644 index 18ad843..0000000 --- a/sys-kernel/mactel-linux-sources/files/mactel-patches-r147/applesmc-for-mac-pro-2-x-quad-core.patch +++ /dev/null @@ -1,202 +0,0 @@ -At least the 2x Quad-Core Apple Mac Pro appears to have some over-heat - -From: Nicolas Boichat <nicolas@boichat.ch> - -protection which suddenly powers off the whole box under load. This adds -support for the fans and temerature sensors in the Mac Pro - later some -"windwarm" a-like code should probably monitor the values. For now -manually tweaking the fans prevents the sudden shutdown for me. - -cd /sys/devices/platform/applesmc.768 -for x in fan{1,2,3,4}; do - echo 1 > ${x}_manual - echo 1285 > ${x}_output -done - -Two sensors are 0, while four are 129 °C, those might be removed again, -later. - -Signed-off-by: René Rebe <rene@exactcode.de -Cc: Mark M. Hoffman <mhoffman@lightlink.com> -Cc: Nicolas Boichat <nicolas@boichat.ch> -Cc: Jean Delvare <khali@linux-fr.org> -Signed-off-by: Andrew Morton <akpm@linux-foundation.org> ---- - - drivers/hwmon/applesmc.c | 107 +++++++++++++++++++++++++++++++++++++++++++--- - 1 files changed, 101 insertions(+), 6 deletions(-) - -diff --git a/drivers/hwmon/applesmc.c b/drivers/hwmon/applesmc.c -index cea8d78..4b90444 100644 ---- a/drivers/hwmon/applesmc.c -+++ b/drivers/hwmon/applesmc.c -@@ -80,7 +80,7 @@ - /* - * Temperature sensors keys (sp78 - 2 bytes). - */ --static const char* temperature_sensors_sets[][13] = { -+static const char* temperature_sensors_sets[][36] = { - /* Set 0: Macbook Pro */ - { "TA0P", "TB0T", "TC0D", "TC0P", "TG0H", "TG0P", "TG0T", "Th0H", - "Th1H", "Tm0P", "Ts0P", "Ts1P", NULL }, -@@ -88,7 +88,13 @@ static const char* temperature_sensors_sets[][13] = { - { "TB0T", "TC0D", "TC0P", "TM0P", "TN0P", "TN1P", "Th0H", "Th0S", - "Th1H", "Ts0P", NULL }, - /* Set 2: Macmini set */ -- { "TC0D", "TC0P", NULL } -+ { "TC0D", "TC0P", NULL }, -+/* Set 3: Mac Pro (2 x Quad-Core) */ -+ { "TA0P", "TCAG", "TCAH", "TCBG", "TCBH", "TC0C", "TC0D", "TC0P", -+ "TC1C", "TC1D", "TC2C", "TC2D", "TC3C", "TC3D", "THTG", "TH0P", -+ "TH1P", "TH2P", "TH3P", "TMAP", "TMAS", "TMBS", "TM0P", "TM0S", -+ "TM1P", "TM1S", "TM2P", "TM2S", "TM3S", "TM8P", "TM8S", "TM9P", -+ "TM9S", "TN0H", "TS0C", NULL }, - }; - - /* List of keys used to read/write fan speeds */ -@@ -990,14 +996,18 @@ static struct attribute *fan##offset##_attributes[] = { \ - - /* - * Create the needed functions for each fan using the macro defined above -- * (2 fans are supported) -+ * (4 fans are supported) - */ - sysfs_fan_speeds_offset(1); - sysfs_fan_speeds_offset(2); -+sysfs_fan_speeds_offset(3); -+sysfs_fan_speeds_offset(4); - - static const struct attribute_group fan_attribute_groups[] = { - { .attrs = fan1_attributes }, -- { .attrs = fan2_attributes } -+ { .attrs = fan2_attributes }, -+ { .attrs = fan3_attributes }, -+ { .attrs = fan4_attributes } - }; - - /* -@@ -1027,6 +1037,52 @@ static SENSOR_DEVICE_ATTR(temp11_input, S_IRUGO, - applesmc_show_temperature, NULL, 10); - static SENSOR_DEVICE_ATTR(temp12_input, S_IRUGO, - applesmc_show_temperature, NULL, 11); -+static SENSOR_DEVICE_ATTR(temp13_input, S_IRUGO, -+ applesmc_show_temperature, NULL, 12); -+static SENSOR_DEVICE_ATTR(temp14_input, S_IRUGO, -+ applesmc_show_temperature, NULL, 13); -+static SENSOR_DEVICE_ATTR(temp15_input, S_IRUGO, -+ applesmc_show_temperature, NULL, 14); -+static SENSOR_DEVICE_ATTR(temp16_input, S_IRUGO, -+ applesmc_show_temperature, NULL, 15); -+static SENSOR_DEVICE_ATTR(temp17_input, S_IRUGO, -+ applesmc_show_temperature, NULL, 16); -+static SENSOR_DEVICE_ATTR(temp18_input, S_IRUGO, -+ applesmc_show_temperature, NULL, 17); -+static SENSOR_DEVICE_ATTR(temp19_input, S_IRUGO, -+ applesmc_show_temperature, NULL, 18); -+static SENSOR_DEVICE_ATTR(temp20_input, S_IRUGO, -+ applesmc_show_temperature, NULL, 19); -+static SENSOR_DEVICE_ATTR(temp21_input, S_IRUGO, -+ applesmc_show_temperature, NULL, 20); -+static SENSOR_DEVICE_ATTR(temp22_input, S_IRUGO, -+ applesmc_show_temperature, NULL, 21); -+static SENSOR_DEVICE_ATTR(temp23_input, S_IRUGO, -+ applesmc_show_temperature, NULL, 22); -+static SENSOR_DEVICE_ATTR(temp24_input, S_IRUGO, -+ applesmc_show_temperature, NULL, 23); -+static SENSOR_DEVICE_ATTR(temp25_input, S_IRUGO, -+ applesmc_show_temperature, NULL, 24); -+static SENSOR_DEVICE_ATTR(temp26_input, S_IRUGO, -+ applesmc_show_temperature, NULL, 25); -+static SENSOR_DEVICE_ATTR(temp27_input, S_IRUGO, -+ applesmc_show_temperature, NULL, 26); -+static SENSOR_DEVICE_ATTR(temp28_input, S_IRUGO, -+ applesmc_show_temperature, NULL, 27); -+static SENSOR_DEVICE_ATTR(temp29_input, S_IRUGO, -+ applesmc_show_temperature, NULL, 28); -+static SENSOR_DEVICE_ATTR(temp30_input, S_IRUGO, -+ applesmc_show_temperature, NULL, 29); -+static SENSOR_DEVICE_ATTR(temp31_input, S_IRUGO, -+ applesmc_show_temperature, NULL, 30); -+static SENSOR_DEVICE_ATTR(temp32_input, S_IRUGO, -+ applesmc_show_temperature, NULL, 31); -+static SENSOR_DEVICE_ATTR(temp33_input, S_IRUGO, -+ applesmc_show_temperature, NULL, 32); -+static SENSOR_DEVICE_ATTR(temp34_input, S_IRUGO, -+ applesmc_show_temperature, NULL, 33); -+static SENSOR_DEVICE_ATTR(temp35_input, S_IRUGO, -+ applesmc_show_temperature, NULL, 34); - - static struct attribute *temperature_attributes[] = { - &sensor_dev_attr_temp1_input.dev_attr.attr, -@@ -1041,6 +1097,29 @@ static struct attribute *temperature_attributes[] = { - &sensor_dev_attr_temp10_input.dev_attr.attr, - &sensor_dev_attr_temp11_input.dev_attr.attr, - &sensor_dev_attr_temp12_input.dev_attr.attr, -+ &sensor_dev_attr_temp13_input.dev_attr.attr, -+ &sensor_dev_attr_temp14_input.dev_attr.attr, -+ &sensor_dev_attr_temp15_input.dev_attr.attr, -+ &sensor_dev_attr_temp16_input.dev_attr.attr, -+ &sensor_dev_attr_temp17_input.dev_attr.attr, -+ &sensor_dev_attr_temp18_input.dev_attr.attr, -+ &sensor_dev_attr_temp19_input.dev_attr.attr, -+ &sensor_dev_attr_temp20_input.dev_attr.attr, -+ &sensor_dev_attr_temp21_input.dev_attr.attr, -+ &sensor_dev_attr_temp22_input.dev_attr.attr, -+ &sensor_dev_attr_temp23_input.dev_attr.attr, -+ &sensor_dev_attr_temp24_input.dev_attr.attr, -+ &sensor_dev_attr_temp25_input.dev_attr.attr, -+ &sensor_dev_attr_temp26_input.dev_attr.attr, -+ &sensor_dev_attr_temp27_input.dev_attr.attr, -+ &sensor_dev_attr_temp28_input.dev_attr.attr, -+ &sensor_dev_attr_temp29_input.dev_attr.attr, -+ &sensor_dev_attr_temp30_input.dev_attr.attr, -+ &sensor_dev_attr_temp31_input.dev_attr.attr, -+ &sensor_dev_attr_temp32_input.dev_attr.attr, -+ &sensor_dev_attr_temp33_input.dev_attr.attr, -+ &sensor_dev_attr_temp34_input.dev_attr.attr, -+ &sensor_dev_attr_temp35_input.dev_attr.attr, - NULL - }; - -@@ -1137,6 +1216,8 @@ static __initdata struct dmi_match_data applesmc_dmi_data[] = { - { .accelerometer = 1, .light = 0, .temperature_set = 1 }, - /* MacMini: temperature set 2 */ - { .accelerometer = 0, .light = 0, .temperature_set = 2 }, -+/* MacPro: temperature set 3 */ -+ { .accelerometer = 0, .light = 0, .temperature_set = 3 }, - }; - - /* Note that DMI_MATCH(...,"MacBook") will match "MacBookPro1,1". -@@ -1154,6 +1235,10 @@ static __initdata struct dmi_system_id applesmc_whitelist[] = { - DMI_MATCH(DMI_BOARD_VENDOR,"Apple"), - DMI_MATCH(DMI_PRODUCT_NAME,"Macmini") }, - (void*)&applesmc_dmi_data[2]}, -+ { applesmc_dmi_match, "Apple MacPro2", { -+ DMI_MATCH(DMI_BOARD_VENDOR,"Apple"), -+ DMI_MATCH(DMI_PRODUCT_NAME,"MacPro2") }, -+ (void*)&applesmc_dmi_data[3]}, - { .ident = NULL } - }; - -@@ -1204,9 +1289,19 @@ static int __init applesmc_init(void) - - switch (count) { - default: -- printk(KERN_WARNING "applesmc: More than 2 fans found," -- " but at most 2 fans are supported" -+ printk(KERN_WARNING "applesmc: More than 4 fans found," -+ " but at most 4 fans are supported" - " by the driver.\n"); -+ case 4: -+ ret = sysfs_create_group(&pdev->dev.kobj, -+ &fan_attribute_groups[3]); -+ if (ret) -+ goto out_key_enumeration; -+ case 3: -+ ret = sysfs_create_group(&pdev->dev.kobj, -+ &fan_attribute_groups[2]); -+ if (ret) -+ goto out_key_enumeration; - case 2: - ret = sysfs_create_group(&pdev->dev.kobj, - &fan_attribute_groups[1]); diff --git a/sys-kernel/mactel-linux-sources/files/mactel-patches-r147/applesmc-use-input-polldev.patch b/sys-kernel/mactel-linux-sources/files/mactel-patches-r147/applesmc-use-input-polldev.patch deleted file mode 100644 index 06a9998..0000000 --- a/sys-kernel/mactel-linux-sources/files/mactel-patches-r147/applesmc-use-input-polldev.patch +++ /dev/null @@ -1,221 +0,0 @@ -HWMON: applesmc - convert to use input-polldev. - -From: Nicolas Boichat <nicolas@boichat.ch> - -Switch to using input-polldev skeleton instead of implementing -polling loop by itself. This also fixes problem with trylock -on a mutex in atomic context. - -Signed-off-by: Dmitry Torokhov <dtor@mail.ru> ---- - - drivers/hwmon/Kconfig | 1 + - drivers/hwmon/applesmc.c | 83 +++++++++++++++++----------------------------- - 2 files changed, 31 insertions(+), 53 deletions(-) - -diff --git a/drivers/hwmon/Kconfig b/drivers/hwmon/Kconfig -index 192953b..e74a89d 100644 ---- a/drivers/hwmon/Kconfig -+++ b/drivers/hwmon/Kconfig -@@ -665,6 +665,7 @@ config SENSORS_APPLESMC - depends on INPUT && X86 - select NEW_LEDS - select LEDS_CLASS -+ select INPUT_POLLDEV - default n - help - This driver provides support for the Apple System Management -diff --git a/drivers/hwmon/applesmc.c b/drivers/hwmon/applesmc.c -index 941729a..cea8d78 100644 ---- a/drivers/hwmon/applesmc.c -+++ b/drivers/hwmon/applesmc.c -@@ -28,7 +28,7 @@ - - #include <linux/delay.h> - #include <linux/platform_device.h> --#include <linux/input.h> -+#include <linux/input-polldev.h> - #include <linux/kernel.h> - #include <linux/module.h> - #include <linux/timer.h> -@@ -59,9 +59,9 @@ - - #define LIGHT_SENSOR_LEFT_KEY "ALV0" /* r-o {alv (6 bytes) */ - #define LIGHT_SENSOR_RIGHT_KEY "ALV1" /* r-o {alv (6 bytes) */ --#define BACKLIGHT_KEY "LKSB" /* w-o {lkb (2 bytes) */ -+#define BACKLIGHT_KEY "LKSB" /* w-o {lkb (2 bytes) */ - --#define CLAMSHELL_KEY "MSLD" /* r-o ui8 (unused) */ -+#define CLAMSHELL_KEY "MSLD" /* r-o ui8 (unused) */ - - #define MOTION_SENSOR_X_KEY "MO_X" /* r-o sp78 (2 bytes) */ - #define MOTION_SENSOR_Y_KEY "MO_Y" /* r-o sp78 (2 bytes) */ -@@ -103,7 +103,7 @@ static const char* fan_speed_keys[] = { - #define INIT_TIMEOUT_MSECS 5000 /* wait up to 5s for device init ... */ - #define INIT_WAIT_MSECS 50 /* ... in 50ms increments */ - --#define APPLESMC_POLL_PERIOD (HZ/20) /* poll for input every 1/20s */ -+#define APPLESMC_POLL_INTERVAL 50 /* msecs */ - #define APPLESMC_INPUT_FUZZ 4 /* input event threshold */ - #define APPLESMC_INPUT_FLAT 4 - -@@ -125,8 +125,7 @@ static const int debug; - static struct platform_device *pdev; - static s16 rest_x; - static s16 rest_y; --static struct timer_list applesmc_timer; --static struct input_dev *applesmc_idev; -+static struct input_polled_dev *applesmc_idev; - static struct class_device *hwmon_class_dev; - - /* Indicates whether this computer has an accelerometer. */ -@@ -138,7 +137,7 @@ static unsigned int applesmc_light; - /* Indicates which temperature sensors set to use. */ - static unsigned int applesmc_temperature_set; - --static struct mutex applesmc_lock; -+static DEFINE_MUTEX(applesmc_lock); - - /* - * Last index written to key_at_index sysfs file, and value to use for all other -@@ -455,27 +454,12 @@ static void applesmc_calibrate(void) - rest_x = -rest_x; - } - --static int applesmc_idev_open(struct input_dev *dev) --{ -- add_timer(&applesmc_timer); -- -- return 0; --} -- --static void applesmc_idev_close(struct input_dev *dev) --{ -- del_timer_sync(&applesmc_timer); --} -- --static void applesmc_idev_poll(unsigned long unused) -+static void applesmc_idev_poll(struct input_polled_dev *dev) - { -+ struct input_dev *idev = dev->input; - s16 x, y; - -- /* Cannot sleep. Try nonblockingly. If we fail, try again later. */ -- if (!mutex_trylock(&applesmc_lock)) { -- mod_timer(&applesmc_timer, jiffies + APPLESMC_POLL_PERIOD); -- return; -- } -+ mutex_lock(&applesmc_lock); - - if (applesmc_read_motion_sensor(SENSOR_X, &x)) - goto out; -@@ -483,13 +467,11 @@ static void applesmc_idev_poll(unsigned long unused) - goto out; - - x = -x; -- input_report_abs(applesmc_idev, ABS_X, x - rest_x); -- input_report_abs(applesmc_idev, ABS_Y, y - rest_y); -- input_sync(applesmc_idev); -+ input_report_abs(idev, ABS_X, x - rest_x); -+ input_report_abs(idev, ABS_Y, y - rest_y); -+ input_sync(idev); - - out: -- mod_timer(&applesmc_timer, jiffies + APPLESMC_POLL_PERIOD); -- - mutex_unlock(&applesmc_lock); - } - -@@ -821,8 +803,7 @@ static ssize_t applesmc_key_at_index_read_show(struct device *dev, - - if (!ret) { - return info[0]; -- } -- else { -+ } else { - return ret; - } - } -@@ -1093,6 +1074,7 @@ static int applesmc_dmi_match(struct dmi_system_id *id) - /* Create accelerometer ressources */ - static int applesmc_create_accelerometer(void) - { -+ struct input_dev *idev; - int ret; - - ret = sysfs_create_group(&pdev->dev.kobj, -@@ -1100,40 +1082,37 @@ static int applesmc_create_accelerometer(void) - if (ret) - goto out; - -- applesmc_idev = input_allocate_device(); -+ applesmc_idev = input_allocate_polled_device(); - if (!applesmc_idev) { - ret = -ENOMEM; - goto out_sysfs; - } - -+ applesmc_idev->poll = applesmc_idev_poll; -+ applesmc_idev->poll_interval = APPLESMC_POLL_INTERVAL; -+ - /* initial calibrate for the input device */ - applesmc_calibrate(); - -- /* initialize the input class */ -- applesmc_idev->name = "applesmc"; -- applesmc_idev->id.bustype = BUS_HOST; -- applesmc_idev->dev.parent = &pdev->dev; -- applesmc_idev->evbit[0] = BIT(EV_ABS); -- applesmc_idev->open = applesmc_idev_open; -- applesmc_idev->close = applesmc_idev_close; -- input_set_abs_params(applesmc_idev, ABS_X, -+ /* initialize the input device */ -+ idev = applesmc_idev->input; -+ idev->name = "applesmc"; -+ idev->id.bustype = BUS_HOST; -+ idev->dev.parent = &pdev->dev; -+ idev->evbit[0] = BIT(EV_ABS); -+ input_set_abs_params(idev, ABS_X, - -256, 256, APPLESMC_INPUT_FUZZ, APPLESMC_INPUT_FLAT); -- input_set_abs_params(applesmc_idev, ABS_Y, -+ input_set_abs_params(idev, ABS_Y, - -256, 256, APPLESMC_INPUT_FUZZ, APPLESMC_INPUT_FLAT); - -- ret = input_register_device(applesmc_idev); -+ ret = input_register_polled_device(applesmc_idev); - if (ret) - goto out_idev; - -- /* start up our timer for the input device */ -- init_timer(&applesmc_timer); -- applesmc_timer.function = applesmc_idev_poll; -- applesmc_timer.expires = jiffies + APPLESMC_POLL_PERIOD; -- - return 0; - - out_idev: -- input_free_device(applesmc_idev); -+ input_free_polled_device(applesmc_idev); - - out_sysfs: - sysfs_remove_group(&pdev->dev.kobj, &accelerometer_attributes_group); -@@ -1146,8 +1125,8 @@ out: - /* Release all ressources used by the accelerometer */ - static void applesmc_release_accelerometer(void) - { -- del_timer_sync(&applesmc_timer); -- input_unregister_device(applesmc_idev); -+ input_unregister_polled_device(applesmc_idev); -+ input_free_polled_device(applesmc_idev); - sysfs_remove_group(&pdev->dev.kobj, &accelerometer_attributes_group); - } - -@@ -1184,8 +1163,6 @@ static int __init applesmc_init(void) - int count; - int i; - -- mutex_init(&applesmc_lock); -- - if (!dmi_check_system(applesmc_whitelist)) { - printk(KERN_WARNING "applesmc: supported laptop not found!\n"); - ret = -ENODEV; diff --git a/sys-kernel/mactel-linux-sources/files/mactel-patches-r147/appletouch-add-macbook3-trackpad.patch b/sys-kernel/mactel-linux-sources/files/mactel-patches-r147/appletouch-add-macbook3-trackpad.patch deleted file mode 100644 index d397802..0000000 --- a/sys-kernel/mactel-linux-sources/files/mactel-patches-r147/appletouch-add-macbook3-trackpad.patch +++ /dev/null @@ -1,50 +0,0 @@ -Added IDs for macbook3,1 trackpad - -From: Chris Irwin <chris@chrisirwin.ca> - - ---- - - drivers/input/mouse/appletouch.c | 15 ++++++++++++++- - 1 files changed, 14 insertions(+), 1 deletions(-) - -diff --git a/drivers/input/mouse/appletouch.c b/drivers/input/mouse/appletouch.c -index 4c838d1..1f5d5c2 100644 ---- a/drivers/input/mouse/appletouch.c -+++ b/drivers/input/mouse/appletouch.c -@@ -67,6 +67,11 @@ - #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 -+ - #define ATP_DEVICE(prod) \ - .match_flags = USB_DEVICE_ID_MATCH_DEVICE | \ - USB_DEVICE_ID_MATCH_INT_CLASS | \ -@@ -100,6 +105,11 @@ static struct usb_device_id atp_table [] = { - { ATP_DEVICE(GEYSER4_ISO_PRODUCT_ID) }, - { ATP_DEVICE(GEYSER4_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 */ - { } - }; -@@ -227,7 +237,10 @@ static inline int atp_is_geyser_3(struct atp *dev) - (productId == GEYSER3_JIS_PRODUCT_ID) || - (productId == GEYSER4_ANSI_PRODUCT_ID) || - (productId == GEYSER4_ISO_PRODUCT_ID) || -- (productId == GEYSER4_JIS_PRODUCT_ID); -+ (productId == GEYSER4_JIS_PRODUCT_ID) || -+ (productId == GEYSER4_HF_ANSI_PRODUCT_ID) || -+ (productId == GEYSER4_HF_ISO_PRODUCT_ID) || -+ (productId == GEYSER4_HF_JIS_PRODUCT_ID); - } - - /* diff --git a/sys-kernel/mactel-linux-sources/files/mactel-patches-r147/appletouch-new.patch b/sys-kernel/mactel-linux-sources/files/mactel-patches-r147/appletouch-new.patch deleted file mode 100644 index a81fe75..0000000 --- a/sys-kernel/mactel-linux-sources/files/mactel-patches-r147/appletouch-new.patch +++ /dev/null @@ -1,385 +0,0 @@ -A few month ago I implemented palm-detection to the appletouch driver and - -From: Sven Anders <anders@anduras.de> - -released a development version. Currently I'm trying to reimplement these -in a clean way and I'm planning to release it in parts, so I would be accepted -by the kernel developers. - -Late in the develoment progress I found out, that the new Geyser 3/4 touchpad -have special status flags. This patch implements the usage of them and corrects -the calculation of the pressure (for later usage by the palm detection). - -It was tested by some debian people (Johannes Berg, Michel Dänzer, Gaudenz -Steinlin) on the PowerBook and works there too. ---- - - drivers/input/mouse/appletouch.c | 187 ++++++++++++++++++++++++++------------ - 1 files changed, 126 insertions(+), 61 deletions(-) - -diff --git a/drivers/input/mouse/appletouch.c b/drivers/input/mouse/appletouch.c -index 51cc7c3..4c838d1 100644 ---- a/drivers/input/mouse/appletouch.c -+++ b/drivers/input/mouse/appletouch.c -@@ -8,8 +8,12 @@ - * 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 Sven Anders (anders@anduras.de) - * - * Thanks to Alex Harper <basilisk@foobox.net> for his inputs. -+ * Jason Parekh <jasonparekh@gmail.com> for better finger detection. -+ * Matthew Garrett <mjg59@srcf.ucam.org> for power saving additions. -+ * Soeren Sonnenburg <mactel-ml@nn7.de> for corrections and ideas. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by -@@ -38,16 +42,17 @@ - #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 +63,9 @@ - * 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 - - #define ATP_DEVICE(prod) \ - .match_flags = USB_DEVICE_ID_MATCH_DEVICE | \ -@@ -73,15 +78,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) }, -@@ -136,27 +143,36 @@ MODULE_DEVICE_TABLE (usb, atp_table); - #define ATP_GEYSER3_MODE_REQUEST_INDEX 0 - #define ATP_GEYSER3_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 */ - int open; /* non-zero if opened */ - struct input_dev *input; /* input dev */ - int valid; /* are the sensors valid ? */ - int x_old; /* last reported x/y, */ - int y_old; /* used for smoothing */ - /* current value of the sensors */ -- signed char xy_cur[ATP_XSENSORS + ATP_YSENSORS]; -+ u16 xy_cur[ATP_XSENSORS + ATP_YSENSORS]; - /* last value of the sensors */ -- signed char xy_old[ATP_XSENSORS + ATP_YSENSORS]; -+ u16 xy_old[ATP_XSENSORS + ATP_YSENSORS]; - /* accumulated sensors */ - int xy_acc[ATP_XSENSORS + ATP_YSENSORS]; - int overflowwarn; /* overflow warning printed? */ - int datalen; /* size of an USB urb transfer */ -- int idlecount; /* number of empty packets */ -- struct work_struct work; -+ int idle_counter; /* idle counter */ -+ struct work_struct work; /* kernel workqueue entry (for re-init) */ - }; - - #define dbg_dump(msg, tab) \ -@@ -173,8 +189,12 @@ struct atp { - if (debug) printk(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"); - - /* -@@ -184,7 +204,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"); - -@@ -193,9 +213,9 @@ 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) -@@ -211,24 +231,29 @@ static inline int atp_is_geyser_3(struct atp *dev) - } - - /* -- * By default Geyser 3 device sends standard USB HID mouse -- * packets (Report ID 2). This code changes device mode, so it -- * sends raw sensor reports (Report ID 5). -+ * By default Geyser 3 and Geyser 4 devices sends standard -+ * USB HID mouse packets (Report ID 2). This code changes device -+ * mode, so it sends raw sensor reports (Report ID 5). - */ --static int atp_geyser3_init(struct usb_device *udev) -+static int atp_geyser3_4_init(struct usb_device *udev) - { - char data[8]; - int size; -+ int i; - - size = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0), -- ATP_GEYSER3_MODE_READ_REQUEST_ID, -- USB_DIR_IN | USB_TYPE_CLASS | USB_RECIP_INTERFACE, -- ATP_GEYSER3_MODE_REQUEST_VALUE, -- ATP_GEYSER3_MODE_REQUEST_INDEX, &data, 8, 5000); -+ ATP_GEYSER3_MODE_READ_REQUEST_ID, -+ USB_DIR_IN | USB_TYPE_CLASS | USB_RECIP_INTERFACE, -+ ATP_GEYSER3_MODE_REQUEST_VALUE, -+ ATP_GEYSER3_MODE_REQUEST_INDEX, &data, 8, 5000); - - if (size != 8) { -+ printk("appletouch atp_geyser3_4_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 3 mode)"); -+ " (Geyser 3/4 mode)"); - return -EIO; - } - -@@ -236,27 +261,31 @@ static int atp_geyser3_init(struct usb_device *udev) - data[0] = ATP_GEYSER3_MODE_VENDOR_VALUE; - - size = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), -- ATP_GEYSER3_MODE_WRITE_REQUEST_ID, -- USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE, -- ATP_GEYSER3_MODE_REQUEST_VALUE, -- ATP_GEYSER3_MODE_REQUEST_INDEX, &data, 8, 5000); -+ ATP_GEYSER3_MODE_WRITE_REQUEST_ID, -+ USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE, -+ ATP_GEYSER3_MODE_REQUEST_VALUE, -+ ATP_GEYSER3_MODE_REQUEST_INDEX, &data, 8, 5000); - - if (size != 8) { -+ printk("appletouch atp_geyser3_4_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 3 mode)"); -+ " (Geyser 3/4 mode)"); - return -EIO; - } - return 0; - } - --/* Reinitialise the device if it's a geyser 3 */ -+/* Reinitialise the device if it's a geyser 3/4 */ - static void atp_reinit(struct work_struct *work) - { - struct atp *dev = container_of(work, struct atp, work); - struct usb_device *udev = dev->udev; - -- dev->idlecount = 0; -- atp_geyser3_init(udev); -+ dprintk("appletouch: putting appletouch to sleep (reinit)\n"); -+ atp_geyser3_4_init(udev); - } - - static int atp_calculate_abs(int *xy_sensors, int nb_sensors, int fact, -@@ -421,10 +450,15 @@ 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(dev)) -+ memcpy(dev->xy_old, dev->xy_cur, sizeof(dev->xy_old)); - - if (atp_is_geyser_3(dev)) /* No 17" Macbooks (yet) */ - goto exit; -@@ -451,18 +485,39 @@ 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(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) -+ /* 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, -@@ -478,7 +533,7 @@ static void atp_complete(struct urb* urb) - dev->x_old = x; - dev->y_old = y; - -- if (debug > 1) -+ if (debug > 0) - printk("appletouch: X: %3d Y: %3d " - "Xz: %3d Yz: %3d\n", - x, y, x_z, y_z); -@@ -503,20 +558,30 @@ static void atp_complete(struct urb* urb) - /* reset the accumulator on release */ - memset(dev->xy_acc, 0, sizeof(dev->xy_acc)); - -- /* Geyser 3 will continue to send packets continually after -- the first touch unless reinitialised. Do so if it's been -- idle for a while in order to avoid waking the kernel up -- several hundred times a second */ -- if (!key && atp_is_geyser_3(dev)) { -- 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) { -+ -+ /* Get every 10th sample, reset counter */ -+ dev->idle_counter = 0; -+ -+ /* Geyser 3/4 will continue to send packets continually -+ after the first touch. The function is called every -+ 8 milliseconds from interrups context, unless -+ reinitialised. Do so if it's been idle for a while -+ in order to avoid waking the kernel up several -+ hundred times a second */ -+ -+ if (!key && atp_is_geyser_3(dev)) - schedule_work(&dev->work); -- } - } - } - -- input_report_key(dev->input, BTN_LEFT, key); -+ input_report_key(dev->input, BTN_LEFT, -+ dev->data[dev->datalen - 1] & ATP_STATUS_BIT_BUTTON); -+ - input_sync(dev->input); - - exit: -@@ -593,9 +658,8 @@ static int atp_probe(struct usb_interface *iface, const struct usb_device_id *id - - if (atp_is_geyser_3(dev)) { - /* switch to raw sensor mode */ -- if (atp_geyser3_init(udev)) -+ if (atp_geyser3_4_init(udev)) - goto err_free_devs; -- - printk("appletouch Geyser 3 inited.\n"); - } - -@@ -670,6 +734,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; diff --git a/sys-kernel/mactel-linux-sources/mactel-linux-sources-2.6.24-r5.ebuild b/sys-kernel/mactel-linux-sources/mactel-linux-sources-2.6.24-r5.ebuild new file mode 100644 index 0000000..b2d2237 --- /dev/null +++ b/sys-kernel/mactel-linux-sources/mactel-linux-sources-2.6.24-r5.ebuild @@ -0,0 +1,45 @@ +# Copyright 1999-2007 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +ETYPE="sources" +K_WANT_GENPATCHES="base extras" +K_GENPATCHES_VER="6" +K_SECURITY_UNSUPPORTED="1" +inherit kernel-2 +detect_version +detect_arch + +DESCRIPTION="Sources for the Linux kernel with mactel-linux and gentoo patches." +HOMEPAGE="http://www.kernel.org + http://dev.gentoo.org/~dsd/genpatches + http://mactel-linux.org" + +SRC_URI="${KERNEL_URI} ${GENPATCHES_URI} ${ARCH_URI}" +KEYWORDS="~amd64 ~x86" + +PATCHDIR="${FILESDIR}/${PV}-mactel-patches-r155/" + +UNIPATCH_LIST="${PATCHDIR}/appletouch-new.patch \ +${PATCHDIR}/appletouch.patch \ +${PATCHDIR}/applesmc-macbook2.patch \ +${PATCHDIR}/applesmc-retry-when-accessing-keys.patch \ +${PATCHDIR}/applesmc-remove-debugging-messages.patch \ +${PATCHDIR}/applesmc_int.patch \ +${PATCHDIR}/sigmatel_audio_display_all_controls_when_subsystem_id_is_wrong.patch \ +${PATCHDIR}/sigmatel_audio_fix_macbook_v2.patch \ +${PATCHDIR}/disk-protect.patch \ +${PATCHDIR}/disk-protect-fix-2.6.24-crash.patch \ +${PATCHDIR}/disk-protect-update.patch \ +${PATCHDIR}/export-lookup_dev.patch \ +${PATCHDIR}/applesmc-int-protect.patch \ +${PATCHDIR}/hid-add-new-apple-keyboard.patch" + +UNIPATCH_STRICTORDER="1" + +pkg_postinst() { + kernel-2_pkg_postinst + einfo "For more info on this patchset, see:" + einfo "${HOMEPAGE}" + einfo "Report any problems to je_fro@gentoo.org" +} |