Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp5643071img; Wed, 27 Mar 2019 12:17:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqytTgAeq0L4FAWi1c/jQSexIUH89CHm9nc/vPBDyXvUPCcc3960APQ98gZxeWND1Od0S5OL X-Received: by 2002:aa7:8a92:: with SMTP id a18mr37332045pfc.218.1553714267355; Wed, 27 Mar 2019 12:17:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553714267; cv=none; d=google.com; s=arc-20160816; b=zOb5OwR2igF17h+Ybn0RFOzgFtcIJFtKyvIcgVvR46JTxW0Mvd6SOggYeBLXYC7aeQ 851x1KBZ9ZHdVQji7z/dVTqnvXfg3Vx1MgIowXqTmc+l0JWHjrNSoEe0QbO4U8f/YVWZ +5BTX+Cp+2PThCXRDVnpfsz9zcCknN7auMQWdz1S5E2nnPNXE7CmJ/G1+gcKITeIqJb9 Q5Xv7ZCUsFkex+HurdRK0YjJ4HvnaCAb11VQMojY7v5gtjmqY58L+oqzfLGjukKMUJHK uwcfP/jsRE8ivI+FtzfXEhOiSsiMApK5u7zrACIGkdVDalVrzaA7XYSPsybrPXp/88Aa OlqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=odtwWutpo1TBSJ2bNXmzfTTIDI8VCZEsH8kiEHKKZ8M=; b=tb3lULlaA2Gg/q0FJJfN9CTtYwf56M/eYZmuCVfswO9fItSwtdptjojoJun9/a3AMC g3YpsHt3UCvjPyxCceUeiqcqh78Y22kNnP8R1Yraq17vdJ2Gr6GV7Vz7YtRzmymVDEo1 0mlx9CNBE1YkxzD3myq9ln1zrV3rBcsJB42QYPmw8og0pkyAh5C3VQC/nLLz0xNNzs2H EADJcz0VNDOX9qls+4q7ro3RNgtu9r9qX2K7xEkN7FsAcHj0hBXxFNOr0URrR8LNS4n1 BzIXn0SMdhm3SALDjKSEeW6ZuEqB2GJZzpFDKDk8eQN3KX0b9uSsdphSr5nvcElWvNBX MF5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=XYagz+Gr; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c22si19405484pls.17.2019.03.27.12.17.32; Wed, 27 Mar 2019 12:17:47 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=XYagz+Gr; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388459AbfC0SI5 (ORCPT + 99 others); Wed, 27 Mar 2019 14:08:57 -0400 Received: from mail.kernel.org ([198.145.29.99]:50686 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388436AbfC0SIy (ORCPT ); Wed, 27 Mar 2019 14:08:54 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8A4C32063F; Wed, 27 Mar 2019 18:08:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1553710133; bh=Z6IzR8lFTOsHcZF+2cPPUcdxhjRNeMfvf62yGLVB3o8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XYagz+GrDahWJ85k8Ds8kVJklasrA/WOzwi190fVMkHplt8p37f9WLjvkrdT9Y1Bo 0I9N8kqwqfwfKuc1NFk+VcNlee9eJH1yIvPgRW1tlB6SQZvd4IPwYRFr24ew7leWwo jIVogb8NY7oBpPkLjv5xcE7bM68rIMFk3Mej7pv8= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: =?UTF-8?q?J=C3=A9r=C3=B4me=20de=20Bretagne?= , Darren Hart , Sasha Levin , platform-driver-x86@vger.kernel.org Subject: [PATCH AUTOSEL 5.0 211/262] platform/x86: intel-hid: Missing power button release on some Dell models Date: Wed, 27 Mar 2019 14:01:06 -0400 Message-Id: <20190327180158.10245-211-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190327180158.10245-1-sashal@kernel.org> References: <20190327180158.10245-1-sashal@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jérôme de Bretagne [ Upstream commit e97a34563d18606ee5db93e495382a967f999cd4 ] Power button suspend for some Dell models was added in: commit 821b85366284 ("platform/x86: intel-hid: Power button suspend on Dell Latitude 7275") by checking against the power button press notification (0xCE) to report the power button press event. The corresponding power button release notification (0xCF) was caught and ignored to stop it from being reported as an "unknown event" in the logs. The missing button release event is creating issues on Android-x86, as reported on the project mailing list for a Dell Latitude 5175 model, since the events are expected in down/up pairs. Report the power button release event to fix this issue. Link: https://groups.google.com/forum/#!topic/android-x86/aSwZK9Nf9Ro Tested-by: Tristian Celestin Tested-by: Jérôme de Bretagne Signed-off-by: Jérôme de Bretagne Reviewed-by: Mario Limonciello [dvhart: corrected commit reference format per checkpatch] Signed-off-by: Darren Hart (VMware) Signed-off-by: Sasha Levin --- drivers/platform/x86/intel-hid.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/platform/x86/intel-hid.c b/drivers/platform/x86/intel-hid.c index e28bcf61b126..bc0d55a59015 100644 --- a/drivers/platform/x86/intel-hid.c +++ b/drivers/platform/x86/intel-hid.c @@ -363,7 +363,7 @@ static void notify_handler(acpi_handle handle, u32 event, void *context) * the 5-button array, but still send notifies with power button * event code to this device object on power button actions. * - * Report the power button press; catch and ignore the button release. + * Report the power button press and release. */ if (!priv->array) { if (event == 0xce) { @@ -372,8 +372,11 @@ static void notify_handler(acpi_handle handle, u32 event, void *context) return; } - if (event == 0xcf) + if (event == 0xcf) { + input_report_key(priv->input_dev, KEY_POWER, 0); + input_sync(priv->input_dev); return; + } } /* 0xC0 is for HID events, other values are for 5 button array */ -- 2.19.1