platform/x86: thinkpad_acpi: Whitelist P15 firmware for dual fan control
[linux-2.6-microblaze.git] / drivers / platform / x86 / thinkpad_acpi.c
index eae3579..c404706 100644 (file)
@@ -1913,6 +1913,10 @@ enum {   /* hot key scan codes (derived from ACPI DSDT) */
        TP_ACPI_HOTKEYSCAN_CALCULATOR,
        TP_ACPI_HOTKEYSCAN_BLUETOOTH,
        TP_ACPI_HOTKEYSCAN_KEYBOARD,
+       TP_ACPI_HOTKEYSCAN_FN_RIGHT_SHIFT, /* Used by "Lenovo Quick Clean" */
+       TP_ACPI_HOTKEYSCAN_NOTIFICATION_CENTER,
+       TP_ACPI_HOTKEYSCAN_PICKUP_PHONE,
+       TP_ACPI_HOTKEYSCAN_HANGUP_PHONE,
 
        /* Hotkey keymap size */
        TPACPI_HOTKEY_MAP_LEN
@@ -3214,7 +3218,14 @@ static int hotkey_init_tablet_mode(void)
 
                in_tablet_mode = hotkey_gmms_get_tablet_mode(res,
                                                             &has_tablet_mode);
-               if (has_tablet_mode)
+               /*
+                * The Yoga 11e series has 2 accelerometers described by a
+                * BOSC0200 ACPI node. This setup relies on a Windows service
+                * which calls special ACPI methods on this node to report
+                * the laptop/tent/tablet mode to the EC. The bmc150 iio driver
+                * does not support this, so skip the hotkey on these models.
+                */
+               if (has_tablet_mode && !acpi_dev_present("BOSC0200", "1", -1))
                        tp_features.hotkey_tablet = TP_HOTKEY_TABLET_USES_GMMS;
                type = "GMMS";
        } else if (acpi_evalf(hkey_handle, &res, "MHKG", "qd")) {
@@ -3429,11 +3440,15 @@ static int __init hotkey_init(struct ibm_init_struct *iibm)
                KEY_UNKNOWN, KEY_UNKNOWN, KEY_UNKNOWN, KEY_UNKNOWN,
                KEY_UNKNOWN,
 
-               KEY_BOOKMARKS,       /* Favorite app, 0x311 */
-               KEY_RESERVED,        /* Clipping tool */
-               KEY_CALC,            /* Calculator (above numpad, P52) */
-               KEY_BLUETOOTH,       /* Bluetooth */
-               KEY_KEYBOARD         /* Keyboard, 0x315 */
+               KEY_BOOKMARKS,                  /* Favorite app, 0x311 */
+               KEY_SELECTIVE_SCREENSHOT,       /* Clipping tool */
+               KEY_CALC,                       /* Calculator (above numpad, P52) */
+               KEY_BLUETOOTH,                  /* Bluetooth */
+               KEY_KEYBOARD,                   /* Keyboard, 0x315 */
+               KEY_FN_RIGHT_SHIFT,             /* Fn + right Shift */
+               KEY_NOTIFICATION_CENTER,        /* Notification Center */
+               KEY_PICKUP_PHONE,               /* Answer incoming call */
+               KEY_HANGUP_PHONE,               /* Decline incoming call */
                },
        };
 
@@ -4220,6 +4235,7 @@ static void hotkey_resume(void)
                pr_err("error while attempting to reset the event firmware interface\n");
 
        tpacpi_send_radiosw_update();
+       tpacpi_input_send_tabletsw();
        hotkey_tablet_mode_notify_change();
        hotkey_wakeup_reason_notify_change();
        hotkey_wakeup_hotunplug_complete_notify_change();
@@ -8768,6 +8784,8 @@ static const struct tpacpi_quirk fan_quirk_table[] __initconst = {
        TPACPI_Q_LNV3('N', '2', 'C', TPACPI_FAN_2CTL),  /* P52 / P72 */
        TPACPI_Q_LNV3('N', '2', 'E', TPACPI_FAN_2CTL),  /* P1 / X1 Extreme (1st gen) */
        TPACPI_Q_LNV3('N', '2', 'O', TPACPI_FAN_2CTL),  /* P1 / X1 Extreme (2nd gen) */
+       TPACPI_Q_LNV3('N', '2', 'V', TPACPI_FAN_2CTL),  /* P1 / X1 Extreme (3nd gen) */
+       TPACPI_Q_LNV3('N', '3', '0', TPACPI_FAN_2CTL),  /* P15 (1st gen) / P15v (1st gen) */
 };
 
 static int __init fan_init(struct ibm_init_struct *iibm)
@@ -9695,6 +9713,7 @@ static const struct tpacpi_quirk battery_quirk_table[] __initconst = {
        TPACPI_Q_LNV3('R', '0', 'B', true), /* Thinkpad 11e gen 3 */
        TPACPI_Q_LNV3('R', '0', 'C', true), /* Thinkpad 13 */
        TPACPI_Q_LNV3('R', '0', 'J', true), /* Thinkpad 13 gen 2 */
+       TPACPI_Q_LNV3('R', '0', 'K', true), /* Thinkpad 11e gen 4 celeron BIOS */
 };
 
 static int __init tpacpi_battery_init(struct ibm_init_struct *ibm)