From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BABACC4360F for ; Thu, 4 Apr 2019 09:05:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 85BAC214AF for ; Thu, 4 Apr 2019 09:05:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1554368748; bh=ihjSHTqdLvC9fBc7wFroTxIx2XqecVcGxgP1WDWeMak=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=ol/usHK2OliKX2nMIE1vRy4BVi76hjTAFnX3LQt9l+izL2CMhvUrnsj5IfiwAzK3Z L5EUcwUiVS2lo4uoIejgTmbNm/CYstcC2tR0rqN+xXgPySHLpC/3gEzhQXub1RlUs+ 6wmxnJl8zmSf8RHOTxPCmSOYsEKmTZT1kuYW5hLU= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732204AbfDDJFq (ORCPT ); Thu, 4 Apr 2019 05:05:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:43916 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732187AbfDDJFm (ORCPT ); Thu, 4 Apr 2019 05:05:42 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7DF4321855; Thu, 4 Apr 2019 09:05:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1554368742; bh=ihjSHTqdLvC9fBc7wFroTxIx2XqecVcGxgP1WDWeMak=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MiLGHjRU9vv844dxlH/DBDnHlnMwmoilFJ3VFHbL9Jx03mnEm4d8Rr8i5Uk/vJyqA y5i9t+xi+rG1atAf7PKYEGsHU0oy//fFvTKyBqlkv5z2UIEmum9LCUl7X9OVsfLsv1 55mbTL/zS9vmwpGXwvR+5IHxboIjDNLueIX3kKzU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tristian Celestin , =?UTF-8?q?J=C3=A9r=C3=B4me=20de=20Bretagne?= , Mario Limonciello , "Darren Hart (VMware)" , Sasha Levin Subject: [PATCH 4.19 153/187] platform/x86: intel-hid: Missing power button release on some Dell models Date: Thu, 4 Apr 2019 10:48:10 +0200 Message-Id: <20190404084610.328165511@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190404084603.119654039@linuxfoundation.org> References: <20190404084603.119654039@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.19-stable review patch. If anyone has any objections, please let me know. ------------------ [ 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 6cf9b7fa5bf0..3201a83073b5 100644 --- a/drivers/platform/x86/intel-hid.c +++ b/drivers/platform/x86/intel-hid.c @@ -373,7 +373,7 @@ wakeup: * 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) { @@ -382,8 +382,11 @@ wakeup: 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