From patchwork Fri Apr 18 01:56:00 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tim Gardner X-Patchwork-Id: 340223 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) by ozlabs.org (Postfix) with ESMTP id 135E91400F7; Fri, 18 Apr 2014 16:12:18 +1000 (EST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1Way2E-0000yA-9R; Fri, 18 Apr 2014 01:56:10 +0000 Received: from mail.tpi.com ([74.45.170.26]) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1Way28-0000xS-3d for kernel-team@lists.ubuntu.com; Fri, 18 Apr 2014 01:56:04 +0000 Received: from [192.168.1.103] (host-174-45-39-7.hln-mt.client.bresnan.net [174.45.39.7]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (Client did not present a certificate) by mail.tpi.com (Postfix) with ESMTP id 27428353D9F; Thu, 17 Apr 2014 18:56:04 -0700 (PDT) Message-ID: <53508630.7000509@canonical.com> Date: Thu, 17 Apr 2014 19:56:00 -0600 From: Tim Gardner User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 MIME-Version: 1.0 To: Shuduo Sang Subject: ACK: [TRUSTY] please backport two patches for Thinkpad X1 Carbon 2nd generation References: In-Reply-To: Cc: kernel-team@lists.ubuntu.com X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.14 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: kernel-team-bounces@lists.ubuntu.com I need a bug number. Both are clean cherry-picks with low risk of regression. rtg From 8dfa537d730d6c00fe903d467a5f14cdec92fbcd Mon Sep 17 00:00:00 2001 From: Shuduo Sang Date: Thu, 27 Mar 2014 18:06:25 +0800 Subject: [PATCH 2/2] save and restore adaptive keyboard mode for suspend and,resume Dan Aloni has submitted a patch to set adaptive mode to function mode when system resume back. Thanks Dan. :) Following patch can make it to be restored to previous mode like What Windows does. Thanks, Shuduo >From 0ca960138518ceab23110141a0d7c0cafd54a859 Mon Sep 17 00:00:00 2001 From: Shuduo Sang Date: Thu, 27 Mar 2014 17:51:24 +0800 Subject: [PATCH] save and restore adaptive keyboard mode for suspend and resume The mode of adaptive keyboard on X1 Carbon need be saved first before suspend then it can be restored after resume. Otherwise it will be unusable. Signed-off-by: Bruce Ma Signed-off-by: Shuduo Sang Signed-off-by: Matthew Garrett (cherry picked from commit 330947b84382479459e5296a0024c670367b0b57) --- drivers/platform/x86/thinkpad_acpi.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c index 51cab71..4fd6a34 100644 --- a/drivers/platform/x86/thinkpad_acpi.c +++ b/drivers/platform/x86/thinkpad_acpi.c @@ -3836,13 +3836,28 @@ static void hotkey_notify(struct ibm_struct *ibm, u32 event) static void hotkey_suspend(void) { + int hkeyv; + /* Do these on suspend, we get the events on early resume! */ hotkey_wakeup_reason = TP_ACPI_WAKEUP_NONE; hotkey_autosleep_ack = 0; + + /* save previous mode of adaptive keyboard of X1 Carbon */ + if (acpi_evalf(hkey_handle, &hkeyv, "MHKV", "qd")) { + if ((hkeyv >> 8) == 2) { + if (!acpi_evalf(hkey_handle, + &adaptive_keyboard_prev_mode, + "GTRW", "dd", 0)) { + pr_err("Cannot read adaptive keyboard mode.\n"); + } + } + } } static void hotkey_resume(void) { + int hkeyv; + tpacpi_disable_brightness_delay(); if (hotkey_status_set(true) < 0 || @@ -3855,6 +3870,18 @@ static void hotkey_resume(void) hotkey_wakeup_reason_notify_change(); hotkey_wakeup_hotunplug_complete_notify_change(); hotkey_poll_setup_safe(false); + + /* restore previous mode of adapive keyboard of X1 Carbon */ + if (acpi_evalf(hkey_handle, &hkeyv, "MHKV", "qd")) { + if ((hkeyv >> 8) == 2) { + if (!acpi_evalf(hkey_handle, + NULL, + "STRW", "vd", + adaptive_keyboard_prev_mode)) { + pr_err("Cannot set adaptive keyboard mode.\n"); + } + } + } } /* procfs -------------------------------------------------------------- */ -- 1.9.1