aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/laptops/thinkpad-acpi.txt2
-rw-r--r--drivers/platform/x86/thinkpad_acpi.c44
2 files changed, 37 insertions, 9 deletions
diff --git a/Documentation/laptops/thinkpad-acpi.txt b/Documentation/laptops/thinkpad-acpi.txt
index 4bc92ea93f25..61815483efa3 100644
--- a/Documentation/laptops/thinkpad-acpi.txt
+++ b/Documentation/laptops/thinkpad-acpi.txt
@@ -547,6 +547,8 @@ Events that are propagated by the driver to userspace:
5470x3006 Bay hotplug request (hint to power up SATA link when 5470x3006 Bay hotplug request (hint to power up SATA link when
548 the optical drive tray is ejected) 548 the optical drive tray is ejected)
5490x4003 Undocked (see 0x2x04), can sleep again 5490x4003 Undocked (see 0x2x04), can sleep again
5500x4010 Docked into hotplug port replicator (non-ACPI dock)
5510x4011 Undocked from hotplug port replicator (non-ACPI dock)
5500x500B Tablet pen inserted into its storage bay 5520x500B Tablet pen inserted into its storage bay
5510x500C Tablet pen removed from its storage bay 5530x500C Tablet pen removed from its storage bay
5520x6011 ALARM: battery is too hot 5540x6011 ALARM: battery is too hot
diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
index cdcd2388af2b..26c5b117df22 100644
--- a/drivers/platform/x86/thinkpad_acpi.c
+++ b/drivers/platform/x86/thinkpad_acpi.c
@@ -184,6 +184,10 @@ enum tpacpi_hkey_event_t {
184 184
185 /* Misc bay events */ 185 /* Misc bay events */
186 TP_HKEY_EV_OPTDRV_EJ = 0x3006, /* opt. drive tray ejected */ 186 TP_HKEY_EV_OPTDRV_EJ = 0x3006, /* opt. drive tray ejected */
187 TP_HKEY_EV_HOTPLUG_DOCK = 0x4010, /* docked into hotplug dock
188 or port replicator */
189 TP_HKEY_EV_HOTPLUG_UNDOCK = 0x4011, /* undocked from hotplug
190 dock or port replicator */
187 191
188 /* User-interface events */ 192 /* User-interface events */
189 TP_HKEY_EV_LID_CLOSE = 0x5001, /* laptop lid closed */ 193 TP_HKEY_EV_LID_CLOSE = 0x5001, /* laptop lid closed */
@@ -3521,6 +3525,34 @@ static bool hotkey_notify_wakeup(const u32 hkey,
3521 return true; 3525 return true;
3522} 3526}
3523 3527
3528static bool hotkey_notify_dockevent(const u32 hkey,
3529 bool *send_acpi_ev,
3530 bool *ignore_acpi_ev)
3531{
3532 /* 0x4000-0x4FFF: dock-related events */
3533 *send_acpi_ev = true;
3534 *ignore_acpi_ev = false;
3535
3536 switch (hkey) {
3537 case TP_HKEY_EV_UNDOCK_ACK:
3538 /* ACPI undock operation completed after wakeup */
3539 hotkey_autosleep_ack = 1;
3540 pr_info("undocked\n");
3541 hotkey_wakeup_hotunplug_complete_notify_change();
3542 return true;
3543
3544 case TP_HKEY_EV_HOTPLUG_DOCK: /* docked to port replicator */
3545 pr_info("docked into hotplug port replicator\n");
3546 return true;
3547 case TP_HKEY_EV_HOTPLUG_UNDOCK: /* undocked from port replicator */
3548 pr_info("undocked from hotplug port replicator\n");
3549 return true;
3550
3551 default:
3552 return false;
3553 }
3554}
3555
3524static bool hotkey_notify_usrevent(const u32 hkey, 3556static bool hotkey_notify_usrevent(const u32 hkey,
3525 bool *send_acpi_ev, 3557 bool *send_acpi_ev,
3526 bool *ignore_acpi_ev) 3558 bool *ignore_acpi_ev)
@@ -3669,15 +3701,9 @@ static void hotkey_notify(struct ibm_struct *ibm, u32 event)
3669 } 3701 }
3670 break; 3702 break;
3671 case 4: 3703 case 4:
3672 /* 0x4000-0x4FFF: dock-related wakeups */ 3704 /* 0x4000-0x4FFF: dock-related events */
3673 if (hkey == TP_HKEY_EV_UNDOCK_ACK) { 3705 known_ev = hotkey_notify_dockevent(hkey, &send_acpi_ev,
3674 hotkey_autosleep_ack = 1; 3706 &ignore_acpi_ev);
3675 pr_info("undocked\n");
3676 hotkey_wakeup_hotunplug_complete_notify_change();
3677 known_ev = true;
3678 } else {
3679 known_ev = false;
3680 }
3681 break; 3707 break;
3682 case 5: 3708 case 5:
3683 /* 0x5000-0x5FFF: human interface helpers */ 3709 /* 0x5000-0x5FFF: human interface helpers */