[arch-commits] CVS update of core/base/kernel26 (5 files)
Tobias Powalowski
tpowa at archlinux.org
Fri Feb 8 22:23:25 UTC 2008
Date: Friday, February 8, 2008 @ 17:23:25
Author: tpowa
Path: /home/cvs-core/core/base/kernel26
Modified: PKGBUILD (1.288 -> 1.289) config (1.115 -> 1.116)
config.x86_64 (1.43 -> 1.44)
linux-phc-0.3.0-kernel-vanilla-2.6.23rc3.patch (1.1 -> 1.2)
mactel-linux-2.6.24.patch (1.1 -> 1.2)
'upgpkg: update to new version'
------------------------------------------------+
PKGBUILD | 19
config | 2
config.x86_64 | 2
linux-phc-0.3.0-kernel-vanilla-2.6.23rc3.patch | 2
mactel-linux-2.6.24.patch | 518 +++++++++++++++++------
5 files changed, 406 insertions(+), 137 deletions(-)
Index: core/base/kernel26/PKGBUILD
diff -u core/base/kernel26/PKGBUILD:1.288 core/base/kernel26/PKGBUILD:1.289
--- core/base/kernel26/PKGBUILD:1.288 Sat Jan 26 10:44:31 2008
+++ core/base/kernel26/PKGBUILD Fri Feb 8 17:23:24 2008
@@ -1,10 +1,10 @@
-# $Id: PKGBUILD,v 1.288 2008/01/26 15:44:31 tpowa Exp $
+# $Id: PKGBUILD,v 1.289 2008/02/08 22:23:24 tpowa Exp $
# Maintainer: Tobias Powalowski <tpowa at archlinux.org>
# Maintainer: Thomas Baechler <thomas at archlinux.org>
pkgname=kernel26
_basekernel=2.6.24
-pkgver=2.6.24
-pkgrel=2
+pkgver=2.6.24.1
+pkgrel=1
pkgdesc="The Linux Kernel and modules"
arch=(i686 x86_64)
license=('GPL2')
@@ -21,7 +21,7 @@
'zd1211' 'kvm-modules' 'iwlwifi' 'rt2x00-cvs')
install=kernel26.install
source=(ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-$_basekernel.tar.bz2
- #ftp://ftp.kernel.org/pub/linux/kernel/v2.6/patch-$pkgver.bz2
+ ftp://ftp.kernel.org/pub/linux/kernel/v2.6/patch-$pkgver.bz2
### next two lines only needed for rc kernel building
#http://www.kernel.org/pub/linux/kernel/v2.6/testing/patch-2.6.24-rc6.bz2
#http://www.kernel.org/pub/linux/kernel/v2.6/snapshots/patch-2.6.24-rc6-git2.bz2
@@ -60,8 +60,9 @@
winfast-2000.patch
)
md5sums=('3f23ad4b69d0a552042d1ed0f4399857'
- '122d586ce8749e24ea917b40681c33a0'
- '84af13e113d37df00edcbbf1e9f17be7'
+ '86d55d5080217b2e79e0fff227218cd1'
+ '97c28c42ef2bbf8c9c6464a1e09eaf90'
+ '3a2693f2793fd1a968a750dbf154ab57'
'6a5a1925501fe20fafd04fdb3cb4f6ed'
'e8c333eaeac43f5c6a1d7b2f47af12e2'
'c120adbd9c0daa0136237a83adeabd1e'
@@ -70,14 +71,14 @@
'493137566bc397ec762c86e64bd96849'
'695d8578a0334fa9bb140917561f03d4'
'3ed791c3af3099489faf0d22cbcc55a8'
- '75e5017924c7d6a0b81df68650de5515'
+ '988bdc1b9635024c0c91048b05e5ce7f'
'bbc730a590d4e09b3d937b257e5a4bfe'
'62d3ff7c067a5aa82f57711b3a4ab86a'
'd25fbc1b2097c7b512cea289a74f8bdb'
'0f72452b84db921e417b719c1d5d8213'
'1a7e063a4972143374049e0df006044e'
'b478f209867ab551f12ad23062c3109d'
- '58bc5cdc6f2c58b3274ce2f74f2eb411'
+ '0866faa4e11ed5b65f1b9bf91a7b6310'
'9dd6078ef9426ef0dafa9bcfd042af58')
build() {
@@ -86,7 +87,7 @@
cd $startdir/src/linux-$_basekernel
# add upstream patch from 2.6.24 series
- #patch -Np1 -i ../patch-$pkgver || return 1
+ patch -Np1 -i ../patch-$pkgver || return 1
### next 2 lines are only needed for rc kernels
#patch -Np1 -i ../patch-$pkgver-rc6 || return 1
Index: core/base/kernel26/config
diff -u core/base/kernel26/config:1.115 core/base/kernel26/config:1.116
--- core/base/kernel26/config:1.115 Sat Jan 26 10:44:31 2008
+++ core/base/kernel26/config Fri Feb 8 17:23:25 2008
@@ -3474,7 +3474,7 @@
CONFIG_MSDOS_PARTITION=y
CONFIG_BSD_DISKLABEL=y
# CONFIG_MINIX_SUBPARTITION is not set
-# CONFIG_SOLARIS_X86_PARTITION is not set
+CONFIG_SOLARIS_X86_PARTITION=y
# CONFIG_UNIXWARE_DISKLABEL is not set
# CONFIG_LDM_PARTITION is not set
# CONFIG_SGI_PARTITION is not set
Index: core/base/kernel26/config.x86_64
diff -u core/base/kernel26/config.x86_64:1.43 core/base/kernel26/config.x86_64:1.44
--- core/base/kernel26/config.x86_64:1.43 Sat Jan 26 10:44:31 2008
+++ core/base/kernel26/config.x86_64 Fri Feb 8 17:23:25 2008
@@ -3216,7 +3216,7 @@
CONFIG_MSDOS_PARTITION=y
CONFIG_BSD_DISKLABEL=y
# CONFIG_MINIX_SUBPARTITION is not set
-# CONFIG_SOLARIS_X86_PARTITION is not set
+CONFIG_SOLARIS_X86_PARTITION=y
# CONFIG_UNIXWARE_DISKLABEL is not set
# CONFIG_LDM_PARTITION is not set
# CONFIG_SGI_PARTITION is not set
Index: core/base/kernel26/linux-phc-0.3.0-kernel-vanilla-2.6.23rc3.patch
diff -u core/base/kernel26/linux-phc-0.3.0-kernel-vanilla-2.6.23rc3.patch:1.1 core/base/kernel26/linux-phc-0.3.0-kernel-vanilla-2.6.23rc3.patch:1.2
--- core/base/kernel26/linux-phc-0.3.0-kernel-vanilla-2.6.23rc3.patch:1.1 Fri Nov 9 05:38:40 2007
+++ core/base/kernel26/linux-phc-0.3.0-kernel-vanilla-2.6.23rc3.patch Fri Feb 8 17:23:25 2008
@@ -1,6 +1,6 @@
diff --new-file -a --unified=5 --recursive linux-2.6.23-rc3/arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c linux-source-2.6.23-rc3/arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c
--- linux-2.6.23-rc3/arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c 2007-08-13 06:25:24.000000000 +0200
-+++ linux-source-2.6.23-rc3/arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c 2007-08-14 15:33:30.000000000 +0200
++++ linux-source-2.6.23-rc3/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c 2007-08-14 15:33:30.000000000 +0200
@@ -23,10 +23,15 @@
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*
Index: core/base/kernel26/mactel-linux-2.6.24.patch
diff -u core/base/kernel26/mactel-linux-2.6.24.patch:1.1 core/base/kernel26/mactel-linux-2.6.24.patch:1.2
--- core/base/kernel26/mactel-linux-2.6.24.patch:1.1 Fri Jan 25 12:16:19 2008
+++ core/base/kernel26/mactel-linux-2.6.24.patch Fri Feb 8 17:23:25 2008
@@ -1,3 +1,336 @@
+[PATCH] applesmc case led and SCSI LED activity trigger
+
+From: René Rebe <rene at exactcode.de>
+
+
+---
+
+ drivers/hwmon/applesmc.c | 70 ++++++++++++++++++++++++++++++++++++++++------
+ 1 files changed, 61 insertions(+), 9 deletions(-)
+
+diff --git a/drivers/hwmon/applesmc.c b/drivers/hwmon/applesmc.c
+index 86c66c3..377c96d 100644
+--- a/drivers/hwmon/applesmc.c
++++ b/drivers/hwmon/applesmc.c
+@@ -63,6 +63,8 @@
+
+ #define CLAMSHELL_KEY "MSLD" /* r-o ui8 (unused) */
+
++#define LED_KEY "LSLF" /* r-w ui16 */
++
+ #define MOTION_SENSOR_X_KEY "MO_X" /* r-o sp78 (2 bytes) */
+ #define MOTION_SENSOR_Y_KEY "MO_Y" /* r-o sp78 (2 bytes) */
+ #define MOTION_SENSOR_Z_KEY "MO_Z" /* r-o sp78 (2 bytes) */
+@@ -151,7 +153,7 @@ static DEFINE_MUTEX(applesmc_lock);
+ */
+ static unsigned int key_at_index;
+
+-static struct workqueue_struct *applesmc_led_wq;
++static struct workqueue_struct *applesmc_led_wq, *applesmc_backlight_wq;
+
+ /*
+ * __wait_status - Wait up to 2ms for the status port to get a certain value
+@@ -742,13 +744,40 @@ static void applesmc_backlight_set(struct work_struct *work)
+ }
+ static DECLARE_WORK(backlight_work, &applesmc_backlight_set);
+
+-static void applesmc_brightness_set(struct led_classdev *led_cdev,
+- enum led_brightness value)
++static void applesmc_backlight_brightness_set(struct led_classdev *led_cdev,
++ enum led_brightness value)
+ {
+ int ret;
+
+ backlight_value = value;
+- ret = queue_work(applesmc_led_wq, &backlight_work);
++ ret = queue_work(applesmc_backlight_wq, &backlight_work);
++
++ if (debug && (!ret))
++ printk(KERN_DEBUG "applesmc: work was already on the queue.\n");
++}
++
++/* Store the next LED value to be written by the work */
++static unsigned int led_value;
++
++static void applesmc_led_set(struct work_struct *work)
++{
++ u8 buffer[2];
++
++ mutex_lock(&applesmc_lock);
++ buffer[0] = led_value;
++ buffer[1] = 0x00;
++ applesmc_write_key(LED_KEY, buffer, 2);
++ mutex_unlock(&applesmc_lock);
++}
++static DECLARE_WORK(led_work, &applesmc_led_set);
++
++static void applesmc_led_brightness_set(struct led_classdev *led_cdev,
++ enum led_brightness value)
++{
++ int ret;
++
++ led_value = value;
++ ret = queue_work(applesmc_led_wq, &led_work);
+
+ if (debug && (!ret))
+ printk(KERN_DEBUG "applesmc: work was already on the queue.\n");
+@@ -904,10 +933,16 @@ static ssize_t applesmc_key_at_index_store(struct device *dev,
+ return count;
+ }
+
++static struct led_classdev applesmc_led = {
++ .name = "smc:case-led",
++ .default_trigger = "ide-disk",
++ .brightness_set = applesmc_led_brightness_set,
++};
++
+ static struct led_classdev applesmc_backlight = {
+ .name = "smc:kbd_backlight",
+ .default_trigger = "nand-disk",
+- .brightness_set = applesmc_brightness_set,
++ .brightness_set = applesmc_backlight_brightness_set,
+ };
+
+ static DEVICE_ATTR(name, 0444, applesmc_name_show, NULL);
+@@ -1340,15 +1375,28 @@ static int __init applesmc_init(void)
+ goto out_temperature;
+ }
+
++ /* Create the workqueue */
++ applesmc_led_wq = create_singlethread_workqueue("applesmc-led");
++ if (!applesmc_led_wq) {
++ ret = -ENOMEM;
++ goto out_accelerometer;
++ }
++
++ /* register as a led device */
++ ret = led_classdev_register(&pdev->dev, &applesmc_led);
++ if (ret < 0)
++ goto out_led_wq;
++
++
+ if (applesmc_light) {
+ /* Add light sensor file */
+ ret = sysfs_create_file(&pdev->dev.kobj, &dev_attr_light.attr);
+ if (ret)
+- goto out_accelerometer;
++ goto out_led_ledclass;
+
+ /* Create the workqueue */
+- applesmc_led_wq = create_singlethread_workqueue("applesmc-led");
+- if (!applesmc_led_wq) {
++ applesmc_backlight_wq = create_singlethread_workqueue("applesmc-backlight");
++ if (!applesmc_backlight_wq) {
+ ret = -ENOMEM;
+ goto out_light_sysfs;
+ }
+@@ -1374,10 +1422,14 @@ out_light_ledclass:
+ led_classdev_unregister(&applesmc_backlight);
+ out_light_wq:
+ if (applesmc_light)
+- destroy_workqueue(applesmc_led_wq);
++ destroy_workqueue(applesmc_backlight_wq);
+ out_light_sysfs:
+ if (applesmc_light)
+ sysfs_remove_file(&pdev->dev.kobj, &dev_attr_light.attr);
++out_led_ledclass:
++ led_classdev_unregister(&applesmc_led);
++out_led_wq:
++ destroy_workqueue(applesmc_led_wq);
+ out_accelerometer:
+ if (applesmc_accelerometer)
+ applesmc_release_accelerometer();
+Add sensors set for MacBook2, from register dump on a mid-2007 MacBook2.
+
+From: Riki Oktarianto <rkoktarianto at 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 377c96d..4dca4cd 100644
+--- a/drivers/hwmon/applesmc.c
++++ b/drivers/hwmon/applesmc.c
+@@ -86,12 +86,15 @@ static const char* temperature_sensors_sets[][36] = {
+ /* Set 0: Macbook Pro */
+ { "TA0P", "TB0T", "TC0D", "TC0P", "TG0H", "TG0P", "TG0T", "Th0H",
+ "Th1H", "Tm0P", "Ts0P", "Ts1P", NULL },
+-/* Set 1: Macbook set */
++/* Set 1: Macbook2 set */
++ { "TB0T", "TC0D", "TC0P", "TM0P", "TN0P", "TN1P", "TTF0", "Th0H",
++ "Th0S", "Th1H", NULL },
++/* Set 2: Macbook set */
+ { "TB0T", "TC0D", "TC0P", "TM0P", "TN0P", "TN1P", "Th0H", "Th0S",
+ "Th1H", "Ts0P", NULL },
+-/* Set 2: Macmini set */
++/* Set 3: Macmini set */
+ { "TC0D", "TC0P", NULL },
+-/* Set 3: Mac Pro (2 x Quad-Core) */
++/* Set 4: 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",
+@@ -1247,12 +1250,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 },
+-/* MacBook: accelerometer and temperature set 1 */
++/* MacBook2: accelerometer and temperature set 1 */
+ { .accelerometer = 1, .light = 0, .temperature_set = 1 },
+-/* MacMini: temperature set 2 */
+- { .accelerometer = 0, .light = 0, .temperature_set = 2 },
+-/* MacPro: temperature set 3 */
++/* MacBook: accelerometer and temperature set 2 */
++ { .accelerometer = 1, .light = 0, .temperature_set = 2 },
++/* MacMini: temperature set 3 */
+ { .accelerometer = 0, .light = 0, .temperature_set = 3 },
++/* MacPro: temperature set 4 */
++ { .accelerometer = 0, .light = 0, .temperature_set = 4 },
+ };
+
+ /* Note that DMI_MATCH(...,"MacBook") will match "MacBookPro1,1".
+@@ -1264,16 +1269,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"),
+- DMI_MATCH(DMI_PRODUCT_NAME,"MacBook") },
++ DMI_MATCH(DMI_PRODUCT_NAME,"MacBook2") },
+ (void*)&applesmc_dmi_data[1]},
++ { applesmc_dmi_match, "Apple MacBook", {
++ DMI_MATCH(DMI_BOARD_VENDOR,"Apple"),
++ DMI_MATCH(DMI_PRODUCT_NAME,"MacBook") },
++ (void*)&applesmc_dmi_data[2]},
+ { applesmc_dmi_match, "Apple Macmini", {
+ DMI_MATCH(DMI_BOARD_VENDOR,"Apple"),
+ DMI_MATCH(DMI_PRODUCT_NAME,"Macmini") },
+- (void*)&applesmc_dmi_data[2]},
++ (void*)&applesmc_dmi_data[3]},
+ { applesmc_dmi_match, "Apple MacPro2", {
+ DMI_MATCH(DMI_BOARD_VENDOR,"Apple"),
+ DMI_MATCH(DMI_PRODUCT_NAME,"MacPro2") },
+- (void*)&applesmc_dmi_data[3]},
++ (void*)&applesmc_dmi_data[4]},
+ { .ident = NULL }
+ };
+
+Retry up to 200 ms when reading or writing keys.
+
+From: Nicolas Boichat <nicolas at 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 4dca4cd..0950839 100644
+--- a/drivers/hwmon/applesmc.c
++++ b/drivers/hwmon/applesmc.c
+@@ -114,6 +114,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 */
+
++#define ACCESS_TIMEOUT_MSECS 500 /* wait up to 500ms when accessing a key */
++#define ACCESS_WAIT_MSECS 5 /* ... in 5ms increments */
++
+ #define APPLESMC_POLL_INTERVAL 50 /* msecs */
+ #define APPLESMC_INPUT_FUZZ 4 /* input event threshold */
+ #define APPLESMC_INPUT_FLAT 4
+@@ -188,12 +191,13 @@ static int __wait_status(u8 val)
+
+ /*
+ * applesmc_read_key - reads len bytes from a given key, and put them in buffer.
++ * Tries up to ACCESS_WAIT_MSECS to read the value.
+ * Returns zero on success or a negative error on failure. Callers must
+ * hold applesmc_lock.
+ */
+ static int applesmc_read_key(const char* key, u8* buffer, u8 len)
+ {
+- int i;
++ int i, total, ret;
+
+ if (len > APPLESMC_MAX_DATA_LENGTH) {
+ printk(KERN_ERR "applesmc_read_key: cannot read more than "
+@@ -201,33 +205,54 @@ static int applesmc_read_key(const char* key, u8* buffer, u8 len)
+ return -EINVAL;
+ }
+
+- outb(APPLESMC_READ_CMD, APPLESMC_CMD_PORT);
+- if (__wait_status(0x0c))
+- return -EIO;
++ for (total = ACCESS_TIMEOUT_MSECS; total > 0;
++ total -= ACCESS_WAIT_MSECS) {
++ ret = 0;
++ outb(APPLESMC_READ_CMD, APPLESMC_CMD_PORT);
++ if (__wait_status(0x0c)) {
++ ret = -EIO;
++ goto wait_fail;
++ }
+
+- for (i = 0; i < 4; i++) {
+- outb(key[i], APPLESMC_DATA_PORT);
+- if (__wait_status(0x04))
+- return -EIO;
+- }
+- if (debug)
+- printk(KERN_DEBUG "<%s", key);
++ for (i = 0; i < 4; i++) {
++ outb(key[i], APPLESMC_DATA_PORT);
++ if (__wait_status(0x04)) {
++ ret = -EIO;
++ goto wait_fail;
++ }
++ }
++ if (debug)
++ printk(KERN_DEBUG "<%s", key);
+
+- outb(len, APPLESMC_DATA_PORT);
+- if (debug)
+- printk(KERN_DEBUG ">%x", len);
++ outb(len, APPLESMC_DATA_PORT);
++ if (debug)
++ printk(KERN_DEBUG ">%x", len);
+
+- for (i = 0; i < len; i++) {
+- if (__wait_status(0x05))
+- return -EIO;
+- buffer[i] = inb(APPLESMC_DATA_PORT);
++ for (i = 0; i < len; i++) {
++ if (__wait_status(0x05)) {
++ ret = -EIO;
++ goto wait_fail;
++ }
++ buffer[i] = inb(APPLESMC_DATA_PORT);
++ if (debug)
++ printk(KERN_DEBUG "<%x", buffer[i]);
++ }
+ if (debug)
+- printk(KERN_DEBUG "<%x", buffer[i]);
++ printk(KERN_DEBUG "\n");
++
++ break;
++
++wait_fail:
++ msleep(ACCESS_WAIT_MSECS);
++ continue;
+ }
+- if (debug)
+- printk(KERN_DEBUG "\n");
+
+- return 0;
++ if (total != ACCESS_TIMEOUT_MSECS) {
++ printk(KERN_DEBUG "Read: Waited %d ms for the value\n",
++ ACCESS_TIMEOUT_MSECS-total);
++ }
++
++ return ret;
+ }
+
+ /*
Add interrupt support for the accelerometer. A message is printed in dmesg when an interrupt occurs, but no further handling is done.
From: Nicolas Boichat <nicolas at boichat.ch>
@@ -9,7 +342,7 @@
1 files changed, 298 insertions(+), 23 deletions(-)
diff --git a/drivers/hwmon/applesmc.c b/drivers/hwmon/applesmc.c
-index cea8d78..5d184a1 100644
+index 0950839..fe07ebd 100644
--- a/drivers/hwmon/applesmc.c
+++ b/drivers/hwmon/applesmc.c
@@ -39,14 +39,20 @@
@@ -42,7 +375,7 @@
#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) */
-@@ -68,6 +76,19 @@
+@@ -70,6 +78,19 @@
#define MOTION_SENSOR_Z_KEY "MO_Z" /* r-o sp78 (2 bytes) */
#define MOTION_SENSOR_KEY "MOCN" /* r/w ui16 */
@@ -62,7 +395,7 @@
#define FANS_COUNT "FNum" /* r-o ui8 */
#define FANS_MANUAL "FS! " /* r-w ui16 */
#define FAN_ACTUAL_SPEED "F0Ac" /* r-o fpe2 (2 bytes) */
-@@ -351,12 +372,83 @@ static int applesmc_read_motion_sensor(int index, s16* value)
+@@ -387,12 +408,83 @@ static int applesmc_read_motion_sensor(int index, s16* value)
}
/*
@@ -147,7 +480,7 @@
u8 buffer[2];
if (!applesmc_accelerometer)
-@@ -364,32 +456,79 @@ static int applesmc_device_init(void)
+@@ -400,32 +492,79 @@ static int applesmc_device_init(void)
mutex_lock(&applesmc_lock);
@@ -249,7 +582,7 @@
out:
mutex_unlock(&applesmc_lock);
-@@ -434,9 +573,16 @@ static int applesmc_resume(struct platform_device *dev)
+@@ -470,9 +609,16 @@ static int applesmc_resume(struct platform_device *dev)
return applesmc_device_init();
}
@@ -266,7 +599,7 @@
.driver = {
.name = "applesmc",
.owner = THIS_MODULE,
-@@ -898,6 +1044,123 @@ static ssize_t applesmc_key_at_index_store(struct device *dev,
+@@ -961,6 +1107,123 @@ static ssize_t applesmc_key_at_index_store(struct device *dev,
return count;
}
@@ -387,10 +720,10 @@
+ return count;
+}
+
- static struct led_classdev applesmc_backlight = {
- .name = "smc:kbd_backlight",
- .default_trigger = "nand-disk",
-@@ -909,10 +1172,22 @@ static DEVICE_ATTR(name, 0444, applesmc_name_show, NULL);
+ static struct led_classdev applesmc_led = {
+ .name = "smc:case-led",
+ .default_trigger = "ide-disk",
+@@ -978,10 +1241,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);
@@ -413,121 +746,6 @@
NULL
};
-Retry up to 200 ms when reading or writing keys.
-
-From: Nicolas Boichat <nicolas at 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 56e4a59..99e64ee 100644
---- a/drivers/hwmon/applesmc.c
-+++ b/drivers/hwmon/applesmc.c
-@@ -130,6 +130,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 */
-
-+#define ACCESS_TIMEOUT_MSECS 500 /* wait up to 500ms when accessing a key */
-+#define ACCESS_WAIT_MSECS 5 /* ... in 5ms increments */
-+
- #define APPLESMC_POLL_INTERVAL 50 /* msecs */
- #define APPLESMC_INPUT_FUZZ 4 /* input event threshold */
- #define APPLESMC_INPUT_FLAT 4
-@@ -204,12 +207,13 @@ static int __wait_status(u8 val)
-
- /*
- * applesmc_read_key - reads len bytes from a given key, and put them in buffer.
-+ * Tries up to ACCESS_WAIT_MSECS to read the value.
- * Returns zero on success or a negative error on failure. Callers must
- * hold applesmc_lock.
- */
- static int applesmc_read_key(const char* key, u8* buffer, u8 len)
- {
-- int i;
-+ int i, total, ret;
-
- if (len > APPLESMC_MAX_DATA_LENGTH) {
- printk(KERN_ERR "applesmc_read_key: cannot read more than "
-@@ -217,33 +221,54 @@ static int applesmc_read_key(const char* key, u8* buffer, u8 len)
- return -EINVAL;
- }
-
-- outb(APPLESMC_READ_CMD, APPLESMC_CMD_PORT);
-- if (__wait_status(0x0c))
-- return -EIO;
-+ for (total = ACCESS_TIMEOUT_MSECS; total > 0;
-+ total -= ACCESS_WAIT_MSECS) {
-+ ret = 0;
-+ outb(APPLESMC_READ_CMD, APPLESMC_CMD_PORT);
-+ if (__wait_status(0x0c)) {
-+ ret = -EIO;
-+ goto wait_fail;
-+ }
-
-- for (i = 0; i < 4; i++) {
-- outb(key[i], APPLESMC_DATA_PORT);
-- if (__wait_status(0x04))
-- return -EIO;
-- }
-- if (debug)
-- printk(KERN_DEBUG "<%s", key);
-+ for (i = 0; i < 4; i++) {
-+ outb(key[i], APPLESMC_DATA_PORT);
-+ if (__wait_status(0x04)) {
-+ ret = -EIO;
-+ goto wait_fail;
-+ }
-+ }
-+ if (debug)
-+ printk(KERN_DEBUG "<%s", key);
-
-- outb(len, APPLESMC_DATA_PORT);
-- if (debug)
-- printk(KERN_DEBUG ">%x", len);
-+ outb(len, APPLESMC_DATA_PORT);
-+ if (debug)
-+ printk(KERN_DEBUG ">%x", len);
-
-- for (i = 0; i < len; i++) {
-- if (__wait_status(0x05))
-- return -EIO;
-- buffer[i] = inb(APPLESMC_DATA_PORT);
-+ for (i = 0; i < len; i++) {
-+ if (__wait_status(0x05)) {
-+ ret = -EIO;
-+ goto wait_fail;
-+ }
-+ buffer[i] = inb(APPLESMC_DATA_PORT);
-+ if (debug)
-+ printk(KERN_DEBUG "<%x", buffer[i]);
-+ }
- if (debug)
-- printk(KERN_DEBUG "<%x", buffer[i]);
-+ printk(KERN_DEBUG "\n");
-+
-+ break;
-+
-+wait_fail:
-+ msleep(ACCESS_WAIT_MSECS);
-+ continue;
- }
-- if (debug)
-- printk(KERN_DEBUG "\n");
-
-- return 0;
-+ if (total != ACCESS_TIMEOUT_MSECS) {
-+ printk(KERN_DEBUG "Read: Waited %d ms for the value\n",
-+ ACCESS_TIMEOUT_MSECS-total);
-+ }
-+
-+ return ret;
- }
-
- /*
Appletouch driver ATP_THRESHOLD fix.
From: Ortwin Glück <odi at odi.ch>
@@ -551,6 +769,56 @@
/* MacBook Pro (Geyser 3 & 4) initialization constants */
#define ATP_GEYSER3_MODE_READ_REQUEST_ID 1
+Added IDs for macbook3,1 trackpad
+
+From: Chris Irwin <chris at 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 17381a9..dcd9a0d 100644
+--- a/drivers/input/mouse/appletouch.c
++++ b/drivers/input/mouse/appletouch.c
+@@ -62,6 +62,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 | \
+@@ -93,6 +98,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 */
+ { }
+ };
+@@ -217,7 +227,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);
+ }
+
+ /*
Display Macbook Pro 1st gen controls when the subsystem id is wrong (0x100).
From: Nicolas Boichat <nicolas at boichat.ch>
More information about the arch-commits
mailing list