Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp5586177img; Wed, 27 Mar 2019 11:11:11 -0700 (PDT) X-Google-Smtp-Source: APXvYqyZqI0iUiFH8KTfBwSXvDJ1BbfaCwcOEk9yXK0luDevqIenHErKaDa9gB/72yyb9VKEX5L7 X-Received: by 2002:a63:5366:: with SMTP id t38mr28309543pgl.425.1553710271869; Wed, 27 Mar 2019 11:11:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553710271; cv=none; d=google.com; s=arc-20160816; b=uBRyh/b7AAvk3eS7Z9ZAo3RpzkKWRtw9ZN+lnpTX8qcIsRBpl5IwR87wx3bBU/NqyU aEclO9YbQtvWM2Sp5b+t/IEyQ4xiHl2Vb9ISMi4wOPdU7VRCeMf6wNeXwjPE5FQ/Xqk9 B85riw775/v0nnyP6pLo5l8QBPQ+k5a8Gv9rC7F+dQ2Y19JZy57igZ6eLhzzhskIrfCd XksmPYiyS5iicZar0uhJlxrVfeR1yXG1Jth62MNctdqmPDCYN98dTcb2eDGeR6+llGst PgD++8XLLJGw/kfikFgx1K6DvecUMA//5MAz4EICJzJgaA97m/VzvE/fK9hrba/Z+MBF cJng== 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=xlESPRqYCqjCWT+94nIxAYXZEF+EmdLEwvHPXerBYN0=; b=INvOZAg7Jo0sMhCwAXJm3tIBtuzc6tDTAr8z2LdWC/VCIe6d3kSiJ1wBhWGomGka4i fqe6zQsdf0BapRFowLGi+u9eTWlS2lXqgjehLaRh9QxjK7JZZcTP5ij9lTXWo4d8bU8E OsLiZmIH12Pd2UZRnKRVg0EdLBqe8uyMak/gWDzxgazDiU6TFF3H3FqmTNbz1/siJZpf H4nirKoZVmoU/1OcjXI7JjtaE1k8FE35gl1udb4b55XBU3TDxpBDga6r5w8lmzAxFqDu t+prhtZOYWPBNOsXaNs0UhkJUsS/CFgS1QUY2FLrJ/gFEiMPSOx89b8EwL6I7RXAVPt6 9N9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=107YeT7b; 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 r3si18634401pgp.154.2019.03.27.11.10.56; Wed, 27 Mar 2019 11:11:11 -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=107YeT7b; 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 S2388780AbfC0SKS (ORCPT + 99 others); Wed, 27 Mar 2019 14:10:18 -0400 Received: from mail.kernel.org ([198.145.29.99]:52168 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388741AbfC0SKM (ORCPT ); Wed, 27 Mar 2019 14:10:12 -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 CB66C21741; Wed, 27 Mar 2019 18:10:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1553710211; bh=ue8sRECZPNkgdQONQjHTxJ1XRFmgWVYkYyDvdhg2IJI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=107YeT7bI8wvQluR5MapiNinaiH2sgDpRgK8AcJNl3VS1lTCW2eM7rV+CxGrCW23r szNYmQvJJlgiM/u1lhTUiYRQDlx/XTPMK+eJ2kWT/BC4P+x1VBWYnCbr0tB9Xl4DiS BqEcgLvzwOBX2gVSib+sw369H7Uxib0w3pMD3GZ4= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Hans de Goede , Dmitry Torokhov , Sasha Levin , linux-input@vger.kernel.org Subject: [PATCH AUTOSEL 5.0 254/262] Input: soc_button_array - fix mapping of the 5th GPIO in a PNP0C40 device Date: Wed, 27 Mar 2019 14:01:49 -0400 Message-Id: <20190327180158.10245-254-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 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: Hans de Goede [ 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