Received: by 10.223.164.202 with SMTP id h10csp3176879wrb; Tue, 28 Nov 2017 07:19:21 -0800 (PST) X-Google-Smtp-Source: AGs4zMZgqXjgV+BhXl9iBtvdAd/XEdHLpp+nbuPWC51ZL2hIYpBAmkmqBF6GYwhVXK9Ilp/TPR25 X-Received: by 10.84.235.140 with SMTP id p12mr39705570plk.153.1511882361064; Tue, 28 Nov 2017 07:19:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511882361; cv=none; d=google.com; s=arc-20160816; b=eE+7hFCtyiHeTlGeTn7FMr0hkOB4zRvwqrEOCINipHcczOMS5QmIaFwkEN6YTrTHjW AvOtZqRwUyaUr3tJJiBeRUwBdAnS3fVaLrz1IfBnTcvOuu1fyhxrfLsB6t+DMdY6gCMs ir5tFrTgN4JkN/f5zjcYeDpCi3q4ZJtNyilsdHULX4/Y52yHvXXZ9ySBtQmU0wirNYqP 0ZjVAnF5BMt4nlM2Be7T1YghbIFsAkZZutwlWYsS4cVC8WkIs2fwh9jVVi82LdsFlQrT HpseegcJPMOw7BdBm7BArlKjmdOs5mOyeOMA7Iut423qlPwiU+02EWlrjuJ9j2qo567E gxQw== 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 :message-id:date:subject:cc:to:from:arc-authentication-results; bh=mbfm3xlBICZ8GPYsr8S81dLEIdD3fJjTb+xO/T0XFnY=; b=jL84HeLCi0xjR+hitszarUV6CEM//CO2GSTajCBnLPCOqbXmA5FOQymM8f8ZvLI9bu bTh/pK8okYt4JBEBNRU4okdvNGmWsVs3LolEIBOV8ExoCzDwrRd+pn41KyklQahnQgcy V+ai43eIAKcVwURG/bo9jRsI3bUwRas/0RKBUgzxQXC8NNDed7Hf3g2DiYay9DGiijFz PZk0VKj7xfCHGvg6aXV61dEjbaDLfwZwL5iLqKp//Oe+x6E0JN3lU38V3iko0N1XuY6c HttIIah186HDk0IX6mZf3EMT+GnOBnMcn1zJ1xyz8t9cpwq3c0CuFJYlcfNbCbq1LiA8 Es1A== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f4si6753284pgt.456.2017.11.28.07.19.09; Tue, 28 Nov 2017 07:19:21 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753606AbdK1PSD (ORCPT + 77 others); Tue, 28 Nov 2017 10:18:03 -0500 Received: from mail.netline.ch ([148.251.143.178]:41471 "EHLO netline-mail3.netline.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753269AbdK1PSB (ORCPT ); Tue, 28 Nov 2017 10:18:01 -0500 Received: from localhost (localhost [127.0.0.1]) by netline-mail3.netline.ch (Postfix) with ESMTP id D153B2AA2A3; Tue, 28 Nov 2017 16:17:59 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at netline-mail3.netline.ch Received: from netline-mail3.netline.ch ([127.0.0.1]) by localhost (netline-mail3.netline.ch [127.0.0.1]) (amavisd-new, port 10024) with LMTP id miSn_1-bM3or; Tue, 28 Nov 2017 16:17:59 +0100 (CET) Received: from kaveri (81.67.199.178.dynamic.wline.res.cust.swisscom.ch [178.199.67.81]) by netline-mail3.netline.ch (Postfix) with ESMTPSA id 795DB2AA234; Tue, 28 Nov 2017 16:17:59 +0100 (CET) Received: from daenzer by kaveri with local (Exim 4.89) (envelope-from ) id 1eJhe2-0002Pf-QO; Tue, 28 Nov 2017 16:17:58 +0100 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= To: Darren Hart , Andy Shevchenko Cc: platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] platform/x86: hp-wmi: Actually use mask parameter in hp_wmi_hw_state Date: Tue, 28 Nov 2017 16:17:58 +0100 Message-Id: <20171128151758.9234-1-michel@daenzer.net> X-Mailer: git-send-email 2.15.0 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 We were always checking bit 0 (which represents the docked state) regardless of the mask. Fixes the "tablet mode" state always being reported the same as the docked state, which with current libinput can cause the built-in input devices of laptops to be incorrectly disabled while docked. Cc: stable@vger.kernel.org Fixes: ("platform/x86: hp-wmi: Refactor dock and tablet state fetchers") Signed-off-by: Michel Dänzer --- drivers/platform/x86/hp-wmi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/platform/x86/hp-wmi.c b/drivers/platform/x86/hp-wmi.c index b4ed3dc983d5..2bdd6bbdb353 100644 --- a/drivers/platform/x86/hp-wmi.c +++ b/drivers/platform/x86/hp-wmi.c @@ -297,7 +297,7 @@ static int hp_wmi_hw_state(int mask) if (state < 0) return state; - return state & 0x1; + return (state & mask) ? 1 : 0; } static int __init hp_wmi_bios_2008_later(void) -- 2.15.0 From 1585435620129583554@xxx Wed Nov 29 21:00:31 +0000 2017 X-GM-THRID: 1585323809148779883 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread