Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 129880
b: refs/heads/master
c: 106b4e6
h: refs/heads/master
v: v3
  • Loading branch information
Henrique de Moraes Holschuh authored and Len Brown committed Jan 15, 2009
1 parent 526d278 commit 926bd5c
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3827e7a3fd03718d4d204c66d9e3ab9b125ae552
refs/heads/master: 106b4e6657e10831f35c32afa26d9c11e6312783
63 changes: 59 additions & 4 deletions trunk/drivers/platform/x86/thinkpad_acpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,12 @@ enum {

/* Debugging */
#define TPACPI_LOG TPACPI_FILE ": "
#define TPACPI_ERR KERN_ERR TPACPI_LOG
#define TPACPI_NOTICE KERN_NOTICE TPACPI_LOG
#define TPACPI_INFO KERN_INFO TPACPI_LOG
#define TPACPI_DEBUG KERN_DEBUG TPACPI_LOG
#define TPACPI_ALERT KERN_ALERT TPACPI_LOG
#define TPACPI_CRIT KERN_CRIT TPACPI_LOG
#define TPACPI_ERR KERN_ERR TPACPI_LOG
#define TPACPI_NOTICE KERN_NOTICE TPACPI_LOG
#define TPACPI_INFO KERN_INFO TPACPI_LOG
#define TPACPI_DEBUG KERN_DEBUG TPACPI_LOG

#define TPACPI_DBG_ALL 0xffff
#define TPACPI_DBG_INIT 0x0001
Expand Down Expand Up @@ -2614,6 +2616,15 @@ static bool hotkey_notify_wakeup(const u32 hkey,
*ignore_acpi_ev = true;
break;

case 0x2313: /* Battery on critical low level (S3) */
case 0x2413: /* Battery on critical low level (S4) */
printk(TPACPI_ALERT
"EMERGENCY WAKEUP: battery almost empty\n");
/* how to auto-heal: */
/* 2313: woke up from S3, go to S4/S5 */
/* 2413: woke up from S4, go to S5 */
break;

default:
return false;
}
Expand Down Expand Up @@ -2659,6 +2670,45 @@ static bool hotkey_notify_usrevent(const u32 hkey,
}
}

static bool hotkey_notify_thermal(const u32 hkey,
bool *send_acpi_ev,
bool *ignore_acpi_ev)
{
/* 0x6000-0x6FFF: thermal alarms */
*send_acpi_ev = true;
*ignore_acpi_ev = false;

switch (hkey) {
case 0x6011:
printk(TPACPI_CRIT
"THERMAL ALARM: battery is too hot!\n");
/* recommended action: warn user through gui */
return true;
case 0x6012:
printk(TPACPI_ALERT
"THERMAL EMERGENCY: battery is extremely hot!\n");
/* recommended action: immediate sleep/hibernate */
return true;
case 0x6021:
printk(TPACPI_CRIT
"THERMAL ALARM: "
"a sensor reports something is too hot!\n");
/* recommended action: warn user through gui, that */
/* some internal component is too hot */
return true;
case 0x6022:
printk(TPACPI_ALERT
"THERMAL EMERGENCY: "
"a sensor reports something is extremely hot!\n");
/* recommended action: immediate sleep/hibernate */
return true;
default:
printk(TPACPI_ALERT
"THERMAL ALERT: unknown thermal alarm received\n");
return false;
}
}

static void hotkey_notify(struct ibm_struct *ibm, u32 event)
{
u32 hkey;
Expand Down Expand Up @@ -2731,6 +2781,11 @@ static void hotkey_notify(struct ibm_struct *ibm, u32 event)
known_ev = hotkey_notify_usrevent(hkey, &send_acpi_ev,
&ignore_acpi_ev);
break;
case 6:
/* 0x6000-0x6FFF: thermal alarms */
known_ev = hotkey_notify_thermal(hkey, &send_acpi_ev,
&ignore_acpi_ev);
break;
case 7:
/* 0x7000-0x7FFF: misc */
if (tp_features.hotkey_wlsw && hkey == 0x7000) {
Expand Down

0 comments on commit 926bd5c

Please sign in to comment.