Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1001969yba; Thu, 4 Apr 2019 02:09:24 -0700 (PDT) X-Google-Smtp-Source: APXvYqwFqP0YsgvcVUPVL+VcIKhKZpgK/YDlvSfbhgjd9+Jx+7SuajQUxmcXWWCN/ykeNPKL14Q0 X-Received: by 2002:a65:6645:: with SMTP id z5mr4699186pgv.251.1554368964067; Thu, 04 Apr 2019 02:09:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554368964; cv=none; d=google.com; s=arc-20160816; b=iU4pOOao+fPTkjIORGKXTSWrCWE/nzHl4JSQMB2eZwfiQFhdaNgsaQc1063NQ7cOXd n/hAcPbQYWVmkVbTJyRu9S62dZeCGhfRw1BCZlcybbUw5IecHdLVzcaj25ldC5axtbz8 BViwYEZE6EY378V3dlbyyqNaytvNG3SuApoChFtLJy2yxxOCDwQYQY74iZfzIV/s3Q6J Znv7puN6JxITH/WvrHSolUE8Djie3ZiH4wOa+5YyKM/bBDlK1U0yRv/d34jizBvYU6Sc IhWEtna/SJguLEEhHSfz10Kv8uOQjmKuJSMpWRKZzVn0x0V4Or7QfYPRqEJfGaB6du1p vGhA== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=O3pdAXH5xMokyX+ceqp1Mpl5L9MVzDU6rdtS8wMeMTQ=; b=QeO1v3pcA9Um/ZRwlyoo2KXYk2hr4uoqeORhtW6ovuvRcGukNhgnF3LDe7oWcB3Kwo /INLO82j8XnUeEMMuvwHjQGy+Q4sVBChm3r7av7CzCUD+NKQN0ha8MJPDxI/Q7AgAk7G ZmEefYS92aasRC8exmMdDJAZeuJOigmAuWlfLia5lG3/hO/dHN6KRtOPKmtE+9ZwdFo5 eLTAu0K1beYlWtBFT8ULUE/MR6ZooGOMwCiOVx3d8TpSBolV/D5muOBqFiMAJnVp/cjV kr8Nn+HJxrBxxt08h2Kl4Zy6oyAgkOfTS9hffoxhNQfEIAHYjpVLUwzW2etaVmWB+N4H hSYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=E5Cj69OH; 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 f12si17520452pfh.257.2019.04.04.02.09.09; Thu, 04 Apr 2019 02:09:24 -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=E5Cj69OH; 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 S1732506AbfDDJH1 (ORCPT + 99 others); Thu, 4 Apr 2019 05:07:27 -0400 Received: from mail.kernel.org ([198.145.29.99]:46186 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731959AbfDDJHW (ORCPT ); Thu, 4 Apr 2019 05:07:22 -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 82F7E218FF; Thu, 4 Apr 2019 09:07:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1554368842; bh=N76NJacwlt3I5/RosT1SY5cweye0dMDIM21iYnpw7ZE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=E5Cj69OHlFeD4C9LnpKCfQNr9HEuONlCimK1pyu3ArsF+ZRS9CCW3IV8B4fCfVvsJ peA0SFB+u/fjXdfKUuTrgGh8zXY9ax9kLFEDoUFU/VpVO4wCP0TwWIsYE6LUO1DRzl wO2suqNgfedbJjNS2+q5r5Cw6uo56Iz+Yq0TCM4I= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hans de Goede , Dmitry Torokhov , Sasha Levin Subject: [PATCH 4.19 182/187] Input: soc_button_array - fix mapping of the 5th GPIO in a PNP0C40 device Date: Thu, 4 Apr 2019 10:48:39 +0200 Message-Id: <20190404084611.694946820@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 e9eb788f9442d1b5d93efdb30c3be071ce8a22b1 ] The Microsoft documenation for the PNP0C40 device aka the "Windows-compatible button array" describes the 5th GpioInt listed in the resources as: '5. Interrupt corresponding to the "Rotation Lock" button, if supported'. Notice this describes the 5th entry as a button while we sofar have been mapping it to EV_SW, SW_ROTATE_LOCK. On my Point of View TAB P1006W-232 which actually comes with a rotation-lock button, the button indeed is a button and not a slider/switch. An image search for other Windows tablets has found 2 more models with a rotation-lock button and on both of those it too is a push-button and not a slider/switch. Further evidence can be found in the HUT extension HUTRR52 from Microsoft which adds rotation lock support to the HUT, which describes 2 different usages: "0xC9 System Display Rotation Lock Button" and "0xCA System Display Rotation Lock Slider Switch" note that switch is seen as a separate thing here and the non switch wording is an exact match for the "Windows-compatible button array" spec wording. TL;DR: our current mapping of the 5th GPIO to SW_ROTATE_LOCK is wrong because the 5th GPIO is for a push-button not a switch. This commit fixes this by maping the 5th GPIO to KEY_ROTATE_LOCK_TOGGLE. Signed-off-by: Hans de Goede Signed-off-by: Dmitry Torokhov Signed-off-by: Sasha Levin --- drivers/input/misc/soc_button_array.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/input/misc/soc_button_array.c b/drivers/input/misc/soc_button_array.c index 23520df7650f..55cd6e0b409c 100644 --- a/drivers/input/misc/soc_button_array.c +++ b/drivers/input/misc/soc_button_array.c @@ -373,7 +373,7 @@ static struct soc_button_info soc_button_PNP0C40[] = { { "home", 1, EV_KEY, KEY_LEFTMETA, false, true }, { "volume_up", 2, EV_KEY, KEY_VOLUMEUP, true, false }, { "volume_down", 3, EV_KEY, KEY_VOLUMEDOWN, true, false }, - { "rotation_lock", 4, EV_SW, SW_ROTATE_LOCK, false, false }, + { "rotation_lock", 4, EV_KEY, KEY_ROTATE_LOCK_TOGGLE, false, false }, { } }; -- 2.19.1