summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile2
-rw-r--r--debian/changelog6
-rw-r--r--debian/postinst2
-rw-r--r--debian/postrm2
-rw-r--r--debian/prerm2
-rwxr-xr-xdebian/rules2
-rw-r--r--usr/src/dkms_source_tree/applesmc.c61
-rw-r--r--usr/src/dkms_source_tree/dkms.conf2
8 files changed, 59 insertions, 20 deletions
diff --git a/Makefile b/Makefile
index 246fb9f..adeaff1 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,5 @@
1NAME = applesmc 1NAME = applesmc
2VERSION = 0.14.4 2VERSION = 0.15.1
3SRC = usr/src 3SRC = usr/src
4 4
5TARBALL = $(NAME)-$(VERSION).dkms.tar.gz 5TARBALL = $(NAME)-$(VERSION).dkms.tar.gz
diff --git a/debian/changelog b/debian/changelog
index 1975276..ae48e19 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
1applesmc-dkms (0.15.1) unstable; urgency=low
2
3 * Update to kernel 2.6.34-rc5
4
5 -- Henrik Rydberg <rydberg@euromail.se> Sat, 24 Apr 2010 12:59:47 +0200
6
1applesmc-dkms (0.14.4) unstable; urgency=low 7applesmc-dkms (0.14.4) unstable; urgency=low
2 8
3 * Rebuild for jaunty 9 * Rebuild for jaunty
diff --git a/debian/postinst b/debian/postinst
index 29d68f7..f4ef2fd 100644
--- a/debian/postinst
+++ b/debian/postinst
@@ -3,7 +3,7 @@
3set -e 3set -e
4 4
5NAME=applesmc 5NAME=applesmc
6VERSION=0.14.4 6VERSION=0.15.1
7 7
8case "$1" in 8case "$1" in
9 configure) 9 configure)
diff --git a/debian/postrm b/debian/postrm
index 66a9926..a548ec9 100644
--- a/debian/postrm
+++ b/debian/postrm
@@ -1,7 +1,7 @@
1#!/bin/sh 1#!/bin/sh
2 2
3NAME=applesmc 3NAME=applesmc
4VERSION=0.14.4 4VERSION=0.15.1
5 5
6set -e 6set -e
7 7
diff --git a/debian/prerm b/debian/prerm
index bdeaad0..3207094 100644
--- a/debian/prerm
+++ b/debian/prerm
@@ -1,7 +1,7 @@
1#!/bin/sh 1#!/bin/sh
2 2
3NAME=applesmc 3NAME=applesmc
4VERSION=0.14.4 4VERSION=0.15.1
5 5
6set -e 6set -e
7 7
diff --git a/debian/rules b/debian/rules
index d804964..048bc63 100755
--- a/debian/rules
+++ b/debian/rules
@@ -5,7 +5,7 @@
5#export DH_VERBOSE=1 5#export DH_VERBOSE=1
6 6
7NAME=applesmc 7NAME=applesmc
8VERSION=0.14.4 8VERSION=0.15.1
9 9
10configure: configure-stamp 10configure: configure-stamp
11configure-stamp: 11configure-stamp:
diff --git a/usr/src/dkms_source_tree/applesmc.c b/usr/src/dkms_source_tree/applesmc.c
index b007023..0f28d91 100644
--- a/usr/src/dkms_source_tree/applesmc.c
+++ b/usr/src/dkms_source_tree/applesmc.c
@@ -35,7 +35,7 @@
35#include <linux/dmi.h> 35#include <linux/dmi.h>
36#include <linux/mutex.h> 36#include <linux/mutex.h>
37#include <linux/hwmon-sysfs.h> 37#include <linux/hwmon-sysfs.h>
38#include <asm/io.h> 38#include <linux/io.h>
39#include <linux/leds.h> 39#include <linux/leds.h>
40#include <linux/hwmon.h> 40#include <linux/hwmon.h>
41#include <linux/workqueue.h> 41#include <linux/workqueue.h>
@@ -142,6 +142,12 @@ static const char *temperature_sensors_sets[][41] = {
142 "TM1S", "TM2P", "TM2S", "TM3S", "TM8P", "TM8S", "TM9P", "TM9S", 142 "TM1S", "TM2P", "TM2S", "TM3S", "TM8P", "TM8S", "TM9P", "TM9S",
143 "TN0C", "TN0D", "TN0H", "TS0C", "Tp0C", "Tp1C", "Tv0S", "Tv1S", 143 "TN0C", "TN0D", "TN0H", "TS0C", "Tp0C", "Tp1C", "Tv0S", "Tv1S",
144 NULL }, 144 NULL },
145/* Set 17: iMac 9,1 */
146 { "TA0P", "TC0D", "TC0H", "TC0P", "TG0D", "TG0H", "TH0P", "TL0P",
147 "TN0D", "TN0H", "TN0P", "TO0P", "Tm0P", "Tp0P", NULL },
148/* Set 18: MacBook Pro 2,2 */
149 { "TB0T", "TC0D", "TC0P", "TG0H", "TG0P", "TG0T", "TM0P", "TTF0",
150 "Th0H", "Th1H", "Tm0P", "Ts0P", NULL },
145}; 151};
146 152
147/* List of keys used to read/write fan speeds */ 153/* List of keys used to read/write fan speeds */
@@ -178,6 +184,8 @@ static const int debug;
178static struct platform_device *pdev; 184static struct platform_device *pdev;
179static s16 rest_x; 185static s16 rest_x;
180static s16 rest_y; 186static s16 rest_y;
187static u8 backlight_state[2];
188
181static struct device *hwmon_dev; 189static struct device *hwmon_dev;
182static struct input_polled_dev *applesmc_idev; 190static struct input_polled_dev *applesmc_idev;
183 191
@@ -497,17 +505,36 @@ static int applesmc_probe(struct platform_device *dev)
497 return 0; 505 return 0;
498} 506}
499 507
500static int applesmc_resume(struct platform_device *dev) 508/* Synchronize device with memorized backlight state */
509static int applesmc_pm_resume(struct device *dev)
501{ 510{
502 return applesmc_device_init(); 511 mutex_lock(&applesmc_lock);
512 if (applesmc_light)
513 applesmc_write_key(BACKLIGHT_KEY, backlight_state, 2);
514 mutex_unlock(&applesmc_lock);
515 return 0;
503} 516}
504 517
518/* Reinitialize device on resume from hibernation */
519static int applesmc_pm_restore(struct device *dev)
520{
521 int ret = applesmc_device_init();
522 if (ret)
523 return ret;
524 return applesmc_pm_resume(dev);
525}
526
527static const struct dev_pm_ops applesmc_pm_ops = {
528 .resume = applesmc_pm_resume,
529 .restore = applesmc_pm_restore,
530};
531
505static struct platform_driver applesmc_driver = { 532static struct platform_driver applesmc_driver = {
506 .probe = applesmc_probe, 533 .probe = applesmc_probe,
507 .resume = applesmc_resume,
508 .driver = { 534 .driver = {
509 .name = "applesmc", 535 .name = "applesmc",
510 .owner = THIS_MODULE, 536 .owner = THIS_MODULE,
537 .pm = &applesmc_pm_ops,
511 }, 538 },
512}; 539};
513 540
@@ -591,7 +618,7 @@ static ssize_t applesmc_light_show(struct device *dev,
591 ret = applesmc_get_key_type(LIGHT_SENSOR_LEFT_KEY, query); 618 ret = applesmc_get_key_type(LIGHT_SENSOR_LEFT_KEY, query);
592 if (ret) 619 if (ret)
593 goto out; 620 goto out;
594 data_length = query[0]; 621 data_length = clamp_val(query[0], 0, 10);
595 printk(KERN_INFO "applesmc: light sensor data length set to " 622 printk(KERN_INFO "applesmc: light sensor data length set to "
596 "%d\n", data_length); 623 "%d\n", data_length);
597 } 624 }
@@ -804,17 +831,10 @@ static ssize_t applesmc_calibrate_store(struct device *dev,
804 return count; 831 return count;
805} 832}
806 833
807/* Store the next backlight value to be written by the work */
808static unsigned int backlight_value;
809
810static void applesmc_backlight_set(struct work_struct *work) 834static void applesmc_backlight_set(struct work_struct *work)
811{ 835{
812 u8 buffer[2];
813
814 mutex_lock(&applesmc_lock); 836 mutex_lock(&applesmc_lock);
815 buffer[0] = backlight_value; 837 applesmc_write_key(BACKLIGHT_KEY, backlight_state, 2);
816 buffer[1] = 0x00;
817 applesmc_write_key(BACKLIGHT_KEY, buffer, 2);
818 mutex_unlock(&applesmc_lock); 838 mutex_unlock(&applesmc_lock);
819} 839}
820static DECLARE_WORK(backlight_work, &applesmc_backlight_set); 840static DECLARE_WORK(backlight_work, &applesmc_backlight_set);
@@ -824,7 +844,7 @@ static void applesmc_brightness_set(struct led_classdev *led_cdev,
824{ 844{
825 int ret; 845 int ret;
826 846
827 backlight_value = value; 847 backlight_state[0] = value;
828 ret = queue_work(applesmc_led_wq, &backlight_work); 848 ret = queue_work(applesmc_led_wq, &backlight_work);
829 849
830 if (debug && (!ret)) 850 if (debug && (!ret))
@@ -1336,6 +1356,10 @@ static __initdata struct dmi_match_data applesmc_dmi_data[] = {
1336 { .accelerometer = 1, .light = 1, .temperature_set = 15 }, 1356 { .accelerometer = 1, .light = 1, .temperature_set = 15 },
1337/* MacPro3,1: temperature set 16 */ 1357/* MacPro3,1: temperature set 16 */
1338 { .accelerometer = 0, .light = 0, .temperature_set = 16 }, 1358 { .accelerometer = 0, .light = 0, .temperature_set = 16 },
1359/* iMac 9,1: light sensor only, temperature set 17 */
1360 { .accelerometer = 0, .light = 0, .temperature_set = 17 },
1361/* MacBook Pro 2,2: accelerometer, backlight and temperature set 18 */
1362 { .accelerometer = 1, .light = 1, .temperature_set = 18 },
1339}; 1363};
1340 1364
1341/* Note that DMI_MATCH(...,"MacBook") will match "MacBookPro1,1". 1365/* Note that DMI_MATCH(...,"MacBook") will match "MacBookPro1,1".
@@ -1361,6 +1385,10 @@ static __initdata struct dmi_system_id applesmc_whitelist[] = {
1361 DMI_MATCH(DMI_BOARD_VENDOR, "Apple"), 1385 DMI_MATCH(DMI_BOARD_VENDOR, "Apple"),
1362 DMI_MATCH(DMI_PRODUCT_NAME, "MacBookPro3") }, 1386 DMI_MATCH(DMI_PRODUCT_NAME, "MacBookPro3") },
1363 &applesmc_dmi_data[9]}, 1387 &applesmc_dmi_data[9]},
1388 { applesmc_dmi_match, "Apple MacBook Pro 2,2", {
1389 DMI_MATCH(DMI_BOARD_VENDOR, "Apple Computer, Inc."),
1390 DMI_MATCH(DMI_PRODUCT_NAME, "MacBookPro2,2") },
1391 &applesmc_dmi_data[18]},
1364 { applesmc_dmi_match, "Apple MacBook Pro", { 1392 { applesmc_dmi_match, "Apple MacBook Pro", {
1365 DMI_MATCH(DMI_BOARD_VENDOR,"Apple"), 1393 DMI_MATCH(DMI_BOARD_VENDOR,"Apple"),
1366 DMI_MATCH(DMI_PRODUCT_NAME,"MacBookPro") }, 1394 DMI_MATCH(DMI_PRODUCT_NAME,"MacBookPro") },
@@ -1401,6 +1429,10 @@ static __initdata struct dmi_system_id applesmc_whitelist[] = {
1401 DMI_MATCH(DMI_BOARD_VENDOR, "Apple"), 1429 DMI_MATCH(DMI_BOARD_VENDOR, "Apple"),
1402 DMI_MATCH(DMI_PRODUCT_NAME, "MacPro") }, 1430 DMI_MATCH(DMI_PRODUCT_NAME, "MacPro") },
1403 &applesmc_dmi_data[4]}, 1431 &applesmc_dmi_data[4]},
1432 { applesmc_dmi_match, "Apple iMac 9,1", {
1433 DMI_MATCH(DMI_BOARD_VENDOR, "Apple Inc."),
1434 DMI_MATCH(DMI_PRODUCT_NAME, "iMac9,1") },
1435 &applesmc_dmi_data[17]},
1404 { applesmc_dmi_match, "Apple iMac 8", { 1436 { applesmc_dmi_match, "Apple iMac 8", {
1405 DMI_MATCH(DMI_BOARD_VENDOR, "Apple"), 1437 DMI_MATCH(DMI_BOARD_VENDOR, "Apple"),
1406 DMI_MATCH(DMI_PRODUCT_NAME, "iMac8") }, 1438 DMI_MATCH(DMI_PRODUCT_NAME, "iMac8") },
@@ -1607,3 +1639,4 @@ module_exit(applesmc_exit);
1607MODULE_AUTHOR("Nicolas Boichat"); 1639MODULE_AUTHOR("Nicolas Boichat");
1608MODULE_DESCRIPTION("Apple SMC"); 1640MODULE_DESCRIPTION("Apple SMC");
1609MODULE_LICENSE("GPL v2"); 1641MODULE_LICENSE("GPL v2");
1642MODULE_DEVICE_TABLE(dmi, applesmc_whitelist);
diff --git a/usr/src/dkms_source_tree/dkms.conf b/usr/src/dkms_source_tree/dkms.conf
index acdcd2b..7f37bde 100644
--- a/usr/src/dkms_source_tree/dkms.conf
+++ b/usr/src/dkms_source_tree/dkms.conf
@@ -1,5 +1,5 @@
1NAME=applesmc 1NAME=applesmc
2VERSION=0.14.4 2VERSION=0.15.1
3PACKAGE_NAME="$NAME" 3PACKAGE_NAME="$NAME"
4PACKAGE_VERSION="$VERSION" 4PACKAGE_VERSION="$VERSION"
5MAKE[0]="make -C ${kernel_source_dir} 5MAKE[0]="make -C ${kernel_source_dir}