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 <[EMAIL PROTECTED]>
+
+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 <[EMAIL PROTECTED]>
+---
+
+ 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 <[EMAIL PROTECTED]>
-
-
----
-
- 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.

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Mactel-linux-devel mailing list
Mactel-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mactel-linux-devel

Reply via email to