aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/misc
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-12-16 16:53:53 -0500
committerIngo Molnar <mingo@elte.hu>2008-12-16 16:53:53 -0500
commitc15cb37cc4e9809624411333b96109ddf770e29c (patch)
tree3d4dbb48d97d5df9096ad815b99b20660cdc1bbf /drivers/misc
parent77be80e437fec44f8b7a620314b7d7b605b8d93b (diff)
parent8b1fae4e4200388b64dd88065639413cb3f1051c (diff)
Merge commit 'v2.6.28-rc8' into x86/uv
Diffstat (limited to 'drivers/misc')
-rw-r--r--drivers/misc/sgi-gru/grufault.c4
-rw-r--r--drivers/misc/sgi-gru/grufile.c2
-rw-r--r--drivers/misc/sony-laptop.c4
-rw-r--r--drivers/misc/thinkpad_acpi.c57
4 files changed, 52 insertions, 15 deletions
diff --git a/drivers/misc/sgi-gru/grufault.c b/drivers/misc/sgi-gru/grufault.c
index 8c389d606c30..3ee698ad8599 100644
--- a/drivers/misc/sgi-gru/grufault.c
+++ b/drivers/misc/sgi-gru/grufault.c
@@ -254,7 +254,11 @@ static int atomic_pte_lookup(struct vm_area_struct *vma, unsigned long vaddr,
254 return 1; 254 return 1;
255 255
256 *paddr = pte_pfn(pte) << PAGE_SHIFT; 256 *paddr = pte_pfn(pte) << PAGE_SHIFT;
257#ifdef CONFIG_HUGETLB_PAGE
257 *pageshift = is_vm_hugetlb_page(vma) ? HPAGE_SHIFT : PAGE_SHIFT; 258 *pageshift = is_vm_hugetlb_page(vma) ? HPAGE_SHIFT : PAGE_SHIFT;
259#else
260 *pageshift = PAGE_SHIFT;
261#endif
258 return 0; 262 return 0;
259 263
260err: 264err:
diff --git a/drivers/misc/sgi-gru/grufile.c b/drivers/misc/sgi-gru/grufile.c
index 5c027b6b4e5a..650983806392 100644
--- a/drivers/misc/sgi-gru/grufile.c
+++ b/drivers/misc/sgi-gru/grufile.c
@@ -481,7 +481,7 @@ struct vm_operations_struct gru_vm_ops = {
481 .fault = gru_fault, 481 .fault = gru_fault,
482}; 482};
483 483
484module_init(gru_init); 484fs_initcall(gru_init);
485module_exit(gru_exit); 485module_exit(gru_exit);
486 486
487module_param(gru_options, ulong, 0644); 487module_param(gru_options, ulong, 0644);
diff --git a/drivers/misc/sony-laptop.c b/drivers/misc/sony-laptop.c
index 7bcb81002dcf..571b211608d1 100644
--- a/drivers/misc/sony-laptop.c
+++ b/drivers/misc/sony-laptop.c
@@ -1038,8 +1038,8 @@ static int sony_nc_add(struct acpi_device *device)
1038 goto outinput; 1038 goto outinput;
1039 } 1039 }
1040 1040
1041 if (!acpi_video_backlight_support()) { 1041 if (acpi_video_backlight_support()) {
1042 printk(KERN_INFO DRV_PFX "Sony: Brightness ignored, must be " 1042 printk(KERN_INFO DRV_PFX "brightness ignored, must be "
1043 "controlled by ACPI video driver\n"); 1043 "controlled by ACPI video driver\n");
1044 } else if (ACPI_SUCCESS(acpi_get_handle(sony_nc_acpi_handle, "GBRT", 1044 } else if (ACPI_SUCCESS(acpi_get_handle(sony_nc_acpi_handle, "GBRT",
1045 &handle))) { 1045 &handle))) {
diff --git a/drivers/misc/thinkpad_acpi.c b/drivers/misc/thinkpad_acpi.c
index 7a4a26b0edd2..899766e16fa8 100644
--- a/drivers/misc/thinkpad_acpi.c
+++ b/drivers/misc/thinkpad_acpi.c
@@ -5318,6 +5318,7 @@ static enum fan_control_commands fan_control_commands;
5318 5318
5319static u8 fan_control_initial_status; 5319static u8 fan_control_initial_status;
5320static u8 fan_control_desired_level; 5320static u8 fan_control_desired_level;
5321static u8 fan_control_resume_level;
5321static int fan_watchdog_maxinterval; 5322static int fan_watchdog_maxinterval;
5322 5323
5323static struct mutex fan_mutex; 5324static struct mutex fan_mutex;
@@ -5440,8 +5441,8 @@ static int fan_set_level(int level)
5440 5441
5441 case TPACPI_FAN_WR_ACPI_FANS: 5442 case TPACPI_FAN_WR_ACPI_FANS:
5442 case TPACPI_FAN_WR_TPEC: 5443 case TPACPI_FAN_WR_TPEC:
5443 if ((level != TP_EC_FAN_AUTO) && 5444 if (!(level & TP_EC_FAN_AUTO) &&
5444 (level != TP_EC_FAN_FULLSPEED) && 5445 !(level & TP_EC_FAN_FULLSPEED) &&
5445 ((level < 0) || (level > 7))) 5446 ((level < 0) || (level > 7)))
5446 return -EINVAL; 5447 return -EINVAL;
5447 5448
@@ -6005,38 +6006,67 @@ static void fan_exit(void)
6005 6006
6006static void fan_suspend(pm_message_t state) 6007static void fan_suspend(pm_message_t state)
6007{ 6008{
6009 int rc;
6010
6008 if (!fan_control_allowed) 6011 if (!fan_control_allowed)
6009 return; 6012 return;
6010 6013
6011 /* Store fan status in cache */ 6014 /* Store fan status in cache */
6012 fan_get_status_safe(NULL); 6015 fan_control_resume_level = 0;
6016 rc = fan_get_status_safe(&fan_control_resume_level);
6017 if (rc < 0)
6018 printk(TPACPI_NOTICE
6019 "failed to read fan level for later "
6020 "restore during resume: %d\n", rc);
6021
6022 /* if it is undefined, don't attempt to restore it.
6023 * KEEP THIS LAST */
6013 if (tp_features.fan_ctrl_status_undef) 6024 if (tp_features.fan_ctrl_status_undef)
6014 fan_control_desired_level = TP_EC_FAN_AUTO; 6025 fan_control_resume_level = 0;
6015} 6026}
6016 6027
6017static void fan_resume(void) 6028static void fan_resume(void)
6018{ 6029{
6019 u8 saved_fan_level;
6020 u8 current_level = 7; 6030 u8 current_level = 7;
6021 bool do_set = false; 6031 bool do_set = false;
6032 int rc;
6022 6033
6023 /* DSDT *always* updates status on resume */ 6034 /* DSDT *always* updates status on resume */
6024 tp_features.fan_ctrl_status_undef = 0; 6035 tp_features.fan_ctrl_status_undef = 0;
6025 6036
6026 saved_fan_level = fan_control_desired_level;
6027 if (!fan_control_allowed || 6037 if (!fan_control_allowed ||
6038 !fan_control_resume_level ||
6028 (fan_get_status_safe(&current_level) < 0)) 6039 (fan_get_status_safe(&current_level) < 0))
6029 return; 6040 return;
6030 6041
6031 switch (fan_control_access_mode) { 6042 switch (fan_control_access_mode) {
6032 case TPACPI_FAN_WR_ACPI_SFAN: 6043 case TPACPI_FAN_WR_ACPI_SFAN:
6033 do_set = (saved_fan_level > current_level); 6044 /* never decrease fan level */
6045 do_set = (fan_control_resume_level > current_level);
6034 break; 6046 break;
6035 case TPACPI_FAN_WR_ACPI_FANS: 6047 case TPACPI_FAN_WR_ACPI_FANS:
6036 case TPACPI_FAN_WR_TPEC: 6048 case TPACPI_FAN_WR_TPEC:
6037 do_set = ((saved_fan_level & TP_EC_FAN_FULLSPEED) || 6049 /* never decrease fan level, scale is:
6038 (saved_fan_level == 7 && 6050 * TP_EC_FAN_FULLSPEED > 7 >= TP_EC_FAN_AUTO
6039 !(current_level & TP_EC_FAN_FULLSPEED))); 6051 *
6052 * We expect the firmware to set either 7 or AUTO, but we
6053 * handle FULLSPEED out of paranoia.
6054 *
6055 * So, we can safely only restore FULLSPEED or 7, anything
6056 * else could slow the fan. Restoring AUTO is useless, at
6057 * best that's exactly what the DSDT already set (it is the
6058 * slower it uses).
6059 *
6060 * Always keep in mind that the DSDT *will* have set the
6061 * fans to what the vendor supposes is the best level. We
6062 * muck with it only to speed the fan up.
6063 */
6064 if (fan_control_resume_level != 7 &&
6065 !(fan_control_resume_level & TP_EC_FAN_FULLSPEED))
6066 return;
6067 else
6068 do_set = !(current_level & TP_EC_FAN_FULLSPEED) &&
6069 (current_level != fan_control_resume_level);
6040 break; 6070 break;
6041 default: 6071 default:
6042 return; 6072 return;
@@ -6044,8 +6074,11 @@ static void fan_resume(void)
6044 if (do_set) { 6074 if (do_set) {
6045 printk(TPACPI_NOTICE 6075 printk(TPACPI_NOTICE
6046 "restoring fan level to 0x%02x\n", 6076 "restoring fan level to 0x%02x\n",
6047 saved_fan_level); 6077 fan_control_resume_level);
6048 fan_set_level_safe(saved_fan_level); 6078 rc = fan_set_level_safe(fan_control_resume_level);
6079 if (rc < 0)
6080 printk(TPACPI_NOTICE
6081 "failed to restore fan level: %d\n", rc);
6049 } 6082 }
6050} 6083}
6051 6084