aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/macintosh
diff options
context:
space:
mode:
authorJeff Garzik <jgarzik@pretzel.yyz.us>2005-06-26 17:11:03 -0400
committerJeff Garzik <jgarzik@pobox.com>2005-06-26 17:11:03 -0400
commit8b0ee07e108b2eefdab5bb73f33223f18926c3b2 (patch)
treef68ca04180c5488301a40ec212ef2eb2467cf56c /drivers/macintosh
parent4638aef40ba9ebb9734caeed1f373c24015259fd (diff)
parent8678887e7fb43cd6c9be6c9807b05e77848e0920 (diff)
Merge upstream (approx. 2.6.12-git8) into 'janitor' branch of netdev-2.6.
Diffstat (limited to 'drivers/macintosh')
-rw-r--r--drivers/macintosh/adb.c9
-rw-r--r--drivers/macintosh/therm_adt746x.c138
-rw-r--r--drivers/macintosh/therm_pm72.c4
-rw-r--r--drivers/macintosh/therm_windtunnel.c10
-rw-r--r--drivers/macintosh/via-pmu.c12
5 files changed, 110 insertions, 63 deletions
diff --git a/drivers/macintosh/adb.c b/drivers/macintosh/adb.c
index 7297c77f99cf..493e2afa191c 100644
--- a/drivers/macintosh/adb.c
+++ b/drivers/macintosh/adb.c
@@ -77,7 +77,7 @@ static struct adb_driver *adb_driver_list[] = {
77 NULL 77 NULL
78}; 78};
79 79
80static struct class_simple *adb_dev_class; 80static struct class *adb_dev_class;
81 81
82struct adb_driver *adb_controller; 82struct adb_driver *adb_controller;
83struct notifier_block *adb_client_list = NULL; 83struct notifier_block *adb_client_list = NULL;
@@ -902,9 +902,8 @@ adbdev_init(void)
902 902
903 devfs_mk_cdev(MKDEV(ADB_MAJOR, 0), S_IFCHR | S_IRUSR | S_IWUSR, "adb"); 903 devfs_mk_cdev(MKDEV(ADB_MAJOR, 0), S_IFCHR | S_IRUSR | S_IWUSR, "adb");
904 904
905 adb_dev_class = class_simple_create(THIS_MODULE, "adb"); 905 adb_dev_class = class_create(THIS_MODULE, "adb");
906 if (IS_ERR(adb_dev_class)) { 906 if (IS_ERR(adb_dev_class))
907 return; 907 return;
908 } 908 class_device_create(adb_dev_class, MKDEV(ADB_MAJOR, 0), NULL, "adb");
909 class_simple_device_add(adb_dev_class, MKDEV(ADB_MAJOR, 0), NULL, "adb");
910} 909}
diff --git a/drivers/macintosh/therm_adt746x.c b/drivers/macintosh/therm_adt746x.c
index e0ac63effa55..c9ca1118e449 100644
--- a/drivers/macintosh/therm_adt746x.c
+++ b/drivers/macintosh/therm_adt746x.c
@@ -39,15 +39,16 @@
39#define MANUAL_MASK 0xe0 39#define MANUAL_MASK 0xe0
40#define AUTO_MASK 0x20 40#define AUTO_MASK 0x20
41 41
42static u8 TEMP_REG[3] = {0x26, 0x25, 0x27}; /* local, cpu, gpu */ 42static u8 TEMP_REG[3] = {0x26, 0x25, 0x27}; /* local, sensor1, sensor2 */
43static u8 LIMIT_REG[3] = {0x6b, 0x6a, 0x6c}; /* local, cpu, gpu */ 43static u8 LIMIT_REG[3] = {0x6b, 0x6a, 0x6c}; /* local, sensor1, sensor2 */
44static u8 MANUAL_MODE[2] = {0x5c, 0x5d}; 44static u8 MANUAL_MODE[2] = {0x5c, 0x5d};
45static u8 REM_CONTROL[2] = {0x00, 0x40}; 45static u8 REM_CONTROL[2] = {0x00, 0x40};
46static u8 FAN_SPEED[2] = {0x28, 0x2a}; 46static u8 FAN_SPEED[2] = {0x28, 0x2a};
47static u8 FAN_SPD_SET[2] = {0x30, 0x31}; 47static u8 FAN_SPD_SET[2] = {0x30, 0x31};
48 48
49static u8 default_limits_local[3] = {70, 50, 70}; /* local, cpu, gpu */ 49static u8 default_limits_local[3] = {70, 50, 70}; /* local, sensor1, sensor2 */
50static u8 default_limits_chip[3] = {80, 65, 80}; /* local, cpu, gpu */ 50static u8 default_limits_chip[3] = {80, 65, 80}; /* local, sensor1, sensor2 */
51static char *sensor_location[3] = {NULL, NULL, NULL};
51 52
52static int limit_adjust = 0; 53static int limit_adjust = 0;
53static int fan_speed = -1; 54static int fan_speed = -1;
@@ -58,7 +59,7 @@ MODULE_DESCRIPTION("Driver for ADT746x thermostat in iBook G4 and "
58MODULE_LICENSE("GPL"); 59MODULE_LICENSE("GPL");
59 60
60module_param(limit_adjust, int, 0644); 61module_param(limit_adjust, int, 0644);
61MODULE_PARM_DESC(limit_adjust,"Adjust maximum temperatures (50 cpu, 70 gpu) " 62MODULE_PARM_DESC(limit_adjust,"Adjust maximum temperatures (50 sensor1, 70 sensor2) "
62 "by N degrees."); 63 "by N degrees.");
63 64
64module_param(fan_speed, int, 0644); 65module_param(fan_speed, int, 0644);
@@ -213,10 +214,10 @@ static void write_fan_speed(struct thermostat *th, int speed, int fan)
213 if (th->last_speed[fan] != speed) { 214 if (th->last_speed[fan] != speed) {
214 if (speed == -1) 215 if (speed == -1)
215 printk(KERN_DEBUG "adt746x: Setting speed to automatic " 216 printk(KERN_DEBUG "adt746x: Setting speed to automatic "
216 "for %s fan.\n", fan?"GPU":"CPU"); 217 "for %s fan.\n", sensor_location[fan+1]);
217 else 218 else
218 printk(KERN_DEBUG "adt746x: Setting speed to %d " 219 printk(KERN_DEBUG "adt746x: Setting speed to %d "
219 "for %s fan.\n", speed, fan?"GPU":"CPU"); 220 "for %s fan.\n", speed, sensor_location[fan+1]);
220 } else 221 } else
221 return; 222 return;
222 223
@@ -300,11 +301,11 @@ static void update_fans_speed (struct thermostat *th)
300 printk(KERN_DEBUG "adt746x: setting fans speed to %d " 301 printk(KERN_DEBUG "adt746x: setting fans speed to %d "
301 "(limit exceeded by %d on %s) \n", 302 "(limit exceeded by %d on %s) \n",
302 new_speed, var, 303 new_speed, var,
303 fan_number?"GPU/pwr":"CPU"); 304 sensor_location[fan_number+1]);
304 write_both_fan_speed(th, new_speed); 305 write_both_fan_speed(th, new_speed);
305 th->last_var[fan_number] = var; 306 th->last_var[fan_number] = var;
306 } else if (var < -2) { 307 } else if (var < -2) {
307 /* don't stop fan if GPU/power is cold and CPU is not 308 /* don't stop fan if sensor2 is cold and sensor1 is not
308 * so cold (lastvar >= -1) */ 309 * so cold (lastvar >= -1) */
309 if (i == 2 && lastvar < -1) { 310 if (i == 2 && lastvar < -1) {
310 if (th->last_speed[fan_number] != 0) 311 if (th->last_speed[fan_number] != 0)
@@ -318,7 +319,7 @@ static void update_fans_speed (struct thermostat *th)
318 319
319 if (started) 320 if (started)
320 return; /* we don't want to re-stop the fan 321 return; /* we don't want to re-stop the fan
321 * if CPU is heating and GPU/power is not */ 322 * if sensor1 is heating and sensor2 is not */
322 } 323 }
323} 324}
324 325
@@ -327,9 +328,7 @@ static int monitor_task(void *arg)
327 struct thermostat* th = arg; 328 struct thermostat* th = arg;
328 329
329 while(!kthread_should_stop()) { 330 while(!kthread_should_stop()) {
330 if (current->flags & PF_FREEZE) 331 try_to_freeze();
331 refrigerator(PF_FREEZE);
332
333 msleep_interruptible(2000); 332 msleep_interruptible(2000);
334 333
335#ifndef DEBUG 334#ifndef DEBUG
@@ -353,7 +352,7 @@ static int monitor_task(void *arg)
353 352
354static void set_limit(struct thermostat *th, int i) 353static void set_limit(struct thermostat *th, int i)
355{ 354{
356 /* Set CPU limit higher to avoid powerdowns */ 355 /* Set sensor1 limit higher to avoid powerdowns */
357 th->limits[i] = default_limits_chip[i] + limit_adjust; 356 th->limits[i] = default_limits_chip[i] + limit_adjust;
358 write_reg(th, LIMIT_REG[i], th->limits[i]); 357 write_reg(th, LIMIT_REG[i], th->limits[i]);
359 358
@@ -454,15 +453,22 @@ static int attach_one_thermostat(struct i2c_adapter *adapter, int addr,
454 * pass around to the attribute functions, so we don't really have 453 * pass around to the attribute functions, so we don't really have
455 * choice but implement a bunch of them... 454 * choice but implement a bunch of them...
456 * 455 *
456 * FIXME, it does now...
457 */ 457 */
458#define BUILD_SHOW_FUNC_INT(name, data) \ 458#define BUILD_SHOW_FUNC_INT(name, data) \
459static ssize_t show_##name(struct device *dev, char *buf) \ 459static ssize_t show_##name(struct device *dev, struct device_attribute *attr, char *buf) \
460{ \ 460{ \
461 return sprintf(buf, "%d\n", data); \ 461 return sprintf(buf, "%d\n", data); \
462} 462}
463 463
464#define BUILD_SHOW_FUNC_STR(name, data) \
465static ssize_t show_##name(struct device *dev, struct device_attribute *attr, char *buf) \
466{ \
467 return sprintf(buf, "%s\n", data); \
468}
469
464#define BUILD_SHOW_FUNC_FAN(name, data) \ 470#define BUILD_SHOW_FUNC_FAN(name, data) \
465static ssize_t show_##name(struct device *dev, char *buf) \ 471static ssize_t show_##name(struct device *dev, struct device_attribute *attr, char *buf) \
466{ \ 472{ \
467 return sprintf(buf, "%d (%d rpm)\n", \ 473 return sprintf(buf, "%d (%d rpm)\n", \
468 thermostat->last_speed[data], \ 474 thermostat->last_speed[data], \
@@ -471,12 +477,12 @@ static ssize_t show_##name(struct device *dev, char *buf) \
471} 477}
472 478
473#define BUILD_STORE_FUNC_DEG(name, data) \ 479#define BUILD_STORE_FUNC_DEG(name, data) \
474static ssize_t store_##name(struct device *dev, const char *buf, size_t n) \ 480static ssize_t store_##name(struct device *dev, struct device_attribute *attr, const char *buf, size_t n) \
475{ \ 481{ \
476 int val; \ 482 int val; \
477 int i; \ 483 int i; \
478 val = simple_strtol(buf, NULL, 10); \ 484 val = simple_strtol(buf, NULL, 10); \
479 printk(KERN_INFO "Adjusting limits by %d°C\n", val); \ 485 printk(KERN_INFO "Adjusting limits by %d degrees\n", val); \
480 limit_adjust = val; \ 486 limit_adjust = val; \
481 for (i=0; i < 3; i++) \ 487 for (i=0; i < 3; i++) \
482 set_limit(thermostat, i); \ 488 set_limit(thermostat, i); \
@@ -484,7 +490,7 @@ static ssize_t store_##name(struct device *dev, const char *buf, size_t n) \
484} 490}
485 491
486#define BUILD_STORE_FUNC_INT(name, data) \ 492#define BUILD_STORE_FUNC_INT(name, data) \
487static ssize_t store_##name(struct device *dev, const char *buf, size_t n) \ 493static ssize_t store_##name(struct device *dev, struct device_attribute *attr, const char *buf, size_t n) \
488{ \ 494{ \
489 u32 val; \ 495 u32 val; \
490 val = simple_strtoul(buf, NULL, 10); \ 496 val = simple_strtoul(buf, NULL, 10); \
@@ -495,35 +501,41 @@ static ssize_t store_##name(struct device *dev, const char *buf, size_t n) \
495 return n; \ 501 return n; \
496} 502}
497 503
498BUILD_SHOW_FUNC_INT(cpu_temperature, (read_reg(thermostat, TEMP_REG[1]))) 504BUILD_SHOW_FUNC_INT(sensor1_temperature, (read_reg(thermostat, TEMP_REG[1])))
499BUILD_SHOW_FUNC_INT(gpu_temperature, (read_reg(thermostat, TEMP_REG[2]))) 505BUILD_SHOW_FUNC_INT(sensor2_temperature, (read_reg(thermostat, TEMP_REG[2])))
500BUILD_SHOW_FUNC_INT(cpu_limit, thermostat->limits[1]) 506BUILD_SHOW_FUNC_INT(sensor1_limit, thermostat->limits[1])
501BUILD_SHOW_FUNC_INT(gpu_limit, thermostat->limits[2]) 507BUILD_SHOW_FUNC_INT(sensor2_limit, thermostat->limits[2])
508BUILD_SHOW_FUNC_STR(sensor1_location, sensor_location[1])
509BUILD_SHOW_FUNC_STR(sensor2_location, sensor_location[2])
502 510
503BUILD_SHOW_FUNC_INT(specified_fan_speed, fan_speed) 511BUILD_SHOW_FUNC_INT(specified_fan_speed, fan_speed)
504BUILD_SHOW_FUNC_FAN(cpu_fan_speed, 0) 512BUILD_SHOW_FUNC_FAN(sensor1_fan_speed, 0)
505BUILD_SHOW_FUNC_FAN(gpu_fan_speed, 1) 513BUILD_SHOW_FUNC_FAN(sensor2_fan_speed, 1)
506 514
507BUILD_STORE_FUNC_INT(specified_fan_speed,fan_speed) 515BUILD_STORE_FUNC_INT(specified_fan_speed,fan_speed)
508BUILD_SHOW_FUNC_INT(limit_adjust, limit_adjust) 516BUILD_SHOW_FUNC_INT(limit_adjust, limit_adjust)
509BUILD_STORE_FUNC_DEG(limit_adjust, thermostat) 517BUILD_STORE_FUNC_DEG(limit_adjust, thermostat)
510 518
511static DEVICE_ATTR(cpu_temperature, S_IRUGO, 519static DEVICE_ATTR(sensor1_temperature, S_IRUGO,
512 show_cpu_temperature,NULL); 520 show_sensor1_temperature,NULL);
513static DEVICE_ATTR(gpu_temperature, S_IRUGO, 521static DEVICE_ATTR(sensor2_temperature, S_IRUGO,
514 show_gpu_temperature,NULL); 522 show_sensor2_temperature,NULL);
515static DEVICE_ATTR(cpu_limit, S_IRUGO, 523static DEVICE_ATTR(sensor1_limit, S_IRUGO,
516 show_cpu_limit, NULL); 524 show_sensor1_limit, NULL);
517static DEVICE_ATTR(gpu_limit, S_IRUGO, 525static DEVICE_ATTR(sensor2_limit, S_IRUGO,
518 show_gpu_limit, NULL); 526 show_sensor2_limit, NULL);
527static DEVICE_ATTR(sensor1_location, S_IRUGO,
528 show_sensor1_location, NULL);
529static DEVICE_ATTR(sensor2_location, S_IRUGO,
530 show_sensor2_location, NULL);
519 531
520static DEVICE_ATTR(specified_fan_speed, S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH, 532static DEVICE_ATTR(specified_fan_speed, S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH,
521 show_specified_fan_speed,store_specified_fan_speed); 533 show_specified_fan_speed,store_specified_fan_speed);
522 534
523static DEVICE_ATTR(cpu_fan_speed, S_IRUGO, 535static DEVICE_ATTR(sensor1_fan_speed, S_IRUGO,
524 show_cpu_fan_speed, NULL); 536 show_sensor1_fan_speed, NULL);
525static DEVICE_ATTR(gpu_fan_speed, S_IRUGO, 537static DEVICE_ATTR(sensor2_fan_speed, S_IRUGO,
526 show_gpu_fan_speed, NULL); 538 show_sensor2_fan_speed, NULL);
527 539
528static DEVICE_ATTR(limit_adjust, S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH, 540static DEVICE_ATTR(limit_adjust, S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH,
529 show_limit_adjust, store_limit_adjust); 541 show_limit_adjust, store_limit_adjust);
@@ -534,6 +546,7 @@ thermostat_init(void)
534{ 546{
535 struct device_node* np; 547 struct device_node* np;
536 u32 *prop; 548 u32 *prop;
549 int i = 0, offset = 0;
537 550
538 np = of_find_node_by_name(NULL, "fan"); 551 np = of_find_node_by_name(NULL, "fan");
539 if (!np) 552 if (!np)
@@ -545,6 +558,12 @@ thermostat_init(void)
545 else 558 else
546 return -ENODEV; 559 return -ENODEV;
547 560
561 prop = (u32 *)get_property(np, "hwsensor-params-version", NULL);
562 printk(KERN_INFO "adt746x: version %d (%ssupported)\n", *prop,
563 (*prop == 1)?"":"un");
564 if (*prop != 1)
565 return -ENODEV;
566
548 prop = (u32 *)get_property(np, "reg", NULL); 567 prop = (u32 *)get_property(np, "reg", NULL);
549 if (!prop) 568 if (!prop)
550 return -ENODEV; 569 return -ENODEV;
@@ -563,6 +582,23 @@ thermostat_init(void)
563 "limit_adjust: %d, fan_speed: %d\n", 582 "limit_adjust: %d, fan_speed: %d\n",
564 therm_bus, therm_address, limit_adjust, fan_speed); 583 therm_bus, therm_address, limit_adjust, fan_speed);
565 584
585 if (get_property(np, "hwsensor-location", NULL)) {
586 for (i = 0; i < 3; i++) {
587 sensor_location[i] = get_property(np,
588 "hwsensor-location", NULL) + offset;
589
590 if (sensor_location[i] == NULL)
591 sensor_location[i] = "";
592
593 printk(KERN_INFO "sensor %d: %s\n", i, sensor_location[i]);
594 offset += strlen(sensor_location[i]) + 1;
595 }
596 } else {
597 sensor_location[0] = "?";
598 sensor_location[1] = "?";
599 sensor_location[2] = "?";
600 }
601
566 of_dev = of_platform_device_create(np, "temperatures"); 602 of_dev = of_platform_device_create(np, "temperatures");
567 603
568 if (of_dev == NULL) { 604 if (of_dev == NULL) {
@@ -570,15 +606,17 @@ thermostat_init(void)
570 return -ENODEV; 606 return -ENODEV;
571 } 607 }
572 608
573 device_create_file(&of_dev->dev, &dev_attr_cpu_temperature); 609 device_create_file(&of_dev->dev, &dev_attr_sensor1_temperature);
574 device_create_file(&of_dev->dev, &dev_attr_gpu_temperature); 610 device_create_file(&of_dev->dev, &dev_attr_sensor2_temperature);
575 device_create_file(&of_dev->dev, &dev_attr_cpu_limit); 611 device_create_file(&of_dev->dev, &dev_attr_sensor1_limit);
576 device_create_file(&of_dev->dev, &dev_attr_gpu_limit); 612 device_create_file(&of_dev->dev, &dev_attr_sensor2_limit);
613 device_create_file(&of_dev->dev, &dev_attr_sensor1_location);
614 device_create_file(&of_dev->dev, &dev_attr_sensor2_location);
577 device_create_file(&of_dev->dev, &dev_attr_limit_adjust); 615 device_create_file(&of_dev->dev, &dev_attr_limit_adjust);
578 device_create_file(&of_dev->dev, &dev_attr_specified_fan_speed); 616 device_create_file(&of_dev->dev, &dev_attr_specified_fan_speed);
579 device_create_file(&of_dev->dev, &dev_attr_cpu_fan_speed); 617 device_create_file(&of_dev->dev, &dev_attr_sensor1_fan_speed);
580 if(therm_type == ADT7460) 618 if(therm_type == ADT7460)
581 device_create_file(&of_dev->dev, &dev_attr_gpu_fan_speed); 619 device_create_file(&of_dev->dev, &dev_attr_sensor2_fan_speed);
582 620
583#ifndef CONFIG_I2C_KEYWEST 621#ifndef CONFIG_I2C_KEYWEST
584 request_module("i2c-keywest"); 622 request_module("i2c-keywest");
@@ -591,17 +629,19 @@ static void __exit
591thermostat_exit(void) 629thermostat_exit(void)
592{ 630{
593 if (of_dev) { 631 if (of_dev) {
594 device_remove_file(&of_dev->dev, &dev_attr_cpu_temperature); 632 device_remove_file(&of_dev->dev, &dev_attr_sensor1_temperature);
595 device_remove_file(&of_dev->dev, &dev_attr_gpu_temperature); 633 device_remove_file(&of_dev->dev, &dev_attr_sensor2_temperature);
596 device_remove_file(&of_dev->dev, &dev_attr_cpu_limit); 634 device_remove_file(&of_dev->dev, &dev_attr_sensor1_limit);
597 device_remove_file(&of_dev->dev, &dev_attr_gpu_limit); 635 device_remove_file(&of_dev->dev, &dev_attr_sensor2_limit);
636 device_remove_file(&of_dev->dev, &dev_attr_sensor1_location);
637 device_remove_file(&of_dev->dev, &dev_attr_sensor2_location);
598 device_remove_file(&of_dev->dev, &dev_attr_limit_adjust); 638 device_remove_file(&of_dev->dev, &dev_attr_limit_adjust);
599 device_remove_file(&of_dev->dev, &dev_attr_specified_fan_speed); 639 device_remove_file(&of_dev->dev, &dev_attr_specified_fan_speed);
600 device_remove_file(&of_dev->dev, &dev_attr_cpu_fan_speed); 640 device_remove_file(&of_dev->dev, &dev_attr_sensor1_fan_speed);
601 641
602 if(therm_type == ADT7460) 642 if(therm_type == ADT7460)
603 device_remove_file(&of_dev->dev, 643 device_remove_file(&of_dev->dev,
604 &dev_attr_gpu_fan_speed); 644 &dev_attr_sensor2_fan_speed);
605 645
606 of_device_unregister(of_dev); 646 of_device_unregister(of_dev);
607 } 647 }
diff --git a/drivers/macintosh/therm_pm72.c b/drivers/macintosh/therm_pm72.c
index 82336a5a5474..feb4e2413858 100644
--- a/drivers/macintosh/therm_pm72.c
+++ b/drivers/macintosh/therm_pm72.c
@@ -685,7 +685,7 @@ static void fetch_cpu_pumps_minmax(void)
685 * the input twice... I accept patches :) 685 * the input twice... I accept patches :)
686 */ 686 */
687#define BUILD_SHOW_FUNC_FIX(name, data) \ 687#define BUILD_SHOW_FUNC_FIX(name, data) \
688static ssize_t show_##name(struct device *dev, char *buf) \ 688static ssize_t show_##name(struct device *dev, struct device_attribute *attr, char *buf) \
689{ \ 689{ \
690 ssize_t r; \ 690 ssize_t r; \
691 down(&driver_lock); \ 691 down(&driver_lock); \
@@ -694,7 +694,7 @@ static ssize_t show_##name(struct device *dev, char *buf) \
694 return r; \ 694 return r; \
695} 695}
696#define BUILD_SHOW_FUNC_INT(name, data) \ 696#define BUILD_SHOW_FUNC_INT(name, data) \
697static ssize_t show_##name(struct device *dev, char *buf) \ 697static ssize_t show_##name(struct device *dev, struct device_attribute *attr, char *buf) \
698{ \ 698{ \
699 return sprintf(buf, "%d", data); \ 699 return sprintf(buf, "%d", data); \
700} 700}
diff --git a/drivers/macintosh/therm_windtunnel.c b/drivers/macintosh/therm_windtunnel.c
index c153699d0f84..61400f04015e 100644
--- a/drivers/macintosh/therm_windtunnel.c
+++ b/drivers/macintosh/therm_windtunnel.c
@@ -51,8 +51,10 @@
51static int do_probe( struct i2c_adapter *adapter, int addr, int kind); 51static int do_probe( struct i2c_adapter *adapter, int addr, int kind);
52 52
53/* scan 0x48-0x4f (DS1775) and 0x2c-2x2f (ADM1030) */ 53/* scan 0x48-0x4f (DS1775) and 0x2c-2x2f (ADM1030) */
54static unsigned short normal_i2c[] = { 0x49, 0x2c, I2C_CLIENT_END }; 54static unsigned short normal_i2c[] = { 0x48, 0x49, 0x4a, 0x4b,
55static unsigned short normal_i2c_range[] = { 0x48, 0x4f, 0x2c, 0x2f, I2C_CLIENT_END }; 55 0x4c, 0x4d, 0x4e, 0x4f,
56 0x2c, 0x2d, 0x2e, 0x2f,
57 I2C_CLIENT_END };
56 58
57I2C_CLIENT_INSMOD; 59I2C_CLIENT_INSMOD;
58 60
@@ -107,13 +109,13 @@ print_temp( const char *s, int temp )
107} 109}
108 110
109static ssize_t 111static ssize_t
110show_cpu_temperature( struct device *dev, char *buf ) 112show_cpu_temperature( struct device *dev, struct device_attribute *attr, char *buf )
111{ 113{
112 return sprintf(buf, "%d.%d\n", x.temp>>8, (x.temp & 255)*10/256 ); 114 return sprintf(buf, "%d.%d\n", x.temp>>8, (x.temp & 255)*10/256 );
113} 115}
114 116
115static ssize_t 117static ssize_t
116show_case_temperature( struct device *dev, char *buf ) 118show_case_temperature( struct device *dev, struct device_attribute *attr, char *buf )
117{ 119{
118 return sprintf(buf, "%d.%d\n", x.casetemp>>8, (x.casetemp & 255)*10/256 ); 120 return sprintf(buf, "%d.%d\n", x.casetemp>>8, (x.casetemp & 255)*10/256 );
119} 121}
diff --git a/drivers/macintosh/via-pmu.c b/drivers/macintosh/via-pmu.c
index e654aa5eecd4..b941ee220997 100644
--- a/drivers/macintosh/via-pmu.c
+++ b/drivers/macintosh/via-pmu.c
@@ -2421,7 +2421,7 @@ pmac_wakeup_devices(void)
2421 2421
2422 /* Re-enable local CPU interrupts */ 2422 /* Re-enable local CPU interrupts */
2423 local_irq_enable(); 2423 local_irq_enable();
2424 mdelay(100); 2424 mdelay(10);
2425 preempt_enable(); 2425 preempt_enable();
2426 2426
2427 /* Re-enable clock spreading on some machines */ 2427 /* Re-enable clock spreading on some machines */
@@ -2549,7 +2549,9 @@ powerbook_sleep_Core99(void)
2549 return ret; 2549 return ret;
2550 } 2550 }
2551 2551
2552 printk(KERN_DEBUG "HID1, before: %x\n", mfspr(SPRN_HID1)); 2552 /* Stop environment and ADB interrupts */
2553 pmu_request(&req, NULL, 2, PMU_SET_INTR_MASK, 0);
2554 pmu_wait_complete(&req);
2553 2555
2554 /* Tell PMU what events will wake us up */ 2556 /* Tell PMU what events will wake us up */
2555 pmu_request(&req, NULL, 4, PMU_POWER_EVENTS, PMU_PWR_CLR_WAKEUP_EVENTS, 2557 pmu_request(&req, NULL, 4, PMU_POWER_EVENTS, PMU_PWR_CLR_WAKEUP_EVENTS,
@@ -2591,6 +2593,9 @@ powerbook_sleep_Core99(void)
2591 /* Restore VIA */ 2593 /* Restore VIA */
2592 restore_via_state(); 2594 restore_via_state();
2593 2595
2596 /* tweak LPJ before cpufreq is there */
2597 loops_per_jiffy *= 2;
2598
2594 /* Restore video */ 2599 /* Restore video */
2595 pmac_call_early_video_resume(); 2600 pmac_call_early_video_resume();
2596 2601
@@ -2611,7 +2616,8 @@ powerbook_sleep_Core99(void)
2611 pmu_request(&req, NULL, 2, PMU_SET_INTR_MASK, pmu_intr_mask); 2616 pmu_request(&req, NULL, 2, PMU_SET_INTR_MASK, pmu_intr_mask);
2612 pmu_wait_complete(&req); 2617 pmu_wait_complete(&req);
2613 2618
2614 printk(KERN_DEBUG "HID1, after: %x\n", mfspr(SPRN_HID1)); 2619 /* Restore LPJ, cpufreq will adjust the cpu frequency */
2620 loops_per_jiffy /= 2;
2615 2621
2616 pmac_wakeup_devices(); 2622 pmac_wakeup_devices();
2617 2623