From: <nbo...@us...> - 2007-05-27 17:36:08
|
Revision: 127 http://svn.sourceforge.net/mactel-linux/?rev=127&view=rev Author: nboichat Date: 2007-05-27 10:36:01 -0700 (Sun, 27 May 2007) Log Message: ----------- Update patches to the latest git. Add back audio patches, and remove applesmc-use-input-polldev patch which needs others patches from the -mm tree. Modified Paths: -------------- trunk/kernel/mactel-patches-2.6.22/applesmc_int.patch trunk/kernel/mactel-patches-2.6.22/series Added Paths: ----------- trunk/kernel/mactel-patches-2.6.22/sigmatel_audio2.patch trunk/kernel/mactel-patches-2.6.22/sigmatel_audio3.patch Removed Paths: ------------- trunk/kernel/mactel-patches-2.6.22/applesmc-use-input-polldev.patch Deleted: trunk/kernel/mactel-patches-2.6.22/applesmc-use-input-polldev.patch =================================================================== --- trunk/kernel/mactel-patches-2.6.22/applesmc-use-input-polldev.patch 2007-05-27 11:21:30 UTC (rev 126) +++ trunk/kernel/mactel-patches-2.6.22/applesmc-use-input-polldev.patch 2007-05-27 17:36:01 UTC (rev 127) @@ -1,221 +0,0 @@ -HWMON: applesmc - convert to use input-polldev. - -From: Nicolas Boichat <ni...@bo...> - -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 <dt...@ma...> ---- - - 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 4d1cb5b..cfb2a04 100644 ---- a/drivers/hwmon/Kconfig -+++ b/drivers/hwmon/Kconfig -@@ -623,6 +623,7 @@ config SENSORS_APPLESMC - depends on HWMON && 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 fd1281f..eb81a64 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) */ -@@ -99,7 +99,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 - -@@ -121,8 +121,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. */ -@@ -134,7 +133,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 -@@ -451,27 +450,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; -@@ -479,13 +463,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); - } - -@@ -817,8 +799,7 @@ static ssize_t applesmc_key_at_index_read_show(struct device *dev, - - if (!ret) { - return info[0]; -- } -- else { -+ } else { - return ret; - } - } -@@ -1089,6 +1070,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, -@@ -1096,40 +1078,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); -@@ -1142,8 +1121,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); - } - -@@ -1180,8 +1159,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; Modified: trunk/kernel/mactel-patches-2.6.22/applesmc_int.patch =================================================================== --- trunk/kernel/mactel-patches-2.6.22/applesmc_int.patch 2007-05-27 11:21:30 UTC (rev 126) +++ trunk/kernel/mactel-patches-2.6.22/applesmc_int.patch 2007-05-27 17:36:01 UTC (rev 127) @@ -9,7 +9,7 @@ 1 files changed, 293 insertions(+), 23 deletions(-) diff --git a/drivers/hwmon/applesmc.c b/drivers/hwmon/applesmc.c -index eb81a64..ff56afd 100644 +index fd1281f..e523851 100644 --- a/drivers/hwmon/applesmc.c +++ b/drivers/hwmon/applesmc.c @@ -39,14 +39,20 @@ @@ -41,7 +41,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) */ + #define BACKLIGHT_KEY "LKSB" /* w-o {lkb (2 bytes) */ @@ -68,6 +76,19 @@ #define MOTION_SENSOR_Z_KEY "MO_Z" /* r-o sp78 (2 bytes) */ #define MOTION_SENSOR_KEY "MOCN" /* r/w ui16 */ @@ -62,7 +62,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) */ -@@ -347,12 +368,79 @@ static int applesmc_read_motion_sensor(int index, s16* value) +@@ -348,12 +369,79 @@ static int applesmc_read_motion_sensor(int index, s16* value) } /* @@ -143,7 +143,7 @@ u8 buffer[2]; if (!applesmc_accelerometer) -@@ -360,32 +448,79 @@ static int applesmc_device_init(void) +@@ -361,32 +449,79 @@ static int applesmc_device_init(void) mutex_lock(&applesmc_lock); @@ -245,7 +245,7 @@ out: mutex_unlock(&applesmc_lock); -@@ -430,9 +565,16 @@ static int applesmc_resume(struct platform_device *dev) +@@ -431,9 +566,16 @@ static int applesmc_resume(struct platform_device *dev) return applesmc_device_init(); } @@ -262,7 +262,7 @@ .driver = { .name = "applesmc", .owner = THIS_MODULE, -@@ -894,6 +1036,122 @@ static ssize_t applesmc_key_at_index_store(struct device *dev, +@@ -913,6 +1055,122 @@ static ssize_t applesmc_key_at_index_store(struct device *dev, return count; } @@ -385,7 +385,7 @@ static struct led_classdev applesmc_backlight = { .name = "smc:kbd_backlight", .default_trigger = "nand-disk", -@@ -905,10 +1163,22 @@ static DEVICE_ATTR(name, 0444, applesmc_name_show, NULL); +@@ -924,10 +1182,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); Modified: trunk/kernel/mactel-patches-2.6.22/series =================================================================== --- trunk/kernel/mactel-patches-2.6.22/series 2007-05-27 11:21:30 UTC (rev 126) +++ trunk/kernel/mactel-patches-2.6.22/series 2007-05-27 17:36:01 UTC (rev 127) @@ -1,6 +1,7 @@ # This series applies on GIT commit c420bc9f09a0926b708c3edb27eacba434a4f4ba +sigmatel_audio2.patch +sigmatel_audio3.patch applesmc_add_name.patch -applesmc-use-input-polldev.patch applesmc_int.patch appletouch.patch appleir.patch Added: trunk/kernel/mactel-patches-2.6.22/sigmatel_audio2.patch =================================================================== --- trunk/kernel/mactel-patches-2.6.22/sigmatel_audio2.patch (rev 0) +++ trunk/kernel/mactel-patches-2.6.22/sigmatel_audio2.patch 2007-05-27 17:36:01 UTC (rev 127) @@ -0,0 +1,51 @@ +Fix audio on Macmini and Macbook. + +From: Takashi Iwai <ti...@su...> + + +--- + + sound/pci/hda/patch_sigmatel.c | 18 +++++++++++++++--- + 1 files changed, 15 insertions(+), 3 deletions(-) + +diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c +index a6a0a80..6dea603 100644 +--- a/sound/pci/hda/patch_sigmatel.c ++++ b/sound/pci/hda/patch_sigmatel.c +@@ -527,12 +527,24 @@ static unsigned int d945gtp5_pin_configs[10] = { + 0x02a19320, 0x40000100, + }; + +-static unsigned int macbook_pro_v1_pin_configs[10] = { ++static unsigned int macmini_pin_configs[10] = { ++ 0x0321e230, 0x400000fd, 0x9017e110, 0x01014010, ++ 0x400000fd, 0x0381e021, 0x1345e240, 0x13c5e22e, ++ 0x400000fc, 0x400000fb ++}; ++ ++static unsigned int macbook_pin_configs[10] = { + 0x0321e230, 0x03a1e020, 0x9017e110, 0x01014010, + 0x01a19021, 0x0381e021, 0x1345e240, 0x13c5e22e, + 0x02a19320, 0x400000fb + }; + ++static unsigned int macbook_pro_v1_pin_configs[10] = { ++ 0x0321e230, 0x02a7e020, 0x9017e110, 0x01014010, ++ 0x400000fd, 0x0381e021, 0x1345e240, 0x13c5e22e, ++ 0x400000fc, 0x400000fb ++}; ++ + static unsigned int macbook_pro_v2_pin_configs[10] = { + 0x0221401f, 0x90a70120, 0x01813024, 0x01014010, + 0x400000fd, 0x01016011, 0x1345e240, 0x13c5e22e, +@@ -549,8 +561,8 @@ static unsigned int *stac922x_brd_tbl[STAC_922X_MODELS] = { + [STAC_D945_REF] = ref922x_pin_configs, + [STAC_D945GTP3] = d945gtp3_pin_configs, + [STAC_D945GTP5] = d945gtp5_pin_configs, +- [STAC_MACMINI] = macbook_pro_v1_pin_configs, +- [STAC_MACBOOK] = macbook_pro_v1_pin_configs, ++ [STAC_MACMINI] = macmini_pin_configs, ++ [STAC_MACBOOK] = macbook_pin_configs, + [STAC_MACBOOK_PRO_V1] = macbook_pro_v1_pin_configs, + [STAC_MACBOOK_PRO_V2] = macbook_pro_v2_pin_configs, + [STAC_IMAC_INTEL] = imac_intel_pin_configs, Added: trunk/kernel/mactel-patches-2.6.22/sigmatel_audio3.patch =================================================================== --- trunk/kernel/mactel-patches-2.6.22/sigmatel_audio3.patch (rev 0) +++ trunk/kernel/mactel-patches-2.6.22/sigmatel_audio3.patch 2007-05-27 17:36:01 UTC (rev 127) @@ -0,0 +1,22 @@ +Display all controls when the subsystem id is wrong (0x100). + +From: Nicolas Boichat <ni...@bo...> + + +--- + + sound/pci/hda/patch_sigmatel.c | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c +index 6dea603..0ed865c 100644 +--- a/sound/pci/hda/patch_sigmatel.c ++++ b/sound/pci/hda/patch_sigmatel.c +@@ -1991,6 +1991,7 @@ static int patch_stac922x(struct hda_codec *codec) + case 0x106b0a00: /* MacBook First generatoin */ + spec->board_config = STAC_MACBOOK; + break; ++ case 0x100: /* Invalid subsystem ID */ + case 0x106b0200: /* MacBook Pro first generation */ + spec->board_config = STAC_MACBOOK_PRO_V1; + break; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nbo...@us...> - 2007-06-16 09:05:59
|
Revision: 128 http://svn.sourceforge.net/mactel-linux/?rev=128&view=rev Author: nboichat Date: 2007-06-16 02:05:44 -0700 (Sat, 16 Jun 2007) Log Message: ----------- Update patches. Add applesmc-use-input-polldev.patch already applied in -mm for tests. Modified Paths: -------------- trunk/kernel/mactel-patches-2.6.22/appleir.patch trunk/kernel/mactel-patches-2.6.22/series trunk/kernel/mactel-patches-2.6.22/sigmatel_audio2.patch trunk/kernel/mactel-patches-2.6.22/sigmatel_audio3.patch Added Paths: ----------- trunk/kernel/mactel-patches-2.6.22/applesmc-use-input-polldev.patch Removed Paths: ------------- trunk/kernel/mactel-patches-2.6.22/applesmc_add_name.patch Modified: trunk/kernel/mactel-patches-2.6.22/appleir.patch =================================================================== --- trunk/kernel/mactel-patches-2.6.22/appleir.patch 2007-05-27 17:36:01 UTC (rev 127) +++ trunk/kernel/mactel-patches-2.6.22/appleir.patch 2007-06-16 09:05:44 UTC (rev 128) @@ -11,7 +11,7 @@ 3 files changed, 385 insertions(+), 0 deletions(-) diff --git a/drivers/input/misc/Kconfig b/drivers/input/misc/Kconfig -index 842a7b4..00d43d0 100644 +index 88e2907..d2d629a 100644 --- a/drivers/input/misc/Kconfig +++ b/drivers/input/misc/Kconfig @@ -113,6 +113,10 @@ config INPUT_ATI_REMOTE2 @@ -25,16 +25,16 @@ config INPUT_KEYSPAN_REMOTE tristate "Keyspan DMR USB remote control (EXPERIMENTAL)" depends on EXPERIMENTAL -@@ -190,3 +194,4 @@ config HP_SDC_RTC +@@ -179,3 +183,4 @@ config HP_SDC_RTC of the HP SDC controller. endif + diff --git a/drivers/input/misc/Makefile b/drivers/input/misc/Makefile -index 8b2f779..ca41877 100644 +index 3585b50..f73f139 100644 --- a/drivers/input/misc/Makefile +++ b/drivers/input/misc/Makefile -@@ -14,6 +14,7 @@ obj-$(CONFIG_INPUT_WISTRON_BTNS) += wistron_btns.o +@@ -13,6 +13,7 @@ obj-$(CONFIG_INPUT_WISTRON_BTNS) += wistron_btns.o obj-$(CONFIG_INPUT_ATLAS_BTNS) += atlas_btns.o obj-$(CONFIG_INPUT_ATI_REMOTE) += ati_remote.o obj-$(CONFIG_INPUT_ATI_REMOTE2) += ati_remote2.o Added: trunk/kernel/mactel-patches-2.6.22/applesmc-use-input-polldev.patch =================================================================== --- trunk/kernel/mactel-patches-2.6.22/applesmc-use-input-polldev.patch (rev 0) +++ trunk/kernel/mactel-patches-2.6.22/applesmc-use-input-polldev.patch 2007-06-16 09:05:44 UTC (rev 128) @@ -0,0 +1,221 @@ +HWMON: applesmc - convert to use input-polldev. + +From: Nicolas Boichat <ni...@bo...> + +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 <dt...@ma...> +--- + + 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 13eea47..f0ab2ac 100644 +--- a/drivers/hwmon/Kconfig ++++ b/drivers/hwmon/Kconfig +@@ -623,6 +623,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 e523851..ff56afd 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> +@@ -67,9 +67,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) */ +@@ -120,7 +120,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 + +@@ -142,8 +142,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. */ +@@ -155,7 +154,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 +@@ -593,27 +592,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; +@@ -621,13 +605,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); + } + +@@ -959,8 +941,7 @@ static ssize_t applesmc_key_at_index_read_show(struct device *dev, + + if (!ret) { + return info[0]; +- } +- else { ++ } else { + return ret; + } + } +@@ -1359,6 +1340,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, +@@ -1366,40 +1348,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); +@@ -1412,8 +1391,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); + } + +@@ -1450,8 +1429,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; Deleted: trunk/kernel/mactel-patches-2.6.22/applesmc_add_name.patch =================================================================== --- trunk/kernel/mactel-patches-2.6.22/applesmc_add_name.patch 2007-05-27 17:36:01 UTC (rev 127) +++ trunk/kernel/mactel-patches-2.6.22/applesmc_add_name.patch 2007-06-16 09:05:44 UTC (rev 128) @@ -1,46 +0,0 @@ -Add name file needed by lm_sensors user-space applications in applesmc sysfs tree. - -From: Nicolas Boichat <ni...@bo...> - - ---- - - drivers/hwmon/applesmc.c | 7 ++++++- - 1 files changed, 6 insertions(+), 1 deletions(-) - -diff --git a/drivers/hwmon/applesmc.c b/drivers/hwmon/applesmc.c -index 366f4a1..fd1281f 100644 ---- a/drivers/hwmon/applesmc.c -+++ b/drivers/hwmon/applesmc.c -@@ -1206,11 +1206,13 @@ static int __init applesmc_init(void) - } - - ret = sysfs_create_file(&pdev->dev.kobj, &dev_attr_name.attr); -+ if (ret) -+ goto out_device; - - /* Create key enumeration sysfs files */ - ret = sysfs_create_group(&pdev->dev.kobj, &key_enumeration_group); - if (ret) -- goto out_device; -+ goto out_name; - - /* create fan files */ - count = applesmc_get_fan_count(); -@@ -1310,6 +1312,8 @@ out_fan_1: - sysfs_remove_group(&pdev->dev.kobj, &fan_attribute_groups[1]); - out_key_enumeration: - sysfs_remove_group(&pdev->dev.kobj, &key_enumeration_group); -+out_name: -+ sysfs_remove_file(&pdev->dev.kobj, &dev_attr_name.attr); - out_device: - platform_device_unregister(pdev); - out_driver: -@@ -1335,6 +1339,7 @@ static void __exit applesmc_exit(void) - sysfs_remove_group(&pdev->dev.kobj, &fan_attribute_groups[0]); - sysfs_remove_group(&pdev->dev.kobj, &fan_attribute_groups[1]); - sysfs_remove_group(&pdev->dev.kobj, &key_enumeration_group); -+ sysfs_remove_file(&pdev->dev.kobj, &dev_attr_name.attr); - platform_device_unregister(pdev); - platform_driver_unregister(&applesmc_driver); - release_region(APPLESMC_DATA_PORT, APPLESMC_NR_PORTS); Modified: trunk/kernel/mactel-patches-2.6.22/series =================================================================== --- trunk/kernel/mactel-patches-2.6.22/series 2007-05-27 17:36:01 UTC (rev 127) +++ trunk/kernel/mactel-patches-2.6.22/series 2007-06-16 09:05:44 UTC (rev 128) @@ -1,7 +1,7 @@ -# This series applies on GIT commit c420bc9f09a0926b708c3edb27eacba434a4f4ba +# This series applies on GIT commit de7f928ca460005086a8296be07c217aac4b625d sigmatel_audio2.patch sigmatel_audio3.patch -applesmc_add_name.patch applesmc_int.patch appletouch.patch appleir.patch +applesmc-use-input-polldev.patch Modified: trunk/kernel/mactel-patches-2.6.22/sigmatel_audio2.patch =================================================================== --- trunk/kernel/mactel-patches-2.6.22/sigmatel_audio2.patch 2007-05-27 17:36:01 UTC (rev 127) +++ trunk/kernel/mactel-patches-2.6.22/sigmatel_audio2.patch 2007-06-16 09:05:44 UTC (rev 128) @@ -9,10 +9,10 @@ 1 files changed, 15 insertions(+), 3 deletions(-) diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c -index a6a0a80..6dea603 100644 +index e3964fc..686a15a 100644 --- a/sound/pci/hda/patch_sigmatel.c +++ b/sound/pci/hda/patch_sigmatel.c -@@ -527,12 +527,24 @@ static unsigned int d945gtp5_pin_configs[10] = { +@@ -549,12 +549,24 @@ static unsigned int d945gtp5_pin_configs[10] = { 0x02a19320, 0x40000100, }; @@ -38,7 +38,7 @@ static unsigned int macbook_pro_v2_pin_configs[10] = { 0x0221401f, 0x90a70120, 0x01813024, 0x01014010, 0x400000fd, 0x01016011, 0x1345e240, 0x13c5e22e, -@@ -549,8 +561,8 @@ static unsigned int *stac922x_brd_tbl[STAC_922X_MODELS] = { +@@ -571,8 +583,8 @@ static unsigned int *stac922x_brd_tbl[STAC_922X_MODELS] = { [STAC_D945_REF] = ref922x_pin_configs, [STAC_D945GTP3] = d945gtp3_pin_configs, [STAC_D945GTP5] = d945gtp5_pin_configs, Modified: trunk/kernel/mactel-patches-2.6.22/sigmatel_audio3.patch =================================================================== --- trunk/kernel/mactel-patches-2.6.22/sigmatel_audio3.patch 2007-05-27 17:36:01 UTC (rev 127) +++ trunk/kernel/mactel-patches-2.6.22/sigmatel_audio3.patch 2007-06-16 09:05:44 UTC (rev 128) @@ -9,10 +9,10 @@ 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c -index 6dea603..0ed865c 100644 +index 686a15a..89ee79b 100644 --- a/sound/pci/hda/patch_sigmatel.c +++ b/sound/pci/hda/patch_sigmatel.c -@@ -1991,6 +1991,7 @@ static int patch_stac922x(struct hda_codec *codec) +@@ -2040,6 +2040,7 @@ static int patch_stac922x(struct hda_codec *codec) case 0x106b0a00: /* MacBook First generatoin */ spec->board_config = STAC_MACBOOK; break; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nbo...@us...> - 2007-06-24 09:03:50
|
Revision: 132 http://svn.sourceforge.net/mactel-linux/?rev=132&view=rev Author: nboichat Date: 2007-06-24 02:03:48 -0700 (Sun, 24 Jun 2007) Log Message: ----------- Add 2 patches provided on the lists. Modified Paths: -------------- trunk/kernel/mactel-patches-2.6.22/series Added Paths: ----------- trunk/kernel/mactel-patches-2.6.22/appletouch-fix-run-amok-problem.patch trunk/kernel/mactel-patches-2.6.22/appletouch-shut-up-when-it-has-nothing-to-say.patch Added: trunk/kernel/mactel-patches-2.6.22/appletouch-fix-run-amok-problem.patch =================================================================== --- trunk/kernel/mactel-patches-2.6.22/appletouch-fix-run-amok-problem.patch (rev 0) +++ trunk/kernel/mactel-patches-2.6.22/appletouch-fix-run-amok-problem.patch 2007-06-24 09:03:48 UTC (rev 132) @@ -0,0 +1,32 @@ +The attached patch tries to resolve the 'appletouch runs amok' problem. + +From: Soeren Sonnenburg <mac...@nn...> + + +--- + + drivers/input/mouse/appletouch.c | 10 +++++++++- + 1 files changed, 9 insertions(+), 1 deletions(-) + +diff --git a/drivers/input/mouse/appletouch.c b/drivers/input/mouse/appletouch.c +index 724bcd4..6b7aefe 100644 +--- a/drivers/input/mouse/appletouch.c ++++ b/drivers/input/mouse/appletouch.c +@@ -502,8 +502,16 @@ static void atp_complete(struct urb* urb) + several hundred times a second */ + if (atp_is_geyser_3(dev)) { + dev->idlecount++; +- if (dev->idlecount == 10) ++ if (dev->idlecount == 10) { ++ if (dev->data[dev->datalen-1] != 20) ++ input_report_key(dev->input, BTN_LEFT, ++ !!dev->data[dev->datalen - 1]); ++ ++ input_sync(dev->input); + schedule_work (&dev->work); ++ ++ goto exit; ++ } + } + } + Added: trunk/kernel/mactel-patches-2.6.22/appletouch-shut-up-when-it-has-nothing-to-say.patch =================================================================== --- trunk/kernel/mactel-patches-2.6.22/appletouch-shut-up-when-it-has-nothing-to-say.patch (rev 0) +++ trunk/kernel/mactel-patches-2.6.22/appletouch-shut-up-when-it-has-nothing-to-say.patch 2007-06-24 09:03:48 UTC (rev 132) @@ -0,0 +1,153 @@ +The appletouch devices found in the Intel Macs (and possibly some later PPC ones?) send a constant stream of packets after the first touch. This results in the kernel waking up around once every couple of milliseconds to process them, making it almost impossible to spend any significant period of time in C3 state on a dynamic HZ kernel. Sending the mode initialisation code makes the device shut up until it's touched again. This patch does so after receiving 10 packets with no interesting content. + +From: Matthew Garrett <mj...@sr...> + + +--- + + drivers/input/mouse/appletouch.c | 93 ++++++++++++++++++++++++++------------ + 1 files changed, 63 insertions(+), 30 deletions(-) + +diff --git a/drivers/input/mouse/appletouch.c b/drivers/input/mouse/appletouch.c +index c26af96..724bcd4 100644 +--- a/drivers/input/mouse/appletouch.c ++++ b/drivers/input/mouse/appletouch.c +@@ -155,6 +155,8 @@ struct atp { + 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; + }; + + #define dbg_dump(msg, tab) \ +@@ -208,6 +210,51 @@ static inline int atp_is_geyser_3(struct atp *dev) + (productId == GEYSER4_JIS_PRODUCT_ID); + } + ++static int atp_geyser3_init(struct usb_device *udev) ++{ ++ char data[8]; ++ int size; ++ ++ 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); ++ ++ if (size != 8) { ++ err("Could not do mode read request from device" ++ " (Geyser 3 mode)"); ++ return -EIO; ++ } ++ ++ /* Apply the mode switch */ ++ 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); ++ ++ if (size != 8) { ++ err("Could not do mode write request to device" ++ " (Geyser 3 mode)"); ++ return -EIO; ++ } ++ return 0; ++} ++ ++/* Reinitialise the device if it's a geyser 3 */ ++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); ++} ++ + static int atp_calculate_abs(int *xy_sensors, int nb_sensors, int fact, + int *z, int *fingers) + { +@@ -441,7 +488,6 @@ static void atp_complete(struct urb* urb) + dev->y_old = y; + } + else if (!x && !y) { +- + dev->x_old = dev->y_old = -1; + input_report_key(dev->input, BTN_TOUCH, 0); + input_report_abs(dev->input, ABS_PRESSURE, 0); +@@ -449,10 +495,21 @@ 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 (atp_is_geyser_3(dev)) { ++ dev->idlecount++; ++ if (dev->idlecount == 10) ++ schedule_work (&dev->work); ++ } + } + +- input_report_key(dev->input, BTN_LEFT, +- !!dev->data[dev->datalen - 1]); ++ if (dev->data[dev->datalen-1] != 20) ++ input_report_key(dev->input, BTN_LEFT, ++ !!dev->data[dev->datalen - 1]); + + input_sync(dev->input); + +@@ -533,35 +590,9 @@ static int atp_probe(struct usb_interface *iface, const struct usb_device_id *id + * packets (Report ID 2). This code changes device mode, so it + * sends raw sensor reports (Report ID 5). + */ +- char data[8]; +- int size; +- +- 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); +- +- if (size != 8) { +- err("Could not do mode read request from device" +- " (Geyser 3 mode)"); ++ if (atp_geyser3_init(udev)) + goto err_free_devs; +- } + +- /* Apply the mode switch */ +- 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); +- +- if (size != 8) { +- err("Could not do mode write request to device" +- " (Geyser 3 mode)"); +- goto err_free_devs; +- } + printk("appletouch Geyser 3 inited.\n"); + } + +@@ -636,6 +667,8 @@ 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); + ++ INIT_WORK(&dev->work, atp_reinit); ++ + return 0; + + err_free_buffer: Modified: trunk/kernel/mactel-patches-2.6.22/series =================================================================== --- trunk/kernel/mactel-patches-2.6.22/series 2007-06-19 17:59:55 UTC (rev 131) +++ trunk/kernel/mactel-patches-2.6.22/series 2007-06-24 09:03:48 UTC (rev 132) @@ -1,7 +1,9 @@ -# This series applies on GIT commit de7f928ca460005086a8296be07c217aac4b625d +# This series applies on GIT commit 75154f402ef18e459ff97ddece25656b6c2b329c sigmatel_audio2.patch sigmatel_audio3.patch applesmc_int.patch appletouch.patch appleir.patch applesmc-use-input-polldev.patch +appletouch-shut-up-when-it-has-nothing-to-say.patch +appletouch-fix-run-amok-problem.patch This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nbo...@us...> - 2007-06-27 13:14:49
|
Revision: 133 http://svn.sourceforge.net/mactel-linux/?rev=133&view=rev Author: nboichat Date: 2007-06-27 06:14:46 -0700 (Wed, 27 Jun 2007) Log Message: ----------- Fix Macbook temperature readings. Fix some patches using checkpatch.pl Modified Paths: -------------- trunk/kernel/mactel-patches-2.6.22/appleir.patch trunk/kernel/mactel-patches-2.6.22/applesmc-use-input-polldev.patch trunk/kernel/mactel-patches-2.6.22/applesmc_int.patch trunk/kernel/mactel-patches-2.6.22/series Added Paths: ----------- trunk/kernel/mactel-patches-2.6.22/applesmc-add-macbook-temperature-keys.patch Modified: trunk/kernel/mactel-patches-2.6.22/appleir.patch =================================================================== --- trunk/kernel/mactel-patches-2.6.22/appleir.patch 2007-06-24 09:03:48 UTC (rev 132) +++ trunk/kernel/mactel-patches-2.6.22/appleir.patch 2007-06-27 13:14:46 UTC (rev 133) @@ -44,7 +44,7 @@ obj-$(CONFIG_INPUT_YEALINK) += yealink.o diff --git a/drivers/input/misc/appleir.c b/drivers/input/misc/appleir.c new file mode 100644 -index 0000000..170cee6 +index 0000000..3ff46fc --- /dev/null +++ b/drivers/input/misc/appleir.c @@ -0,0 +1,379 @@ @@ -110,7 +110,7 @@ + + +static struct usb_device_id appleir_ids[] = { -+ { ++ { + USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_IR), + .driver_info = 0 + }, @@ -145,7 +145,7 @@ +}; + +static void dump_packet(struct appleir *appleir, char *msg, -+ uint8_t * data, int len) ++ uint8_t *data, int len) +{ + int i; + @@ -184,7 +184,7 @@ + +static void key_up_tick(unsigned long data) +{ -+ struct appleir *apple_ir = (struct appleir*)data; ++ struct appleir *apple_ir = (struct appleir *)data; + + if (apple_ir->current_key) { + key_up(apple_ir, apple_ir->current_key); @@ -205,7 +205,7 @@ + return; + + if (!memcmp(data, keydown, sizeof(keydown))) { -+ /* ++ /* + * If we already have a key down, take it up before marking + * this one down. + */ @@ -416,7 +416,7 @@ + if (retval) + goto out; + info(DRIVER_VERSION ":" DRIVER_DESC); -+ out: ++out: + return retval; +} + Added: trunk/kernel/mactel-patches-2.6.22/applesmc-add-macbook-temperature-keys.patch =================================================================== --- trunk/kernel/mactel-patches-2.6.22/applesmc-add-macbook-temperature-keys.patch (rev 0) +++ trunk/kernel/mactel-patches-2.6.22/applesmc-add-macbook-temperature-keys.patch 2007-06-27 13:14:46 UTC (rev 133) @@ -0,0 +1,46 @@ +Fix AppleSMC registers on non-pro Macbooks. + +From: Martin Szulecki <ma...@su...> + + +--- + + drivers/hwmon/applesmc.c | 14 +++++++++----- + 1 files changed, 9 insertions(+), 5 deletions(-) + +diff --git a/drivers/hwmon/applesmc.c b/drivers/hwmon/applesmc.c +index eb81a64..232cbad 100644 +--- a/drivers/hwmon/applesmc.c ++++ b/drivers/hwmon/applesmc.c +@@ -79,11 +79,15 @@ + + /* + * Temperature sensors keys (sp78 - 2 bytes). +- * First set for Macbook(Pro), second for Macmini. + */ + static const char* temperature_sensors_sets[][13] = { ++/* Set 0: Macbook Pro */ + { "TA0P", "TB0T", "TC0D", "TC0P", "TG0H", "TG0P", "TG0T", "Th0H", + "Th1H", "Tm0P", "Ts0P", "Ts1P", NULL }, ++/* Set 1: Macbook set */ ++ { "TB0T", "TC0D", "TC0P", "TM0P", "TN0P", "TN1P", "Th0H", "Th0S", ++ "Th1H", "Ts0P", NULL }, ++/* Set 2: Macmini set */ + { "TC0D", "TC0P", NULL } + }; + +@@ -1129,10 +1133,10 @@ 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 0 */ +- { .accelerometer = 1, .light = 0, .temperature_set = 0 }, +-/* MacBook: temperature set 1 */ +- { .accelerometer = 0, .light = 0, .temperature_set = 1 } ++/* MacBook: accelerometer and temperature set 1 */ ++ { .accelerometer = 1, .light = 0, .temperature_set = 1 }, ++/* MacMini: temperature set 2 */ ++ { .accelerometer = 0, .light = 0, .temperature_set = 2 } + }; + + /* Note that DMI_MATCH(...,"MacBook") will match "MacBookPro1,1". Modified: trunk/kernel/mactel-patches-2.6.22/applesmc-use-input-polldev.patch =================================================================== --- trunk/kernel/mactel-patches-2.6.22/applesmc-use-input-polldev.patch 2007-06-24 09:03:48 UTC (rev 132) +++ trunk/kernel/mactel-patches-2.6.22/applesmc-use-input-polldev.patch 2007-06-27 13:14:46 UTC (rev 133) @@ -26,7 +26,7 @@ help This driver provides support for the Apple System Management diff --git a/drivers/hwmon/applesmc.c b/drivers/hwmon/applesmc.c -index e523851..ff56afd 100644 +index fd1281f..eb81a64 100644 --- a/drivers/hwmon/applesmc.c +++ b/drivers/hwmon/applesmc.c @@ -28,7 +28,7 @@ @@ -38,7 +38,7 @@ #include <linux/kernel.h> #include <linux/module.h> #include <linux/timer.h> -@@ -67,9 +67,9 @@ +@@ -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) */ @@ -50,7 +50,7 @@ #define MOTION_SENSOR_X_KEY "MO_X" /* r-o sp78 (2 bytes) */ #define MOTION_SENSOR_Y_KEY "MO_Y" /* r-o sp78 (2 bytes) */ -@@ -120,7 +120,7 @@ static const char* fan_speed_keys[] = { +@@ -99,7 +99,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 */ @@ -59,7 +59,7 @@ #define APPLESMC_INPUT_FUZZ 4 /* input event threshold */ #define APPLESMC_INPUT_FLAT 4 -@@ -142,8 +142,7 @@ static const int debug; +@@ -121,8 +121,7 @@ static const int debug; static struct platform_device *pdev; static s16 rest_x; static s16 rest_y; @@ -69,7 +69,7 @@ static struct class_device *hwmon_class_dev; /* Indicates whether this computer has an accelerometer. */ -@@ -155,7 +154,7 @@ static unsigned int applesmc_light; +@@ -134,7 +133,7 @@ static unsigned int applesmc_light; /* Indicates which temperature sensors set to use. */ static unsigned int applesmc_temperature_set; @@ -78,7 +78,7 @@ /* * Last index written to key_at_index sysfs file, and value to use for all other -@@ -593,27 +592,12 @@ static void applesmc_calibrate(void) +@@ -451,27 +450,12 @@ static void applesmc_calibrate(void) rest_x = -rest_x; } @@ -109,7 +109,7 @@ if (applesmc_read_motion_sensor(SENSOR_X, &x)) goto out; -@@ -621,13 +605,11 @@ static void applesmc_idev_poll(unsigned long unused) +@@ -479,13 +463,11 @@ static void applesmc_idev_poll(unsigned long unused) goto out; x = -x; @@ -126,7 +126,7 @@ mutex_unlock(&applesmc_lock); } -@@ -959,8 +941,7 @@ static ssize_t applesmc_key_at_index_read_show(struct device *dev, +@@ -817,8 +799,7 @@ static ssize_t applesmc_key_at_index_read_show(struct device *dev, if (!ret) { return info[0]; @@ -136,7 +136,7 @@ return ret; } } -@@ -1359,6 +1340,7 @@ static int applesmc_dmi_match(struct dmi_system_id *id) +@@ -1089,6 +1070,7 @@ static int applesmc_dmi_match(struct dmi_system_id *id) /* Create accelerometer ressources */ static int applesmc_create_accelerometer(void) { @@ -144,7 +144,7 @@ int ret; ret = sysfs_create_group(&pdev->dev.kobj, -@@ -1366,40 +1348,37 @@ static int applesmc_create_accelerometer(void) +@@ -1096,40 +1078,37 @@ static int applesmc_create_accelerometer(void) if (ret) goto out; @@ -199,7 +199,7 @@ out_sysfs: sysfs_remove_group(&pdev->dev.kobj, &accelerometer_attributes_group); -@@ -1412,8 +1391,8 @@ out: +@@ -1142,8 +1121,8 @@ out: /* Release all ressources used by the accelerometer */ static void applesmc_release_accelerometer(void) { @@ -210,7 +210,7 @@ sysfs_remove_group(&pdev->dev.kobj, &accelerometer_attributes_group); } -@@ -1450,8 +1429,6 @@ static int __init applesmc_init(void) +@@ -1180,8 +1159,6 @@ static int __init applesmc_init(void) int count; int i; Modified: trunk/kernel/mactel-patches-2.6.22/applesmc_int.patch =================================================================== --- trunk/kernel/mactel-patches-2.6.22/applesmc_int.patch 2007-06-24 09:03:48 UTC (rev 132) +++ trunk/kernel/mactel-patches-2.6.22/applesmc_int.patch 2007-06-27 13:14:46 UTC (rev 133) @@ -5,11 +5,11 @@ --- - drivers/hwmon/applesmc.c | 316 +++++++++++++++++++++++++++++++++++++++++++--- - 1 files changed, 293 insertions(+), 23 deletions(-) + drivers/hwmon/applesmc.c | 321 +++++++++++++++++++++++++++++++++++++++++++--- + 1 files changed, 298 insertions(+), 23 deletions(-) diff --git a/drivers/hwmon/applesmc.c b/drivers/hwmon/applesmc.c -index fd1281f..e523851 100644 +index 232cbad..933a72d 100644 --- a/drivers/hwmon/applesmc.c +++ b/drivers/hwmon/applesmc.c @@ -39,14 +39,20 @@ @@ -41,12 +41,12 @@ + #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) */ @@ -68,6 +76,19 @@ #define MOTION_SENSOR_Z_KEY "MO_Z" /* r-o sp78 (2 bytes) */ #define MOTION_SENSOR_KEY "MOCN" /* r/w ui16 */ -+/* ++/* + * Interrupt controls. + * If the norm of the position (sqrt(MO_X^2+MO_Y^2+MO_Z^2)) is smaller than + * MOLT (free fall), or bigger than MOHT (high acceleration) for longer than the @@ -62,18 +62,18 @@ #define FANS_COUNT "FNum" /* r-o ui8 */ #define FANS_MANUAL "FS! " /* r-w ui16 */ #define FAN_ACTUAL_SPEED "F0Ac" /* r-o fpe2 (2 bytes) */ -@@ -348,12 +369,79 @@ static int applesmc_read_motion_sensor(int index, s16* value) +@@ -351,12 +372,83 @@ static int applesmc_read_motion_sensor(int index, s16* value) } /* -+ * applesmc_init_check_key_value - checks if a given key contains the bytes in ++ * applesmc_init_check_key_value - checks if a given key contains the bytes in + * buffer, if not, writes these bytes. + * In case of failure retry every INIT_WAIT_MSECS msec, and timeout if it + * waited more than INIT_TIMEOUT_MSECS in total. + * Returns zero on success or a negative error on failure. Callers must + * hold applesmc_lock. + */ -+static int applesmc_init_check_key_value(const char* key, u8* buffer, u8 len) ++static int applesmc_init_check_key_value(const char *key, u8 *buffer, u8 len) +{ + int total, ret, i, compare; + u8 rdbuffer[APPLESMC_MAX_DATA_LENGTH]; @@ -86,7 +86,8 @@ + } + + for (total = INIT_TIMEOUT_MSECS; total > 0; total -= INIT_WAIT_MSECS) { -+ if (!(ret = applesmc_read_key(key, rdbuffer, len))) { ++ ret = applesmc_read_key(key, rdbuffer, len); ++ if (!ret) { + compare = 1; + for (i = 0; i < len; i++) { + if (rdbuffer[i] != buffer[i]) { @@ -97,7 +98,7 @@ + + if (compare) { + return 0; -+ } ++ } + } + ret = applesmc_write_key(key, buffer, len); + msleep(INIT_WAIT_MSECS); @@ -115,17 +116,20 @@ + + switch (int_type) { + case 0x60: -+ printk("applesmc: received a free fall interrupt\n"); ++ printk(KERN_INFO "applesmc: received a free fall interrupt\n"); + break; + case 0x6f: -+ printk("applesmc: received a high acceleration interrupt\n"); ++ printk(KERN_INFO ++ "applesmc: received a high acceleration interrupt\n"); + break; + case 0x80: -+ printk("applesmc: received a shock interrupt\n"); ++ printk(KERN_INFO "applesmc: received a shock interrupt\n"); + break; + default: -+ printk("applesmc: received an unknown interrupt %x\n", int_type); -+ } ++ printk(KERN_INFO ++ "applesmc: received an unknown interrupt %x\n", ++ int_type); ++ } + + return IRQ_HANDLED; +} @@ -143,7 +147,7 @@ u8 buffer[2]; if (!applesmc_accelerometer) -@@ -361,32 +449,79 @@ static int applesmc_device_init(void) +@@ -364,32 +456,79 @@ static int applesmc_device_init(void) mutex_lock(&applesmc_lock); @@ -172,7 +176,7 @@ - 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; @@ -193,9 +197,10 @@ + if (ret1 || ret2) { + printk(KERN_WARNING "applesmc: Cannot set motion sensor " + "interrupt interval, might not receive " -+ "some interrupts."); -+ } -+ ++ "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); @@ -207,14 +212,14 @@ + if (ret1 || ret2) { + printk(KERN_WARNING "applesmc: Cannot set motion sensor " + "min/max norm parameters, " -+ "might not receive some interrupts."); ++ "might not receive some interrupts."); + } + + /* Mysterious key. */ + 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; @@ -229,9 +234,8 @@ + 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); + @@ -245,7 +249,7 @@ out: mutex_unlock(&applesmc_lock); -@@ -431,9 +566,16 @@ static int applesmc_resume(struct platform_device *dev) +@@ -434,9 +573,16 @@ static int applesmc_resume(struct platform_device *dev) return applesmc_device_init(); } @@ -262,7 +266,7 @@ .driver = { .name = "applesmc", .owner = THIS_MODULE, -@@ -913,6 +1055,122 @@ static ssize_t applesmc_key_at_index_store(struct device *dev, +@@ -898,6 +1044,123 @@ static ssize_t applesmc_key_at_index_store(struct device *dev, return count; } @@ -272,12 +276,12 @@ + int ret; + unsigned int value = 0; + u8 buffer[2]; -+ char* key; ++ char *key; + int length; + struct sensor_device_attribute_2 *sensor_attr = + to_sensor_dev_attr_2(attr); + -+ switch(sensor_attr->index) { ++ switch (sensor_attr->index) { + case 0: + key = MOTION_LOW_NORM_INTERVAL; + length = 1; @@ -295,7 +299,8 @@ + length = 2; + break; + default: -+ printk("Invalid index for applesmc_accelerometer_show"); ++ printk(KERN_ERR ++ "Invalid index for applesmc_accelerometer_show"); + return -EINVAL; + } + @@ -325,12 +330,12 @@ + int ret; + u32 value; + u8 buffer[2]; -+ char* key; ++ char *key; + int length; + struct sensor_device_attribute_2 *sensor_attr = + to_sensor_dev_attr_2(attr); + -+ switch(sensor_attr->index) { ++ switch (sensor_attr->index) { + case 0: + key = MOTION_LOW_NORM_INTERVAL; + length = 1; @@ -385,7 +390,7 @@ static struct led_classdev applesmc_backlight = { .name = "smc:kbd_backlight", .default_trigger = "nand-disk", -@@ -924,10 +1182,22 @@ static DEVICE_ATTR(name, 0444, applesmc_name_show, NULL); +@@ -909,10 +1172,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); Modified: trunk/kernel/mactel-patches-2.6.22/series =================================================================== --- trunk/kernel/mactel-patches-2.6.22/series 2007-06-24 09:03:48 UTC (rev 132) +++ trunk/kernel/mactel-patches-2.6.22/series 2007-06-27 13:14:46 UTC (rev 133) @@ -1,9 +1,10 @@ -# This series applies on GIT commit 75154f402ef18e459ff97ddece25656b6c2b329c +# This series applies on GIT commit 48d8d7ee5dd17c64833e0343ab4ae8ef01cc2648 +applesmc-use-input-polldev.patch +applesmc-add-macbook-temperature-keys.patch sigmatel_audio2.patch sigmatel_audio3.patch applesmc_int.patch appletouch.patch appleir.patch -applesmc-use-input-polldev.patch appletouch-shut-up-when-it-has-nothing-to-say.patch appletouch-fix-run-amok-problem.patch This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nbo...@us...> - 2007-07-12 13:56:55
|
Revision: 134 http://svn.sourceforge.net/mactel-linux/?rev=134&view=rev Author: nboichat Date: 2007-07-12 06:56:52 -0700 (Thu, 12 Jul 2007) Log Message: ----------- Minor change in applesmc_int.patch Modified Paths: -------------- trunk/kernel/mactel-patches-2.6.22/applesmc_int.patch trunk/kernel/mactel-patches-2.6.22/series Modified: trunk/kernel/mactel-patches-2.6.22/applesmc_int.patch =================================================================== --- trunk/kernel/mactel-patches-2.6.22/applesmc_int.patch 2007-06-27 13:14:46 UTC (rev 133) +++ trunk/kernel/mactel-patches-2.6.22/applesmc_int.patch 2007-07-12 13:56:52 UTC (rev 134) @@ -1,4 +1,4 @@ -Interrupt support for the accelerometer. +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 <ni...@bo...> @@ -9,7 +9,7 @@ 1 files changed, 298 insertions(+), 23 deletions(-) diff --git a/drivers/hwmon/applesmc.c b/drivers/hwmon/applesmc.c -index 232cbad..933a72d 100644 +index 232cbad..c022c98 100644 --- a/drivers/hwmon/applesmc.c +++ b/drivers/hwmon/applesmc.c @@ -39,14 +39,20 @@ @@ -255,7 +255,7 @@ +static int applesmc_remove(struct platform_device *dev) +{ -+ free_irq(6, NULL); ++ free_irq(APPLESMC_IRQ, NULL); + return 0; +} + Modified: trunk/kernel/mactel-patches-2.6.22/series =================================================================== --- trunk/kernel/mactel-patches-2.6.22/series 2007-06-27 13:14:46 UTC (rev 133) +++ trunk/kernel/mactel-patches-2.6.22/series 2007-07-12 13:56:52 UTC (rev 134) @@ -1,4 +1,4 @@ -# This series applies on GIT commit 48d8d7ee5dd17c64833e0343ab4ae8ef01cc2648 +# This series applies on GIT commit f44bba1a92e01bbab6ca9817b86ddf9e1744a616 applesmc-use-input-polldev.patch applesmc-add-macbook-temperature-keys.patch sigmatel_audio2.patch This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nbo...@us...> - 2007-07-17 18:50:43
|
Revision: 135 http://svn.sourceforge.net/mactel-linux/?rev=135&view=rev Author: nboichat Date: 2007-07-17 11:50:21 -0700 (Tue, 17 Jul 2007) Log Message: ----------- - Remove appleir.patch and unblacklist Apple IR from usbhid, not needed anymore, as lirc supports the remote using the driver "macmini". - Latest update of the appletouch patch. Modified Paths: -------------- trunk/kernel/mactel-patches-2.6.22/appletouch-shut-up-when-it-has-nothing-to-say.patch trunk/kernel/mactel-patches-2.6.22/series Added Paths: ----------- trunk/kernel/mactel-patches-2.6.22/appleir-undo-hid-blacklist.patch Removed Paths: ------------- trunk/kernel/mactel-patches-2.6.22/appleir.patch trunk/kernel/mactel-patches-2.6.22/appletouch-fix-run-amok-problem.patch Added: trunk/kernel/mactel-patches-2.6.22/appleir-undo-hid-blacklist.patch =================================================================== --- trunk/kernel/mactel-patches-2.6.22/appleir-undo-hid-blacklist.patch (rev 0) +++ trunk/kernel/mactel-patches-2.6.22/appleir-undo-hid-blacklist.patch 2007-07-17 18:50:21 UTC (rev 135) @@ -0,0 +1,30 @@ +Undo USB HID blacklisting of Apple IR, as it is support by lirc now. + +From: Nicolas Boichat <ni...@bo...> + + +--- + + drivers/hid/usbhid/hid-quirks.c | 2 -- + 1 files changed, 0 insertions(+), 2 deletions(-) + +diff --git a/drivers/hid/usbhid/hid-quirks.c b/drivers/hid/usbhid/hid-quirks.c +index f6c4145..3e64d56 100644 +--- a/drivers/hid/usbhid/hid-quirks.c ++++ b/drivers/hid/usbhid/hid-quirks.c +@@ -61,7 +61,6 @@ + #define USB_DEVICE_ID_APPLE_GEYSER4_JIS 0x021c + #define USB_DEVICE_ID_APPLE_FOUNTAIN_TP_ONLY 0x030a + #define USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY 0x030b +-#define USB_DEVICE_ID_APPLE_IR 0x8240 + + #define USB_VENDOR_ID_ATEN 0x0557 + #define USB_DEVICE_ID_ATEN_UC100KM 0x2004 +@@ -300,7 +299,6 @@ static const struct hid_blacklist { + { USB_VENDOR_ID_AIPTEK, USB_DEVICE_ID_AIPTEK_24, HID_QUIRK_IGNORE }, + { USB_VENDOR_ID_AIRCABLE, USB_DEVICE_ID_AIRCABLE1, HID_QUIRK_IGNORE }, + { USB_VENDOR_ID_ALCOR, USB_DEVICE_ID_ALCOR_USBRS232, HID_QUIRK_IGNORE }, +- { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_IR, HID_QUIRK_IGNORE }, + { USB_VENDOR_ID_BERKSHIRE, USB_DEVICE_ID_BERKSHIRE_PCWD, HID_QUIRK_IGNORE }, + { USB_VENDOR_ID_CIDC, 0x0103, HID_QUIRK_IGNORE }, + { USB_VENDOR_ID_CYPRESS, USB_DEVICE_ID_CYPRESS_HIDCOM, HID_QUIRK_IGNORE }, Deleted: trunk/kernel/mactel-patches-2.6.22/appleir.patch =================================================================== --- trunk/kernel/mactel-patches-2.6.22/appleir.patch 2007-07-12 13:56:52 UTC (rev 134) +++ trunk/kernel/mactel-patches-2.6.22/appleir.patch 2007-07-17 18:50:21 UTC (rev 135) @@ -1,429 +0,0 @@ -Apple IR patch. - -From: James McKenzie <ma...@ma...> - - ---- - - drivers/input/misc/Kconfig | 5 + - drivers/input/misc/Makefile | 1 - drivers/input/misc/appleir.c | 379 ++++++++++++++++++++++++++++++++++++++++++ - 3 files changed, 385 insertions(+), 0 deletions(-) - -diff --git a/drivers/input/misc/Kconfig b/drivers/input/misc/Kconfig -index 88e2907..d2d629a 100644 ---- a/drivers/input/misc/Kconfig -+++ b/drivers/input/misc/Kconfig -@@ -113,6 +113,10 @@ config INPUT_ATI_REMOTE2 - To compile this driver as a module, choose M here: the module will be - called ati_remote2. - -+config USB_APPLEIR -+ tristate "Apple Mac Mini USB IR receiver (built in)" -+ depends on USB && INPUT -+ - config INPUT_KEYSPAN_REMOTE - tristate "Keyspan DMR USB remote control (EXPERIMENTAL)" - depends on EXPERIMENTAL -@@ -179,3 +183,4 @@ config HP_SDC_RTC - of the HP SDC controller. - - endif -+ -diff --git a/drivers/input/misc/Makefile b/drivers/input/misc/Makefile -index 3585b50..f73f139 100644 ---- a/drivers/input/misc/Makefile -+++ b/drivers/input/misc/Makefile -@@ -13,6 +13,7 @@ obj-$(CONFIG_INPUT_WISTRON_BTNS) += wistron_btns.o - obj-$(CONFIG_INPUT_ATLAS_BTNS) += atlas_btns.o - obj-$(CONFIG_INPUT_ATI_REMOTE) += ati_remote.o - obj-$(CONFIG_INPUT_ATI_REMOTE2) += ati_remote2.o -+obj-$(CONFIG_USB_APPLEIR) += appleir.o - obj-$(CONFIG_INPUT_KEYSPAN_REMOTE) += keyspan_remote.o - obj-$(CONFIG_INPUT_POWERMATE) += powermate.o - obj-$(CONFIG_INPUT_YEALINK) += yealink.o -diff --git a/drivers/input/misc/appleir.c b/drivers/input/misc/appleir.c -new file mode 100644 -index 0000000..3ff46fc ---- /dev/null -+++ b/drivers/input/misc/appleir.c -@@ -0,0 +1,379 @@ -+/* -+ * drivers/usb/input/appleir.c - driver for Apple Intel-based Macs IR Receiver -+ * -+ * Copyright (C) 2006 James McKenzie <ma...@ma...> -+ * -+ * This program is free software; you can redistribute it and/or modify it -+ * under the terms of the GNU General Public License v2 as published by the -+ * Free Software Foundation. -+ * -+ * This program is distributed in the hope that it will be useful, but WITHOUT -+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -+ * more details. -+ * -+ * You should have received a copy of the GNU General Public License along with -+ * this program; if not, write to the Free Software Foundation, Inc., -+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA -+ */ -+ -+#include <linux/kernel.h> -+#include <linux/slab.h> -+#include <linux/input.h> -+#include <linux/module.h> -+#include <linux/init.h> -+#include <linux/usb.h> -+#include <linux/usb/input.h> -+#include <linux/mutex.h> -+#include <asm/unaligned.h> -+#include <asm/byteorder.h> -+ -+#define DRIVER_VERSION "v1.2" -+#define DRIVER_AUTHOR "James McKenzie" -+#define DRIVER_DESC "USB Apple MacIntel IR Receiver driver" -+#define DRIVER_LICENSE "GPL" -+ -+MODULE_AUTHOR(DRIVER_AUTHOR); -+MODULE_DESCRIPTION(DRIVER_DESC); -+MODULE_LICENSE(DRIVER_LICENSE); -+ -+#define USB_VENDOR_ID_APPLE 0x05ac -+#define USB_DEVICE_ID_APPLE_IR 0x8240 -+ -+#define URB_SIZE 32 -+ -+#define MAX_KEYS 8 -+#define MAX_KEYS_MASK (MAX_KEYS - 1) -+ -+static int debug = 1; -+ -+struct appleir { -+ struct input_dev *dev; -+ uint8_t *data; -+ dma_addr_t dma_buf; -+ struct usb_device *usbdev; -+ struct urb *urb; -+ struct timer_list key_up_timer; -+ int current_key; -+ char phys[32]; -+}; -+ -+ -+static struct usb_device_id appleir_ids[] = { -+ { -+ USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_IR), -+ .driver_info = 0 -+ }, -+ {} -+}; -+ -+MODULE_DEVICE_TABLE(usb, appleir_ids); -+ -+/* -+ * Devices report the following, where XX depends on the remote and/or the -+ * receiver (at least 2a, 83, ca, ee have been reported as possible values, it -+ * looks like it is remote control dependent). -+ * The fifth byte's LSB also depends on the hardware. -+ * 25 87 ee XX 0a/0b + -+ * 25 87 ee XX 0c/0d - -+ * 25 87 ee XX 09/08 << -+ * 25 87 ee XX 06/07 >> -+ * 25 87 ee XX 05/04 >" -+ * 25 87 ee 83 03/02 menu -+ * 26 00 00 00 00 for key repeat -+ * -+ * Thomas Glanzmann also observes the following event sometimes sent after a key -+ * is released, which I interpret as a flat battery message: -+ * 25 87 e0 ca 06 flat battery -+ */ -+ -+static int keymap[MAX_KEYS] = { -+ KEY_RESERVED, KEY_MENU, -+ KEY_PLAYPAUSE, KEY_NEXTSONG, -+ KEY_PREVIOUSSONG, KEY_VOLUMEUP, -+ KEY_VOLUMEDOWN, KEY_RESERVED -+}; -+ -+static void dump_packet(struct appleir *appleir, char *msg, -+ uint8_t *data, int len) -+{ -+ int i; -+ -+ printk(KERN_ERR "appleir: %s (%d bytes)", msg, len); -+ -+ for (i = 0; i < len; ++i) { -+ printk(" %02x", data[i]); -+ } -+ -+ printk("\n"); -+} -+ -+ -+static void key_up(struct appleir *appleir, int key) -+{ -+ if (debug) -+ printk (KERN_DEBUG "key %d up\n", key); -+ -+ input_report_key(appleir->dev, key, 0); -+ input_sync(appleir->dev); -+} -+ -+static void key_down(struct appleir *appleir, int key) -+{ -+ if (debug) -+ printk (KERN_DEBUG "key %d down\n", key); -+ -+ input_report_key(appleir->dev, key, 1); -+ input_sync(appleir->dev); -+} -+ -+static void battery_flat(struct appleir *appleir) -+{ -+ printk(KERN_WARNING "appleir: possible flat battery?\n"); -+} -+ -+static void key_up_tick(unsigned long data) -+{ -+ struct appleir *apple_ir = (struct appleir *)data; -+ -+ if (apple_ir->current_key) { -+ key_up(apple_ir, apple_ir->current_key); -+ apple_ir->current_key = 0; -+ } -+} -+ -+static void parse_data(struct appleir *apple_ir, uint8_t *data, int len) -+{ -+ static const uint8_t keydown[] = { 0x25, 0x87, 0xee }; -+ static const uint8_t keyrepeat[] = { 0x26, 0x00, 0x00, 0x00, 0x00 }; -+ static const uint8_t flatbattery[] = { 0x25, 0x87, 0xe0 }; -+ -+ if (debug) -+ dump_packet(apple_ir, "received", data, len); -+ -+ if (len != 5) -+ return; -+ -+ if (!memcmp(data, keydown, sizeof(keydown))) { -+ /* -+ * If we already have a key down, take it up before marking -+ * this one down. -+ */ -+ if (apple_ir->current_key) -+ key_up(apple_ir, apple_ir->current_key); -+ apple_ir->current_key = keymap[(data[4] >> 1) & MAX_KEYS_MASK]; -+ -+ key_down(apple_ir, apple_ir->current_key); -+ -+ /* -+ * Remote doesn't do key up, either pull them up, in the test -+ * above, or here set a timer which pulls them up after 1/8 s -+ */ -+ mod_timer(&apple_ir->key_up_timer, jiffies + HZ / 8); -+ -+ return; -+ } -+ -+ if (!memcmp(data, keyrepeat, sizeof(keyrepeat))) { -+ key_down(apple_ir, apple_ir->current_key); -+ -+ /* -+ * Remote doesn't do key up, either pull them up, in the test -+ * above, or here set a timer which pulls them up after 1/8 s -+ */ -+ mod_timer(&apple_ir->key_up_timer, jiffies + HZ / 8); -+ return; -+ } -+ -+ if (!memcmp(data, flatbattery, sizeof(flatbattery))) { -+ battery_flat(apple_ir); -+ /* Fall through */ -+ } -+ -+ dump_packet(apple_ir, "unknown packet", data, len); -+} -+ -+static void appleir_urb(struct urb *urb) -+{ -+ struct appleir *appleir = urb->context; -+ int retval; -+ -+ switch (urb->status) { -+ case 0: -+ parse_data(appleir, urb->transfer_buffer, urb->actual_length); -+ break; -+ case -ECONNRESET: -+ case -ENOENT: -+ case -ESHUTDOWN: -+ /* this urb is terminated, clean up */ -+ dbg("%s - urb shutting down with status: %d", -+ __FUNCTION__, urb->status); -+ return; -+ default: -+ dbg("%s - nonzero urb status received: %d", -+ __FUNCTION__, urb->status); -+ } -+ -+ retval = usb_submit_urb(urb, GFP_ATOMIC); -+ if (retval) -+ err("%s - usb_submit_urb failed with result %d", -+ __FUNCTION__, retval); -+} -+ -+ -+static int appleir_open(struct input_dev *dev) -+{ -+ struct appleir *appleir = dev->private; -+ -+ if (usb_submit_urb(appleir->urb, GFP_KERNEL)) -+ return -EIO; -+ -+ return 0; -+} -+ -+static void appleir_close(struct input_dev *dev) -+{ -+ struct appleir *appleir = dev->private; -+ usb_kill_urb(appleir->urb); -+ del_timer_sync(&appleir->key_up_timer); -+} -+ -+static int appleir_probe(struct usb_interface *intf, -+ const struct usb_device_id *id) -+{ -+ struct usb_device *dev = interface_to_usbdev(intf); -+ struct usb_endpoint_descriptor *endpoint; -+ struct appleir *appleir = NULL; -+ struct input_dev *input_dev; -+ int i; -+ int ret = -ENOMEM; -+ -+ appleir = kzalloc(sizeof(struct appleir), GFP_KERNEL); -+ if (!appleir) -+ goto fail; -+ -+ memset(appleir, 0, sizeof(struct appleir)); -+ -+ appleir->data = -+ usb_buffer_alloc(dev, URB_SIZE, GFP_KERNEL, &appleir->dma_buf); -+ if (!appleir->data) -+ goto fail_appleir; -+ -+ appleir->urb = usb_alloc_urb(0, GFP_KERNEL); -+ if (!appleir->urb) -+ goto fail_buffer; -+ -+ appleir->usbdev = dev; -+ -+ input_dev = input_allocate_device(); -+ if (!input_dev) -+ goto fail_urb; -+ -+ appleir->dev = input_dev; -+ -+ if (usb_make_path(dev, appleir->phys, sizeof(appleir->phys)) < 0) -+ goto fail_input_device; -+ -+ strlcpy(appleir->phys, "/input0", sizeof(appleir->phys)); -+ -+ input_dev->name = "Apple MacIntel infrared remote control driver"; -+ input_dev->phys = appleir->phys; -+ usb_to_input_id(dev, &input_dev->id); -+ input_dev->cdev.dev = &intf->dev; -+ input_dev->private = appleir; -+ -+ input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REP); -+ input_dev->ledbit[0] = 0; -+ -+ for (i = 0; i < MAX_KEYS; i++) { -+ set_bit(keymap[i], input_dev->keybit); -+ } -+ -+ clear_bit(0, input_dev->keybit); -+ -+ input_dev->open = appleir_open; -+ input_dev->close = appleir_close; -+ -+ endpoint = &intf->cur_altsetting->endpoint[0].desc; -+ -+ usb_fill_int_urb(appleir->urb, dev, -+ usb_rcvintpipe(dev, endpoint->bEndpointAddress), -+ appleir->data, 8, -+ appleir_urb, appleir, endpoint->bInterval); -+ -+ appleir->urb->transfer_dma = appleir->dma_buf; -+ appleir->urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP; -+ -+ usb_set_intfdata(intf, appleir); -+ -+ init_timer(&appleir->key_up_timer); -+ -+ appleir->key_up_timer.function = key_up_tick; -+ appleir->key_up_timer.data = (unsigned long) appleir; -+ -+ ret = input_register_device(appleir->dev); -+ if (ret < 0) -+ goto fail_timer; -+ -+ return 0; -+ -+fail_timer: -+ del_timer_sync(&appleir->key_up_timer); -+ -+fail_input_device: -+ input_free_device(appleir->dev); -+ -+fail_urb: -+ usb_free_urb(appleir->urb); -+ -+fail_buffer: -+ usb_buffer_free(dev, URB_SIZE, appleir->data, appleir->dma_buf); -+ -+fail_appleir: -+ kfree(appleir); -+ -+fail: -+ return ret; -+} -+ -+static void appleir_disconnect(struct usb_interface *intf) -+{ -+ struct appleir *appleir = usb_get_intfdata(intf); -+ -+ usb_set_intfdata(intf, NULL); -+ if (appleir) { -+ input_unregister_device(appleir->dev); -+ del_timer_sync(&appleir->key_up_timer); -+ usb_kill_urb(appleir->urb); -+ usb_free_urb(appleir->urb); -+ usb_buffer_free(interface_to_usbdev(intf), URB_SIZE, -+ appleir->data, appleir->dma_buf); -+ kfree(appleir); -+ } -+} -+ -+static struct usb_driver appleir_driver = { -+ .name = "appleir", -+ .probe = appleir_probe, -+ .disconnect = appleir_disconnect, -+ .id_table = appleir_ids, -+}; -+ -+static int __init appleir_init(void) -+{ -+ int retval; -+ retval = usb_register(&appleir_driver); -+ if (retval) -+ goto out; -+ info(DRIVER_VERSION ":" DRIVER_DESC); -+out: -+ return retval; -+} -+ -+static void __exit appleir_exit(void) -+{ -+ usb_deregister(&appleir_driver); -+} -+ -+module_init(appleir_init); -+module_exit(appleir_exit); Deleted: trunk/kernel/mactel-patches-2.6.22/appletouch-fix-run-amok-problem.patch =================================================================== --- trunk/kernel/mactel-patches-2.6.22/appletouch-fix-run-amok-problem.patch 2007-07-12 13:56:52 UTC (rev 134) +++ trunk/kernel/mactel-patches-2.6.22/appletouch-fix-run-amok-problem.patch 2007-07-17 18:50:21 UTC (rev 135) @@ -1,32 +0,0 @@ -The attached patch tries to resolve the 'appletouch runs amok' problem. - -From: Soeren Sonnenburg <mac...@nn...> - - ---- - - drivers/input/mouse/appletouch.c | 10 +++++++++- - 1 files changed, 9 insertions(+), 1 deletions(-) - -diff --git a/drivers/input/mouse/appletouch.c b/drivers/input/mouse/appletouch.c -index 724bcd4..6b7aefe 100644 ---- a/drivers/input/mouse/appletouch.c -+++ b/drivers/input/mouse/appletouch.c -@@ -502,8 +502,16 @@ static void atp_complete(struct urb* urb) - several hundred times a second */ - if (atp_is_geyser_3(dev)) { - dev->idlecount++; -- if (dev->idlecount == 10) -+ if (dev->idlecount == 10) { -+ if (dev->data[dev->datalen-1] != 20) -+ input_report_key(dev->input, BTN_LEFT, -+ !!dev->data[dev->datalen - 1]); -+ -+ input_sync(dev->input); - schedule_work (&dev->work); -+ -+ goto exit; -+ } - } - } - Modified: trunk/kernel/mactel-patches-2.6.22/appletouch-shut-up-when-it-has-nothing-to-say.patch =================================================================== --- trunk/kernel/mactel-patches-2.6.22/appletouch-shut-up-when-it-has-nothing-to-say.patch 2007-07-12 13:56:52 UTC (rev 134) +++ trunk/kernel/mactel-patches-2.6.22/appletouch-shut-up-when-it-has-nothing-to-say.patch 2007-07-17 18:50:21 UTC (rev 135) @@ -1,42 +1,82 @@ -The appletouch devices found in the Intel Macs (and possibly some later PPC ones?) send a constant stream of packets after the first touch. This results in the kernel waking up around once every couple of milliseconds to process them, making it almost impossible to spend any significant period of time in C3 state on a dynamic HZ kernel. Sending the mode initialisation code makes the device shut up until it's touched again. This patch does so after receiving 10 packets with no interesting content. +The attached minimally intrusive patch is based on Matthew Garret's -From: Matthew Garrett <mj...@sr...> +From: Soeren Sonnenburg <ke...@nn...> +patch 'Make appletouch shut up when it has nothing to say' patches (e.g. +http://lkml.org/lkml/2007/5/13/117): Matthews description follows / +second paragraph lists my additional changes. +The appletouch geyser3 devices found in the Intel Macs (and possibly some later +PPC ones?) send a constant stream of packets after the first touch. This +results in the kernel waking up around once every couple of milliseconds +to process them, making it almost impossible to spend any significant +period of time in C3 state on a dynamic HZ kernel. Sending the mode +initialization code makes the device shut up until it's touched again. +This patch does so after receiving 10 packets with no interesting +content. + +In addition it now empties the work queue via cancel_work_sync on module +exit, keeps all error checking and only reports BTN_LEFT presses if bit +1 in the status byte (last byte in packet) is set. This fixes the random +left clicks issue. Furthermore it invalidates touchpad data before the +mode switch, which fixes the touchpad runs amok issue. + +Credits: +Sven Anders found out that one should only check for bit 1 for BTN_LEFT. +Matthew Garrett did the initial 'Make appletouch shut up when it has +nothing to say' so I am adding him to the signed-off lines (hope that is +the correct way). + +Patch follows inline and attached. + +Soeren. + +Signed-off-by: Soeren Sonnenburg <ke...@nn...> +Signed-off-by: Matthew Garrett <mj...@sr...> --- - drivers/input/mouse/appletouch.c | 93 ++++++++++++++++++++++++++------------ - 1 files changed, 63 insertions(+), 30 deletions(-) + drivers/input/mouse/appletouch.c | 112 ++++++++++++++++++++++++++------------ + 1 files changed, 77 insertions(+), 35 deletions(-) diff --git a/drivers/input/mouse/appletouch.c b/drivers/input/mouse/appletouch.c -index c26af96..724bcd4 100644 +index c26af96..22182a7 100644 --- a/drivers/input/mouse/appletouch.c +++ b/drivers/input/mouse/appletouch.c @@ -155,6 +155,8 @@ struct atp { 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 */ ++ int idlecount; /* number of empty packets */ + struct work_struct work; }; #define dbg_dump(msg, tab) \ -@@ -208,6 +210,51 @@ static inline int atp_is_geyser_3(struct atp *dev) +@@ -208,6 +210,63 @@ static inline int atp_is_geyser_3(struct atp *dev) (productId == GEYSER4_JIS_PRODUCT_ID); } ++/* ++ * 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). ++ */ +static int atp_geyser3_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_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)"); + return -EIO; @@ -44,15 +84,17 @@ + + /* Apply the mode switch */ + 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_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)"); + return -EIO; @@ -73,42 +115,48 @@ static int atp_calculate_abs(int *xy_sensors, int nb_sensors, int fact, int *z, int *fingers) { -@@ -441,7 +488,6 @@ static void atp_complete(struct urb* urb) - dev->y_old = y; - } - else if (!x && !y) { -- - dev->x_old = dev->y_old = -1; - input_report_key(dev->input, BTN_TOUCH, 0); - input_report_abs(dev->input, ABS_PRESSURE, 0); -@@ -449,10 +495,21 @@ static void atp_complete(struct urb* urb) +@@ -449,11 +508,21 @@ static void atp_complete(struct urb* urb) /* reset the accumulator on release */ memset(dev->xy_acc, 0, sizeof(dev->xy_acc)); -+ +- } + +- input_report_key(dev->input, BTN_LEFT, +- !!dev->data[dev->datalen - 1]); + /* 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 (atp_is_geyser_3(dev)) { + dev->idlecount++; -+ if (dev->idlecount == 10) ++ if (dev->idlecount == 10) { ++ dev->valid=0; + schedule_work (&dev->work); ++ } + } - } ++ } -- input_report_key(dev->input, BTN_LEFT, -- !!dev->data[dev->datalen - 1]); -+ if (dev->data[dev->datalen-1] != 20) -+ input_report_key(dev->input, BTN_LEFT, -+ !!dev->data[dev->datalen - 1]); - ++ input_report_key(dev->input, BTN_LEFT, dev->data[dev->datalen-1] & 1); input_sync(dev->input); -@@ -533,35 +590,9 @@ static int atp_probe(struct usb_interface *iface, const struct usb_device_id *id - * packets (Report ID 2). This code changes device mode, so it - * sends raw sensor reports (Report ID 5). - */ + exit: +@@ -480,6 +549,7 @@ static void atp_close(struct input_dev *input) + struct atp *dev = input_get_drvdata(input); + + usb_kill_urb(dev->urb); ++ cancel_work_sync(&dev->work); + dev->open = 0; + } + +@@ -528,40 +598,10 @@ static int atp_probe(struct usb_interface *iface, const struct usb_device_id *id + dev->datalen = 81; + + if (atp_is_geyser_3(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). +- */ - char data[8]; - int size; - @@ -121,10 +169,11 @@ - if (size != 8) { - err("Could not do mode read request from device" - " (Geyser 3 mode)"); ++ /* switch to raw sensor mode */ + if (atp_geyser3_init(udev)) goto err_free_devs; - } - +- - /* Apply the mode switch */ - data[0] = ATP_GEYSER3_MODE_VENDOR_VALUE; - @@ -133,7 +182,7 @@ - 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) { - err("Could not do mode write request to device" - " (Geyser 3 mode)"); @@ -142,11 +191,11 @@ printk("appletouch Geyser 3 inited.\n"); } -@@ -636,6 +667,8 @@ static int atp_probe(struct usb_interface *iface, const struct usb_device_id *id +@@ -636,6 +676,8 @@ 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); -+ INIT_WORK(&dev->work, atp_reinit); ++ INIT_WORK(&dev->work, atp_reinit); + return 0; Modified: trunk/kernel/mactel-patches-2.6.22/series =================================================================== --- trunk/kernel/mactel-patches-2.6.22/series 2007-07-12 13:56:52 UTC (rev 134) +++ trunk/kernel/mactel-patches-2.6.22/series 2007-07-17 18:50:21 UTC (rev 135) @@ -5,6 +5,5 @@ sigmatel_audio3.patch applesmc_int.patch appletouch.patch -appleir.patch +appleir-undo-hid-blacklist.patch appletouch-shut-up-when-it-has-nothing-to-say.patch -appletouch-fix-run-amok-problem.patch This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nbo...@us...> - 2007-07-21 15:19:59
|
Revision: 136 http://svn.sourceforge.net/mactel-linux/?rev=136&view=rev Author: nboichat Date: 2007-07-21 08:19:54 -0700 (Sat, 21 Jul 2007) Log Message: ----------- Rename audio patches and add support for Macbook v2. Modified Paths: -------------- trunk/kernel/mactel-patches-2.6.22/series Added Paths: ----------- trunk/kernel/mactel-patches-2.6.22/sigmatel_audio_display_all_controls_when_subsystem_id_is_wrong.patch trunk/kernel/mactel-patches-2.6.22/sigmatel_audio_fix_macbook_v2.patch trunk/kernel/mactel-patches-2.6.22/sigmatel_audio_fix_macmini_macbook.patch Removed Paths: ------------- trunk/kernel/mactel-patches-2.6.22/sigmatel_audio2.patch trunk/kernel/mactel-patches-2.6.22/sigmatel_audio3.patch Modified: trunk/kernel/mactel-patches-2.6.22/series =================================================================== --- trunk/kernel/mactel-patches-2.6.22/series 2007-07-17 18:50:21 UTC (rev 135) +++ trunk/kernel/mactel-patches-2.6.22/series 2007-07-21 15:19:54 UTC (rev 136) @@ -1,8 +1,9 @@ # This series applies on GIT commit f44bba1a92e01bbab6ca9817b86ddf9e1744a616 applesmc-use-input-polldev.patch applesmc-add-macbook-temperature-keys.patch -sigmatel_audio2.patch -sigmatel_audio3.patch +sigmatel_audio_fix_macmini_macbook.patch +sigmatel_audio_display_all_controls_when_subsystem_id_is_wrong.patch +sigmatel_audio_fix_macbook_v2.patch applesmc_int.patch appletouch.patch appleir-undo-hid-blacklist.patch Deleted: trunk/kernel/mactel-patches-2.6.22/sigmatel_audio2.patch =================================================================== --- trunk/kernel/mactel-patches-2.6.22/sigmatel_audio2.patch 2007-07-17 18:50:21 UTC (rev 135) +++ trunk/kernel/mactel-patches-2.6.22/sigmatel_audio2.patch 2007-07-21 15:19:54 UTC (rev 136) @@ -1,51 +0,0 @@ -Fix audio on Macmini and Macbook. - -From: Takashi Iwai <ti...@su...> - - ---- - - sound/pci/hda/patch_sigmatel.c | 18 +++++++++++++++--- - 1 files changed, 15 insertions(+), 3 deletions(-) - -diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c -index e3964fc..686a15a 100644 ---- a/sound/pci/hda/patch_sigmatel.c -+++ b/sound/pci/hda/patch_sigmatel.c -@@ -549,12 +549,24 @@ static unsigned int d945gtp5_pin_configs[10] = { - 0x02a19320, 0x40000100, - }; - --static unsigned int macbook_pro_v1_pin_configs[10] = { -+static unsigned int macmini_pin_configs[10] = { -+ 0x0321e230, 0x400000fd, 0x9017e110, 0x01014010, -+ 0x400000fd, 0x0381e021, 0x1345e240, 0x13c5e22e, -+ 0x400000fc, 0x400000fb -+}; -+ -+static unsigned int macbook_pin_configs[10] = { - 0x0321e230, 0x03a1e020, 0x9017e110, 0x01014010, - 0x01a19021, 0x0381e021, 0x1345e240, 0x13c5e22e, - 0x02a19320, 0x400000fb - }; - -+static unsigned int macbook_pro_v1_pin_configs[10] = { -+ 0x0321e230, 0x02a7e020, 0x9017e110, 0x01014010, -+ 0x400000fd, 0x0381e021, 0x1345e240, 0x13c5e22e, -+ 0x400000fc, 0x400000fb -+}; -+ - static unsigned int macbook_pro_v2_pin_configs[10] = { - 0x0221401f, 0x90a70120, 0x01813024, 0x01014010, - 0x400000fd, 0x01016011, 0x1345e240, 0x13c5e22e, -@@ -571,8 +583,8 @@ static unsigned int *stac922x_brd_tbl[STAC_922X_MODELS] = { - [STAC_D945_REF] = ref922x_pin_configs, - [STAC_D945GTP3] = d945gtp3_pin_configs, - [STAC_D945GTP5] = d945gtp5_pin_configs, -- [STAC_MACMINI] = macbook_pro_v1_pin_configs, -- [STAC_MACBOOK] = macbook_pro_v1_pin_configs, -+ [STAC_MACMINI] = macmini_pin_configs, -+ [STAC_MACBOOK] = macbook_pin_configs, - [STAC_MACBOOK_PRO_V1] = macbook_pro_v1_pin_configs, - [STAC_MACBOOK_PRO_V2] = macbook_pro_v2_pin_configs, - [STAC_IMAC_INTEL] = imac_intel_pin_configs, Deleted: trunk/kernel/mactel-patches-2.6.22/sigmatel_audio3.patch =================================================================== --- trunk/kernel/mactel-patches-2.6.22/sigmatel_audio3.patch 2007-07-17 18:50:21 UTC (rev 135) +++ trunk/kernel/mactel-patches-2.6.22/sigmatel_audio3.patch 2007-07-21 15:19:54 UTC (rev 136) @@ -1,22 +0,0 @@ -Display all controls when the subsystem id is wrong (0x100). - -From: Nicolas Boichat <ni...@bo...> - - ---- - - sound/pci/hda/patch_sigmatel.c | 1 + - 1 files changed, 1 insertions(+), 0 deletions(-) - -diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c -index 686a15a..89ee79b 100644 ---- a/sound/pci/hda/patch_sigmatel.c -+++ b/sound/pci/hda/patch_sigmatel.c -@@ -2040,6 +2040,7 @@ static int patch_stac922x(struct hda_codec *codec) - case 0x106b0a00: /* MacBook First generatoin */ - spec->board_config = STAC_MACBOOK; - break; -+ case 0x100: /* Invalid subsystem ID */ - case 0x106b0200: /* MacBook Pro first generation */ - spec->board_config = STAC_MACBOOK_PRO_V1; - break; Copied: trunk/kernel/mactel-patches-2.6.22/sigmatel_audio_display_all_controls_when_subsystem_id_is_wrong.patch (from rev 133, trunk/kernel/mactel-patches-2.6.22/sigmatel_audio3.patch) =================================================================== --- trunk/kernel/mactel-patches-2.6.22/sigmatel_audio_display_all_controls_when_subsystem_id_is_wrong.patch (rev 0) +++ trunk/kernel/mactel-patches-2.6.22/sigmatel_audio_display_all_controls_when_subsystem_id_is_wrong.patch 2007-07-21 15:19:54 UTC (rev 136) @@ -0,0 +1,24 @@ +Display Macbook Pro 1st gen controls when the subsystem id is wrong (0x100). + +From: Nicolas Boichat <ni...@bo...> + + +--- + + sound/pci/hda/patch_sigmatel.c | 3 +++ + 1 files changed, 3 insertions(+), 0 deletions(-) + +diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c +index 686a15a..fb55df0 100644 +--- a/sound/pci/hda/patch_sigmatel.c ++++ b/sound/pci/hda/patch_sigmatel.c +@@ -2040,6 +2040,9 @@ static int patch_stac922x(struct hda_codec *codec) + case 0x106b0a00: /* MacBook First generatoin */ + spec->board_config = STAC_MACBOOK; + break; ++ case 0x100: /* Invalid subsystem ID, happens randomly on ++ * MacBook Pro 1st generation ++ */ + case 0x106b0200: /* MacBook Pro first generation */ + spec->board_config = STAC_MACBOOK_PRO_V1; + break; Added: trunk/kernel/mactel-patches-2.6.22/sigmatel_audio_fix_macbook_v2.patch =================================================================== --- trunk/kernel/mactel-patches-2.6.22/sigmatel_audio_fix_macbook_v2.patch (rev 0) +++ trunk/kernel/mactel-patches-2.6.22/sigmatel_audio_fix_macbook_v2.patch 2007-07-21 15:19:54 UTC (rev 136) @@ -0,0 +1,74 @@ +Fixes audio on Macbook v2. + +From: Marek Sterzik <ma...@mi...> + + +--- + + Documentation/sound/alsa/ALSA-Configuration.txt | 1 + + sound/pci/hda/patch_sigmatel.c | 12 ++++++++++++ + 2 files changed, 13 insertions(+), 0 deletions(-) + +diff --git a/Documentation/sound/alsa/ALSA-Configuration.txt b/Documentation/sound/alsa/ALSA-Configuration.txt +index 355ff0a..7e3255d 100644 +--- a/Documentation/sound/alsa/ALSA-Configuration.txt ++++ b/Documentation/sound/alsa/ALSA-Configuration.txt +@@ -909,6 +909,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed. + 5stack D945 5stack + SPDIF + macmini Intel Mac Mini + macbook Intel Mac Book ++ macbook-v2 Intel Mac Book 2nd generation + macbook-pro-v1 Intel Mac Book Pro 1st generation + macbook-pro Intel Mac Book Pro 2nd generation + imac-intel Intel iMac +diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c +index fb55df0..2b598be 100644 +--- a/sound/pci/hda/patch_sigmatel.c ++++ b/sound/pci/hda/patch_sigmatel.c +@@ -61,6 +61,7 @@ enum { + STAC_D945GTP5, + STAC_MACMINI, + STAC_MACBOOK, ++ STAC_MACBOOK_V2, + STAC_MACBOOK_PRO_V1, + STAC_MACBOOK_PRO_V2, + STAC_IMAC_INTEL, +@@ -561,6 +562,12 @@ static unsigned int macbook_pin_configs[10] = { + 0x02a19320, 0x400000fb + }; + ++static unsigned int macbook_v2_pin_configs[10] = { ++ 0x0321e21f, 0x03a1e02e, 0x9017e110, 0x9017e11f, ++ 0x400000fe, 0x0381e020, 0x1345e230, 0x13c5e240, ++ 0x400000fc, 0x400000fb ++}; ++ + static unsigned int macbook_pro_v1_pin_configs[10] = { + 0x0321e230, 0x02a7e020, 0x9017e110, 0x01014010, + 0x400000fd, 0x0381e021, 0x1345e240, 0x13c5e22e, +@@ -585,6 +592,7 @@ static unsigned int *stac922x_brd_tbl[STAC_922X_MODELS] = { + [STAC_D945GTP5] = d945gtp5_pin_configs, + [STAC_MACMINI] = macmini_pin_configs, + [STAC_MACBOOK] = macbook_pin_configs, ++ [STAC_MACBOOK_V2] = macbook_v2_pin_configs, + [STAC_MACBOOK_PRO_V1] = macbook_pro_v1_pin_configs, + [STAC_MACBOOK_PRO_V2] = macbook_pro_v2_pin_configs, + [STAC_IMAC_INTEL] = imac_intel_pin_configs, +@@ -596,6 +604,7 @@ static const char *stac922x_models[STAC_922X_MODELS] = { + [STAC_D945GTP3] = "3stack", + [STAC_MACMINI] = "macmini", + [STAC_MACBOOK] = "macbook", ++ [STAC_MACBOOK_V2] = "macbook-v2", + [STAC_MACBOOK_PRO_V1] = "macbook-pro-v1", + [STAC_MACBOOK_PRO_V2] = "macbook-pro", + [STAC_IMAC_INTEL] = "imac-intel", +@@ -2040,6 +2049,9 @@ static int patch_stac922x(struct hda_codec *codec) + case 0x106b0a00: /* MacBook First generatoin */ + spec->board_config = STAC_MACBOOK; + break; ++ case 0x106b2200: /* MacBook second generation */ ++ spec->board_config = STAC_MACBOOK_V2; ++ break; + case 0x100: /* Invalid subsystem ID, happens randomly on + * MacBook Pro 1st generation + */ Copied: trunk/kernel/mactel-patches-2.6.22/sigmatel_audio_fix_macmini_macbook.patch (from rev 133, trunk/kernel/mactel-patches-2.6.22/sigmatel_audio2.patch) =================================================================== --- trunk/kernel/mactel-patches-2.6.22/sigmatel_audio_fix_macmini_macbook.patch (rev 0) +++ trunk/kernel/mactel-patches-2.6.22/sigmatel_audio_fix_macmini_macbook.patch 2007-07-21 15:19:54 UTC (rev 136) @@ -0,0 +1,51 @@ +Fix audio on Macmini and Macbook. + +From: Takashi Iwai <ti...@su...> + + +--- + + sound/pci/hda/patch_sigmatel.c | 18 +++++++++++++++--- + 1 files changed, 15 insertions(+), 3 deletions(-) + +diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c +index e3964fc..686a15a 100644 +--- a/sound/pci/hda/patch_sigmatel.c ++++ b/sound/pci/hda/patch_sigmatel.c +@@ -549,12 +549,24 @@ static unsigned int d945gtp5_pin_configs[10] = { + 0x02a19320, 0x40000100, + }; + +-static unsigned int macbook_pro_v1_pin_configs[10] = { ++static unsigned int macmini_pin_configs[10] = { ++ 0x0321e230, 0x400000fd, 0x9017e110, 0x01014010, ++ 0x400000fd, 0x0381e021, 0x1345e240, 0x13c5e22e, ++ 0x400000fc, 0x400000fb ++}; ++ ++static unsigned int macbook_pin_configs[10] = { + 0x0321e230, 0x03a1e020, 0x9017e110, 0x01014010, + 0x01a19021, 0x0381e021, 0x1345e240, 0x13c5e22e, + 0x02a19320, 0x400000fb + }; + ++static unsigned int macbook_pro_v1_pin_configs[10] = { ++ 0x0321e230, 0x02a7e020, 0x9017e110, 0x01014010, ++ 0x400000fd, 0x0381e021, 0x1345e240, 0x13c5e22e, ++ 0x400000fc, 0x400000fb ++}; ++ + static unsigned int macbook_pro_v2_pin_configs[10] = { + 0x0221401f, 0x90a70120, 0x01813024, 0x01014010, + 0x400000fd, 0x01016011, 0x1345e240, 0x13c5e22e, +@@ -571,8 +583,8 @@ static unsigned int *stac922x_brd_tbl[STAC_922X_MODELS] = { + [STAC_D945_REF] = ref922x_pin_configs, + [STAC_D945GTP3] = d945gtp3_pin_configs, + [STAC_D945GTP5] = d945gtp5_pin_configs, +- [STAC_MACMINI] = macbook_pro_v1_pin_configs, +- [STAC_MACBOOK] = macbook_pro_v1_pin_configs, ++ [STAC_MACMINI] = macmini_pin_configs, ++ [STAC_MACBOOK] = macbook_pin_configs, + [STAC_MACBOOK_PRO_V1] = macbook_pro_v1_pin_configs, + [STAC_MACBOOK_PRO_V2] = macbook_pro_v2_pin_configs, + [STAC_IMAC_INTEL] = imac_intel_pin_configs, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nbo...@us...> - 2007-07-25 19:54:41
|
Revision: 137 http://mactel-linux.svn.sourceforge.net/mactel-linux/?rev=137&view=rev Author: nboichat Date: 2007-07-25 12:54:24 -0700 (Wed, 25 Jul 2007) Log Message: ----------- Backport sigmatel audio patches from 2.6.23 to get them tested (lots of pin configuration changed). Modified Paths: -------------- trunk/kernel/mactel-patches-2.6.22/applesmc-add-macbook-temperature-keys.patch trunk/kernel/mactel-patches-2.6.22/applesmc_int.patch trunk/kernel/mactel-patches-2.6.22/series Added Paths: ----------- trunk/kernel/mactel-patches-2.6.22/sigmatel-backport-2.6.23.patch trunk/kernel/mactel-patches-2.6.22/sigmatel_audio_display_all_controls_when_subsystem_id_is_wrong-backport-2.6.23.patch Removed Paths: ------------- trunk/kernel/mactel-patches-2.6.22/sigmatel_audio_display_all_controls_when_subsystem_id_is_wrong.patch trunk/kernel/mactel-patches-2.6.22/sigmatel_audio_fix_macbook_v2.patch trunk/kernel/mactel-patches-2.6.22/sigmatel_audio_fix_macmini_macbook.patch Modified: trunk/kernel/mactel-patches-2.6.22/applesmc-add-macbook-temperature-keys.patch =================================================================== --- trunk/kernel/mactel-patches-2.6.22/applesmc-add-macbook-temperature-keys.patch 2007-07-21 15:19:54 UTC (rev 136) +++ trunk/kernel/mactel-patches-2.6.22/applesmc-add-macbook-temperature-keys.patch 2007-07-25 19:54:24 UTC (rev 137) @@ -9,7 +9,7 @@ 1 files changed, 9 insertions(+), 5 deletions(-) diff --git a/drivers/hwmon/applesmc.c b/drivers/hwmon/applesmc.c -index eb81a64..232cbad 100644 +index eb81a64..cea8d78 100644 --- a/drivers/hwmon/applesmc.c +++ b/drivers/hwmon/applesmc.c @@ -79,11 +79,15 @@ @@ -40,7 +40,7 @@ +/* MacBook: accelerometer and temperature set 1 */ + { .accelerometer = 1, .light = 0, .temperature_set = 1 }, +/* MacMini: temperature set 2 */ -+ { .accelerometer = 0, .light = 0, .temperature_set = 2 } ++ { .accelerometer = 0, .light = 0, .temperature_set = 2 }, }; /* Note that DMI_MATCH(...,"MacBook") will match "MacBookPro1,1". Modified: trunk/kernel/mactel-patches-2.6.22/applesmc_int.patch =================================================================== --- trunk/kernel/mactel-patches-2.6.22/applesmc_int.patch 2007-07-21 15:19:54 UTC (rev 136) +++ trunk/kernel/mactel-patches-2.6.22/applesmc_int.patch 2007-07-25 19:54:24 UTC (rev 137) @@ -9,7 +9,7 @@ 1 files changed, 298 insertions(+), 23 deletions(-) diff --git a/drivers/hwmon/applesmc.c b/drivers/hwmon/applesmc.c -index 232cbad..c022c98 100644 +index cea8d78..5d184a1 100644 --- a/drivers/hwmon/applesmc.c +++ b/drivers/hwmon/applesmc.c @@ -39,14 +39,20 @@ Modified: trunk/kernel/mactel-patches-2.6.22/series =================================================================== --- trunk/kernel/mactel-patches-2.6.22/series 2007-07-21 15:19:54 UTC (rev 136) +++ trunk/kernel/mactel-patches-2.6.22/series 2007-07-25 19:54:24 UTC (rev 137) @@ -1,9 +1,8 @@ # This series applies on GIT commit f44bba1a92e01bbab6ca9817b86ddf9e1744a616 applesmc-use-input-polldev.patch applesmc-add-macbook-temperature-keys.patch -sigmatel_audio_fix_macmini_macbook.patch -sigmatel_audio_display_all_controls_when_subsystem_id_is_wrong.patch -sigmatel_audio_fix_macbook_v2.patch +sigmatel-backport-2.6.23.patch +sigmatel_audio_display_all_controls_when_subsystem_id_is_wrong-backport-2.6.23.patch applesmc_int.patch appletouch.patch appleir-undo-hid-blacklist.patch Added: trunk/kernel/mactel-patches-2.6.22/sigmatel-backport-2.6.23.patch =================================================================== --- trunk/kernel/mactel-patches-2.6.22/sigmatel-backport-2.6.23.patch (rev 0) +++ trunk/kernel/mactel-patches-2.6.22/sigmatel-backport-2.6.23.patch 2007-07-25 19:54:24 UTC (rev 137) @@ -0,0 +1,341 @@ +Backport ALSA sigmatel pins from 2.6.23 for testing. + +From: Nicolas Boichat <ni...@bo...> + + +--- + + sound/pci/hda/patch_sigmatel.c | 203 ++++++++++++++++++++++++++++++---------- + 1 files changed, 152 insertions(+), 51 deletions(-) + +diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c +index e3964fc..329f4c0 100644 +--- a/sound/pci/hda/patch_sigmatel.c ++++ b/sound/pci/hda/patch_sigmatel.c +@@ -44,7 +44,7 @@ enum { + + enum { + STAC_9205_REF, +- STAC_9205_MODELS ++ STAC_9205_MODELS + }; + + enum { +@@ -59,11 +59,20 @@ enum { + STAC_D945_REF, + STAC_D945GTP3, + STAC_D945GTP5, ++ STAC_922X_DELL, ++ STAC_INTEL_MAC_V1, ++ STAC_INTEL_MAC_V2, ++ STAC_INTEL_MAC_V3, ++ STAC_INTEL_MAC_V4, ++ STAC_INTEL_MAC_V5, ++ /* for backward compitability */ + STAC_MACMINI, + STAC_MACBOOK, ++ STAC_MACBOOK_V2, + STAC_MACBOOK_PRO_V1, + STAC_MACBOOK_PRO_V2, + STAC_IMAC_INTEL, ++ STAC_IMAC_INTEL_20, + STAC_922X_MODELS + }; + +@@ -549,44 +558,79 @@ static unsigned int d945gtp5_pin_configs[10] = { + 0x02a19320, 0x40000100, + }; + +-static unsigned int macbook_pro_v1_pin_configs[10] = { +- 0x0321e230, 0x03a1e020, 0x9017e110, 0x01014010, +- 0x01a19021, 0x0381e021, 0x1345e240, 0x13c5e22e, +- 0x02a19320, 0x400000fb ++static unsigned int intel_mac_v1_pin_configs[10] = { ++ 0x0121e21f, 0x400000ff, 0x9017e110, 0x400000fd, ++ 0x400000fe, 0x0181e020, 0x1145e030, 0x11c5e240, ++ 0x400000fc, 0x400000fb, ++}; ++ ++static unsigned int intel_mac_v2_pin_configs[10] = { ++ 0x0121e21f, 0x90a7012e, 0x9017e110, 0x400000fd, ++ 0x400000fe, 0x0181e020, 0x1145e230, 0x500000fa, ++ 0x400000fc, 0x400000fb, + }; + +-static unsigned int macbook_pro_v2_pin_configs[10] = { +- 0x0221401f, 0x90a70120, 0x01813024, 0x01014010, +- 0x400000fd, 0x01016011, 0x1345e240, 0x13c5e22e, ++static unsigned int intel_mac_v3_pin_configs[10] = { ++ 0x0121e21f, 0x90a7012e, 0x9017e110, 0x400000fd, ++ 0x400000fe, 0x0181e020, 0x1145e230, 0x11c5e240, + 0x400000fc, 0x400000fb, + }; + +-static unsigned int imac_intel_pin_configs[10] = { +- 0x0121e230, 0x90a70120, 0x9017e110, 0x400000fe, +- 0x400000fd, 0x0181e021, 0x1145e040, 0x400000fa, ++static unsigned int intel_mac_v4_pin_configs[10] = { ++ 0x0321e21f, 0x03a1e02e, 0x9017e110, 0x9017e11f, ++ 0x400000fe, 0x0381e020, 0x1345e230, 0x13c5e240, + 0x400000fc, 0x400000fb, + }; + ++static unsigned int intel_mac_v5_pin_configs[10] = { ++ 0x0321e21f, 0x03a1e02e, 0x9017e110, 0x9017e11f, ++ 0x400000fe, 0x0381e020, 0x1345e230, 0x13c5e240, ++ 0x400000fc, 0x400000fb, ++}; ++ ++static unsigned int stac922x_dell_pin_configs[10] = { ++ 0x0221121e, 0x408103ff, 0x02a1123e, 0x90100310, ++ 0x408003f1, 0x0221122f, 0x03451340, 0x40c003f2, ++ 0x50a003f3, 0x405003f4 ++}; ++ + static unsigned int *stac922x_brd_tbl[STAC_922X_MODELS] = { + [STAC_D945_REF] = ref922x_pin_configs, + [STAC_D945GTP3] = d945gtp3_pin_configs, + [STAC_D945GTP5] = d945gtp5_pin_configs, +- [STAC_MACMINI] = macbook_pro_v1_pin_configs, +- [STAC_MACBOOK] = macbook_pro_v1_pin_configs, +- [STAC_MACBOOK_PRO_V1] = macbook_pro_v1_pin_configs, +- [STAC_MACBOOK_PRO_V2] = macbook_pro_v2_pin_configs, +- [STAC_IMAC_INTEL] = imac_intel_pin_configs, ++ [STAC_922X_DELL] = stac922x_dell_pin_configs, ++ [STAC_INTEL_MAC_V1] = intel_mac_v1_pin_configs, ++ [STAC_INTEL_MAC_V2] = intel_mac_v2_pin_configs, ++ [STAC_INTEL_MAC_V3] = intel_mac_v3_pin_configs, ++ [STAC_INTEL_MAC_V4] = intel_mac_v4_pin_configs, ++ [STAC_INTEL_MAC_V5] = intel_mac_v5_pin_configs, ++ /* for backward compitability */ ++ [STAC_MACMINI] = intel_mac_v3_pin_configs, ++ [STAC_MACBOOK] = intel_mac_v5_pin_configs, ++ [STAC_MACBOOK_PRO_V1] = intel_mac_v3_pin_configs, ++ [STAC_MACBOOK_PRO_V2] = intel_mac_v3_pin_configs, ++ [STAC_IMAC_INTEL] = intel_mac_v2_pin_configs, ++ [STAC_IMAC_INTEL_20] = intel_mac_v3_pin_configs, + }; + + static const char *stac922x_models[STAC_922X_MODELS] = { + [STAC_D945_REF] = "ref", + [STAC_D945GTP5] = "5stack", + [STAC_D945GTP3] = "3stack", ++ [STAC_922X_DELL] = "dell", ++ [STAC_INTEL_MAC_V1] = "intel-mac-v1", ++ [STAC_INTEL_MAC_V2] = "intel-mac-v2", ++ [STAC_INTEL_MAC_V3] = "intel-mac-v3", ++ [STAC_INTEL_MAC_V4] = "intel-mac-v4", ++ [STAC_INTEL_MAC_V5] = "intel-mac-v5", ++ /* for backward compitability */ + [STAC_MACMINI] = "macmini", + [STAC_MACBOOK] = "macbook", ++ [STAC_MACBOOK_V2] = "macbook-v2", + [STAC_MACBOOK_PRO_V1] = "macbook-pro-v1", + [STAC_MACBOOK_PRO_V2] = "macbook-pro", + [STAC_IMAC_INTEL] = "imac-intel", ++ [STAC_IMAC_INTEL_20] = "imac-intel-20", + }; + + static struct snd_pci_quirk stac922x_cfg_tbl[] = { +@@ -649,7 +693,7 @@ static struct snd_pci_quirk stac922x_cfg_tbl[] = { + /* other systems */ + /* Apple Mac Mini (early 2006) */ + SND_PCI_QUIRK(0x8384, 0x7680, +- "Mac Mini", STAC_MACMINI), ++ "Mac Mini", STAC_INTEL_MAC_V3), + {} /* terminator */ + }; + +@@ -770,33 +814,56 @@ static int stac92xx_save_bios_config_regs(struct hda_codec *codec) + return 0; + } + ++static void stac92xx_set_config_reg(struct hda_codec *codec, ++ hda_nid_t pin_nid, unsigned int pin_config) ++{ ++ int i; ++ snd_hda_codec_write(codec, pin_nid, 0, ++ AC_VERB_SET_CONFIG_DEFAULT_BYTES_0, ++ pin_config & 0x000000ff); ++ snd_hda_codec_write(codec, pin_nid, 0, ++ AC_VERB_SET_CONFIG_DEFAULT_BYTES_1, ++ (pin_config & 0x0000ff00) >> 8); ++ snd_hda_codec_write(codec, pin_nid, 0, ++ AC_VERB_SET_CONFIG_DEFAULT_BYTES_2, ++ (pin_config & 0x00ff0000) >> 16); ++ snd_hda_codec_write(codec, pin_nid, 0, ++ AC_VERB_SET_CONFIG_DEFAULT_BYTES_3, ++ pin_config >> 24); ++ i = snd_hda_codec_read(codec, pin_nid, 0, ++ AC_VERB_GET_CONFIG_DEFAULT, ++ 0x00); ++ snd_printdd(KERN_INFO "hda_codec: pin nid %2.2x pin config %8.8x\n", ++ pin_nid, i); ++} ++ + static void stac92xx_set_config_regs(struct hda_codec *codec) + { + int i; + struct sigmatel_spec *spec = codec->spec; +- unsigned int pin_cfg; + +- if (! spec->pin_nids || ! spec->pin_configs) +- return; ++ if (!spec->pin_configs) ++ return; + +- for (i = 0; i < spec->num_pins; i++) { +- snd_hda_codec_write(codec, spec->pin_nids[i], 0, +- AC_VERB_SET_CONFIG_DEFAULT_BYTES_0, +- spec->pin_configs[i] & 0x000000ff); +- snd_hda_codec_write(codec, spec->pin_nids[i], 0, +- AC_VERB_SET_CONFIG_DEFAULT_BYTES_1, +- (spec->pin_configs[i] & 0x0000ff00) >> 8); +- snd_hda_codec_write(codec, spec->pin_nids[i], 0, +- AC_VERB_SET_CONFIG_DEFAULT_BYTES_2, +- (spec->pin_configs[i] & 0x00ff0000) >> 16); +- snd_hda_codec_write(codec, spec->pin_nids[i], 0, +- AC_VERB_SET_CONFIG_DEFAULT_BYTES_3, +- spec->pin_configs[i] >> 24); +- pin_cfg = snd_hda_codec_read(codec, spec->pin_nids[i], 0, +- AC_VERB_GET_CONFIG_DEFAULT, +- 0x00); +- snd_printdd(KERN_INFO "hda_codec: pin nid %2.2x pin config %8.8x\n", spec->pin_nids[i], pin_cfg); +- } ++ for (i = 0; i < spec->num_pins; i++) ++ stac92xx_set_config_reg(codec, spec->pin_nids[i], ++ spec->pin_configs[i]); ++} ++ ++static void stac92xx_enable_gpio_mask(struct hda_codec *codec, ++ int gpio_mask, int gpio_data) ++{ ++ /* Configure GPIOx as output */ ++ snd_hda_codec_write(codec, codec->afg, 0, ++ AC_VERB_SET_GPIO_DIRECTION, gpio_mask); ++ /* Configure GPIOx as CMOS */ ++ snd_hda_codec_write(codec, codec->afg, 0, 0x7e7, 0x00000000); ++ /* Assert GPIOx */ ++ snd_hda_codec_write(codec, codec->afg, 0, ++ AC_VERB_SET_GPIO_DATA, gpio_data); ++ /* Enable GPIOx */ ++ snd_hda_codec_write(codec, codec->afg, 0, ++ AC_VERB_SET_GPIO_MASK, gpio_mask); + } + + /* +@@ -1168,7 +1235,7 @@ static int is_in_dac_nids(struct sigmatel_spec *spec, hda_nid_t nid) + * and 9202/925x. For those, dac_nids[] must be hard-coded. + */ + static int stac92xx_auto_fill_dac_nids(struct hda_codec *codec, +- const struct auto_pin_cfg *cfg) ++ struct auto_pin_cfg *cfg) + { + struct sigmatel_spec *spec = codec->spec; + int i, j, conn_len = 0; +@@ -1193,6 +1260,13 @@ static int stac92xx_auto_fill_dac_nids(struct hda_codec *codec, + } + + if (j == conn_len) { ++ if (spec->multiout.num_dacs > 0) { ++ /* we have already working output pins, ++ * so let's drop the broken ones again ++ */ ++ cfg->line_outs = spec->multiout.num_dacs; ++ break; ++ } + /* error out, no available DAC found */ + snd_printk(KERN_ERR + "%s: No available DAC for pin 0x%x\n", +@@ -1334,7 +1408,15 @@ static int stac92xx_auto_create_hp_ctls(struct hda_codec *codec, + continue; + add_spec_dacs(spec, nid); + } +- ++ for (i = 0; i < cfg->line_outs; i++) { ++ nid = snd_hda_codec_read(codec, cfg->line_out_pins[i], 0, ++ AC_VERB_GET_CONNECT_LIST, 0) & 0xff; ++ if (check_in_dac_nids(spec, nid)) ++ nid = 0; ++ if (! nid) ++ continue; ++ add_spec_dacs(spec, nid); ++ } + for (i = old_num_dacs; i < spec->multiout.num_dacs; i++) { + static const char *pfxs[] = { + "Speaker", "External Speaker", "Speaker2", +@@ -1891,7 +1973,7 @@ static int patch_stac9200(struct hda_codec *codec) + return -ENOMEM; + + codec->spec = spec; +- spec->num_pins = 8; ++ spec->num_pins = ARRAY_SIZE(stac9200_pin_nids); + spec->pin_nids = stac9200_pin_nids; + spec->board_config = snd_hda_check_board_config(codec, STAC_9200_MODELS, + stac9200_models, +@@ -2013,29 +2095,41 @@ static int patch_stac922x(struct hda_codec *codec) + return -ENOMEM; + + codec->spec = spec; +- spec->num_pins = 10; ++ spec->num_pins = ARRAY_SIZE(stac922x_pin_nids); + spec->pin_nids = stac922x_pin_nids; + spec->board_config = snd_hda_check_board_config(codec, STAC_922X_MODELS, + stac922x_models, + stac922x_cfg_tbl); +- if (spec->board_config == STAC_MACMINI) { ++ if (spec->board_config == STAC_INTEL_MAC_V3) { + spec->gpio_mute = 1; + /* Intel Macs have all same PCI SSID, so we need to check + * codec SSID to distinguish the exact models + */ + printk(KERN_INFO "hda_codec: STAC922x, Apple subsys_id=%x\n", codec->subsystem_id); + switch (codec->subsystem_id) { +- case 0x106b0a00: /* MacBook First generatoin */ +- spec->board_config = STAC_MACBOOK; ++ ++ case 0x106b0800: ++ spec->board_config = STAC_INTEL_MAC_V1; ++ break; ++ case 0x106b0600: ++ case 0x106b0700: ++ spec->board_config = STAC_INTEL_MAC_V2; + break; +- case 0x106b0200: /* MacBook Pro first generation */ +- spec->board_config = STAC_MACBOOK_PRO_V1; ++ case 0x106b0e00: ++ case 0x106b0f00: ++ case 0x106b1600: ++ case 0x106b1700: ++ case 0x106b0200: ++ case 0x106b1e00: ++ spec->board_config = STAC_INTEL_MAC_V3; + break; +- case 0x106b1e00: /* MacBook Pro second generation */ +- spec->board_config = STAC_MACBOOK_PRO_V2; ++ case 0x106b1a00: ++ case 0x00000100: ++ spec->board_config = STAC_INTEL_MAC_V4; + break; +- case 0x106b0700: /* Intel-based iMac */ +- spec->board_config = STAC_IMAC_INTEL; ++ case 0x106b0a00: ++ case 0x106b2200: ++ spec->board_config = STAC_INTEL_MAC_V5; + break; + } + } +@@ -2082,6 +2176,13 @@ static int patch_stac922x(struct hda_codec *codec) + + codec->patch_ops = stac92xx_patch_ops; + ++ /* Fix Mux capture level; max to 2 */ ++ snd_hda_override_amp_caps(codec, 0x12, HDA_OUTPUT, ++ (0 << AC_AMPCAP_OFFSET_SHIFT) | ++ (2 << AC_AMPCAP_NUM_STEPS_SHIFT) | ++ (0x27 << AC_AMPCAP_STEP_SIZE_SHIFT) | ++ (0 << AC_AMPCAP_MUTE_SHIFT)); ++ + return 0; + } + Added: trunk/kernel/mactel-patches-2.6.22/sigmatel_audio_display_all_controls_when_subsystem_id_is_wrong-backport-2.6.23.patch =================================================================== --- trunk/kernel/mactel-patches-2.6.22/sigmatel_audio_display_all_controls_when_subsystem_id_is_wrong-backport-2.6.23.patch (rev 0) +++ trunk/kernel/mactel-patches-2.6.22/sigmatel_audio_display_all_controls_when_subsystem_id_is_wrong-backport-2.6.23.patch 2007-07-25 19:54:24 UTC (rev 137) @@ -0,0 +1,24 @@ +Display Macbook Pro 1st gen controls when the subsystem id is wrong (0x100). + +From: Nicolas Boichat <ni...@bo...> + + +--- + + sound/pci/hda/patch_sigmatel.c | 3 +++ + 1 files changed, 3 insertions(+), 0 deletions(-) + +diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c +index 329f4c0..cc67aef 100644 +--- a/sound/pci/hda/patch_sigmatel.c ++++ b/sound/pci/hda/patch_sigmatel.c +@@ -2121,6 +2121,9 @@ static int patch_stac922x(struct hda_codec *codec) + case 0x106b1700: + case 0x106b0200: + case 0x106b1e00: ++ case 0x100: /* Invalid subsystem ID, happens randomly on ++ * MacBook Pro 1st generation ++ */ + spec->board_config = STAC_INTEL_MAC_V3; + break; + case 0x106b1a00: Deleted: trunk/kernel/mactel-patches-2.6.22/sigmatel_audio_display_all_controls_when_subsystem_id_is_wrong.patch =================================================================== --- trunk/kernel/mactel-patches-2.6.22/sigmatel_audio_display_all_controls_when_subsystem_id_is_wrong.patch 2007-07-21 15:19:54 UTC (rev 136) +++ trunk/kernel/mactel-patches-2.6.22/sigmatel_audio_display_all_controls_when_subsystem_id_is_wrong.patch 2007-07-25 19:54:24 UTC (rev 137) @@ -1,24 +0,0 @@ -Display Macbook Pro 1st gen controls when the subsystem id is wrong (0x100). - -From: Nicolas Boichat <ni...@bo...> - - ---- - - sound/pci/hda/patch_sigmatel.c | 3 +++ - 1 files changed, 3 insertions(+), 0 deletions(-) - -diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c -index 686a15a..fb55df0 100644 ---- a/sound/pci/hda/patch_sigmatel.c -+++ b/sound/pci/hda/patch_sigmatel.c -@@ -2040,6 +2040,9 @@ static int patch_stac922x(struct hda_codec *codec) - case 0x106b0a00: /* MacBook First generatoin */ - spec->board_config = STAC_MACBOOK; - break; -+ case 0x100: /* Invalid subsystem ID, happens randomly on -+ * MacBook Pro 1st generation -+ */ - case 0x106b0200: /* MacBook Pro first generation */ - spec->board_config = STAC_MACBOOK_PRO_V1; - break; Deleted: trunk/kernel/mactel-patches-2.6.22/sigmatel_audio_fix_macbook_v2.patch =================================================================== --- trunk/kernel/mactel-patches-2.6.22/sigmatel_audio_fix_macbook_v2.patch 2007-07-21 15:19:54 UTC (rev 136) +++ trunk/kernel/mactel-patches-2.6.22/sigmatel_audio_fix_macbook_v2.patch 2007-07-25 19:54:24 UTC (rev 137) @@ -1,74 +0,0 @@ -Fixes audio on Macbook v2. - -From: Marek Sterzik <ma...@mi...> - - ---- - - Documentation/sound/alsa/ALSA-Configuration.txt | 1 + - sound/pci/hda/patch_sigmatel.c | 12 ++++++++++++ - 2 files changed, 13 insertions(+), 0 deletions(-) - -diff --git a/Documentation/sound/alsa/ALSA-Configuration.txt b/Documentation/sound/alsa/ALSA-Configuration.txt -index 355ff0a..7e3255d 100644 ---- a/Documentation/sound/alsa/ALSA-Configuration.txt -+++ b/Documentation/sound/alsa/ALSA-Configuration.txt -@@ -909,6 +909,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed. - 5stack D945 5stack + SPDIF - macmini Intel Mac Mini - macbook Intel Mac Book -+ macbook-v2 Intel Mac Book 2nd generation - macbook-pro-v1 Intel Mac Book Pro 1st generation - macbook-pro Intel Mac Book Pro 2nd generation - imac-intel Intel iMac -diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c -index fb55df0..2b598be 100644 ---- a/sound/pci/hda/patch_sigmatel.c -+++ b/sound/pci/hda/patch_sigmatel.c -@@ -61,6 +61,7 @@ enum { - STAC_D945GTP5, - STAC_MACMINI, - STAC_MACBOOK, -+ STAC_MACBOOK_V2, - STAC_MACBOOK_PRO_V1, - STAC_MACBOOK_PRO_V2, - STAC_IMAC_INTEL, -@@ -561,6 +562,12 @@ static unsigned int macbook_pin_configs[10] = { - 0x02a19320, 0x400000fb - }; - -+static unsigned int macbook_v2_pin_configs[10] = { -+ 0x0321e21f, 0x03a1e02e, 0x9017e110, 0x9017e11f, -+ 0x400000fe, 0x0381e020, 0x1345e230, 0x13c5e240, -+ 0x400000fc, 0x400000fb -+}; -+ - static unsigned int macbook_pro_v1_pin_configs[10] = { - 0x0321e230, 0x02a7e020, 0x9017e110, 0x01014010, - 0x400000fd, 0x0381e021, 0x1345e240, 0x13c5e22e, -@@ -585,6 +592,7 @@ static unsigned int *stac922x_brd_tbl[STAC_922X_MODELS] = { - [STAC_D945GTP5] = d945gtp5_pin_configs, - [STAC_MACMINI] = macmini_pin_configs, - [STAC_MACBOOK] = macbook_pin_configs, -+ [STAC_MACBOOK_V2] = macbook_v2_pin_configs, - [STAC_MACBOOK_PRO_V1] = macbook_pro_v1_pin_configs, - [STAC_MACBOOK_PRO_V2] = macbook_pro_v2_pin_configs, - [STAC_IMAC_INTEL] = imac_intel_pin_configs, -@@ -596,6 +604,7 @@ static const char *stac922x_models[STAC_922X_MODELS] = { - [STAC_D945GTP3] = "3stack", - [STAC_MACMINI] = "macmini", - [STAC_MACBOOK] = "macbook", -+ [STAC_MACBOOK_V2] = "macbook-v2", - [STAC_MACBOOK_PRO_V1] = "macbook-pro-v1", - [STAC_MACBOOK_PRO_V2] = "macbook-pro", - [STAC_IMAC_INTEL] = "imac-intel", -@@ -2040,6 +2049,9 @@ static int patch_stac922x(struct hda_codec *codec) - case 0x106b0a00: /* MacBook First generatoin */ - spec->board_config = STAC_MACBOOK; - break; -+ case 0x106b2200: /* MacBook second generation */ -+ spec->board_config = STAC_MACBOOK_V2; -+ break; - case 0x100: /* Invalid subsystem ID, happens randomly on - * MacBook Pro 1st generation - */ Deleted: trunk/kernel/mactel-patches-2.6.22/sigmatel_audio_fix_macmini_macbook.patch =================================================================== --- trunk/kernel/mactel-patches-2.6.22/sigmatel_audio_fix_macmini_macbook.patch 2007-07-21 15:19:54 UTC (rev 136) +++ trunk/kernel/mactel-patches-2.6.22/sigmatel_audio_fix_macmini_macbook.patch 2007-07-25 19:54:24 UTC (rev 137) @@ -1,51 +0,0 @@ -Fix audio on Macmini and Macbook. - -From: Takashi Iwai <ti...@su...> - - ---- - - sound/pci/hda/patch_sigmatel.c | 18 +++++++++++++++--- - 1 files changed, 15 insertions(+), 3 deletions(-) - -diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c -index e3964fc..686a15a 100644 ---- a/sound/pci/hda/patch_sigmatel.c -+++ b/sound/pci/hda/patch_sigmatel.c -@@ -549,12 +549,24 @@ static unsigned int d945gtp5_pin_configs[10] = { - 0x02a19320, 0x40000100, - }; - --static unsigned int macbook_pro_v1_pin_configs[10] = { -+static unsigned int macmini_pin_configs[10] = { -+ 0x0321e230, 0x400000fd, 0x9017e110, 0x01014010, -+ 0x400000fd, 0x0381e021, 0x1345e240, 0x13c5e22e, -+ 0x400000fc, 0x400000fb -+}; -+ -+static unsigned int macbook_pin_configs[10] = { - 0x0321e230, 0x03a1e020, 0x9017e110, 0x01014010, - 0x01a19021, 0x0381e021, 0x1345e240, 0x13c5e22e, - 0x02a19320, 0x400000fb - }; - -+static unsigned int macbook_pro_v1_pin_configs[10] = { -+ 0x0321e230, 0x02a7e020, 0x9017e110, 0x01014010, -+ 0x400000fd, 0x0381e021, 0x1345e240, 0x13c5e22e, -+ 0x400000fc, 0x400000fb -+}; -+ - static unsigned int macbook_pro_v2_pin_configs[10] = { - 0x0221401f, 0x90a70120, 0x01813024, 0x01014010, - 0x400000fd, 0x01016011, 0x1345e240, 0x13c5e22e, -@@ -571,8 +583,8 @@ static unsigned int *stac922x_brd_tbl[STAC_922X_MODELS] = { - [STAC_D945_REF] = ref922x_pin_configs, - [STAC_D945GTP3] = d945gtp3_pin_configs, - [STAC_D945GTP5] = d945gtp5_pin_configs, -- [STAC_MACMINI] = macbook_pro_v1_pin_configs, -- [STAC_MACBOOK] = macbook_pro_v1_pin_configs, -+ [STAC_MACMINI] = macmini_pin_configs, -+ [STAC_MACBOOK] = macbook_pin_configs, - [STAC_MACBOOK_PRO_V1] = macbook_pro_v1_pin_configs, - [STAC_MACBOOK_PRO_V2] = macbook_pro_v2_pin_configs, - [STAC_IMAC_INTEL] = imac_intel_pin_configs, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: Michael G. <mig...@gm...> - 2007-07-25 20:37:46
|
Hi, got this error message (revision 137): CC sound/pci/hda/patch_sigmatel.o sound/pci/hda/patch_sigmatel.c: In function =E2=80=98patch_stac922x=E2=80= =99: sound/pci/hda/patch_sigmatel.c:2130: error: duplicate case value sound/pci/hda/patch_sigmatel.c:2124: error: previously used here make[3]: *** [sound/pci/hda/patch_sigmatel.o] Error 1 make[2]: *** [sound/pci/hda] Error 2 make[1]: *** [sound/pci] Error 2 make: *** [sound] Error 2 Michael |
From: Nicolas B. <ni...@bo...> - 2007-07-25 20:46:34
|
You're fast .-) Thanks, fixed. Michael Gangolf wrote: > Hi, > got this error message (revision 137): > > CC sound/pci/hda/patch_sigmatel.o > sound/pci/hda/patch_sigmatel.c: In function ‘patch_stac922x’: > sound/pci/hda/patch_sigmatel.c:2130: error: duplicate case value > sound/pci/hda/patch_sigmatel.c:2124: error: previously used here > make[3]: *** [sound/pci/hda/patch_sigmatel.o] Error 1 > make[2]: *** [sound/pci/hda] Error 2 > make[1]: *** [sound/pci] Error 2 > make: *** [sound] Error 2 > > > Michael > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > Mactel-linux-devel mailing list > Mac...@li... > https://lists.sourceforge.net/lists/listinfo/mactel-linux-devel |
From: <nbo...@us...> - 2007-07-25 20:45:55
|
Revision: 138 http://mactel-linux.svn.sourceforge.net/mactel-linux/?rev=138&view=rev Author: nboichat Date: 2007-07-25 13:45:52 -0700 (Wed, 25 Jul 2007) Log Message: ----------- Fix compilation error. Modified Paths: -------------- trunk/kernel/mactel-patches-2.6.22/series Removed Paths: ------------- trunk/kernel/mactel-patches-2.6.22/sigmatel_audio_display_all_controls_when_subsystem_id_is_wrong-backport-2.6.23.patch Modified: trunk/kernel/mactel-patches-2.6.22/series =================================================================== --- trunk/kernel/mactel-patches-2.6.22/series 2007-07-25 19:54:24 UTC (rev 137) +++ trunk/kernel/mactel-patches-2.6.22/series 2007-07-25 20:45:52 UTC (rev 138) @@ -2,7 +2,6 @@ applesmc-use-input-polldev.patch applesmc-add-macbook-temperature-keys.patch sigmatel-backport-2.6.23.patch -sigmatel_audio_display_all_controls_when_subsystem_id_is_wrong-backport-2.6.23.patch applesmc_int.patch appletouch.patch appleir-undo-hid-blacklist.patch Deleted: trunk/kernel/mactel-patches-2.6.22/sigmatel_audio_display_all_controls_when_subsystem_id_is_wrong-backport-2.6.23.patch =================================================================== --- trunk/kernel/mactel-patches-2.6.22/sigmatel_audio_display_all_controls_when_subsystem_id_is_wrong-backport-2.6.23.patch 2007-07-25 19:54:24 UTC (rev 137) +++ trunk/kernel/mactel-patches-2.6.22/sigmatel_audio_display_all_controls_when_subsystem_id_is_wrong-backport-2.6.23.patch 2007-07-25 20:45:52 UTC (rev 138) @@ -1,24 +0,0 @@ -Display Macbook Pro 1st gen controls when the subsystem id is wrong (0x100). - -From: Nicolas Boichat <ni...@bo...> - - ---- - - sound/pci/hda/patch_sigmatel.c | 3 +++ - 1 files changed, 3 insertions(+), 0 deletions(-) - -diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c -index 329f4c0..cc67aef 100644 ---- a/sound/pci/hda/patch_sigmatel.c -+++ b/sound/pci/hda/patch_sigmatel.c -@@ -2121,6 +2121,9 @@ static int patch_stac922x(struct hda_codec *codec) - case 0x106b1700: - case 0x106b0200: - case 0x106b1e00: -+ case 0x100: /* Invalid subsystem ID, happens randomly on -+ * MacBook Pro 1st generation -+ */ - spec->board_config = STAC_INTEL_MAC_V3; - break; - case 0x106b1a00: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nbo...@us...> - 2007-09-07 07:43:46
|
Revision: 140 http://mactel-linux.svn.sourceforge.net/mactel-linux/?rev=140&view=rev Author: nboichat Date: 2007-09-07 00:43:37 -0700 (Fri, 07 Sep 2007) Log Message: ----------- Update to 2.6.22.6. AppleSMC: Retry when accessing keys, should fix some problems with monitoring applications. Modified Paths: -------------- trunk/kernel/mactel-patches-2.6.22/series Added Paths: ----------- trunk/kernel/mactel-patches-2.6.22/applesmc-retry-when-accessing-keys.patch Added: trunk/kernel/mactel-patches-2.6.22/applesmc-retry-when-accessing-keys.patch =================================================================== --- trunk/kernel/mactel-patches-2.6.22/applesmc-retry-when-accessing-keys.patch (rev 0) +++ trunk/kernel/mactel-patches-2.6.22/applesmc-retry-when-accessing-keys.patch 2007-09-07 07:43:37 UTC (rev 140) @@ -0,0 +1,115 @@ +Retry up to 200 ms when reading or writing keys. + +From: Nicolas Boichat <ni...@bo...> + + +--- + + 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 5d184a1..4451c9e 100644 +--- a/drivers/hwmon/applesmc.c ++++ b/drivers/hwmon/applesmc.c +@@ -124,6 +124,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 +@@ -198,12 +201,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 " +@@ -211,33 +215,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; + } + + /* Modified: trunk/kernel/mactel-patches-2.6.22/series =================================================================== --- trunk/kernel/mactel-patches-2.6.22/series 2007-08-12 07:25:09 UTC (rev 139) +++ trunk/kernel/mactel-patches-2.6.22/series 2007-09-07 07:43:37 UTC (rev 140) @@ -1,4 +1,4 @@ -# This series applies on GIT commit f44bba1a92e01bbab6ca9817b86ddf9e1744a616 +# This series applies on GIT commit 14d33e7fa86a09138b745030097a48c396cf4e57 applesmc-use-input-polldev.patch applesmc-add-macbook-temperature-keys.patch sigmatel-backport-2.6.23.patch @@ -6,3 +6,4 @@ appletouch.patch appleir-undo-hid-blacklist.patch appletouch-shut-up-when-it-has-nothing-to-say.patch +applesmc-retry-when-accessing-keys.patch This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: Sven A. <an...@an...> - 2007-09-26 19:23:25
Attachments:
signature.asc
anders.vcf
|
Hello! One question: Is it possible to program the applesmc to send an interrupt, if the light conditions changes? This would enable us to avoid polling of the light values (by a daemon). (Similar to the accelerometer interrupt for harddisk protection). Regards Sven -- Sven Anders <an...@an...> () Ascii Ribbon Campaign /\ Support plain text e-mail ANDURAS service solutions AG Innstraße 71 - 94036 Passau - Germany Web: www.anduras.de - Tel: +49 (0)851-4 90 50-0 - Fax: +49 (0)851-4 90 50-55 Rechtsform: Aktiengesellschaft - Sitz: Passau - Amtsgericht Passau HRB 6032 Mitglieder des Vorstands: Sven Anders, Marcus Junker Vorsitzender des Aufsichtsrats: Dipl. Kfm. Thomas Träger |