Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp729173iog; Wed, 29 Jun 2022 09:03:09 -0700 (PDT) X-Google-Smtp-Source: AGRyM1s4gV4uRcJ/b5yevPP8LadlbzvWRAZ0hNRIdmptKrpkjk6FHZXGguyjy76AP/xo/EhAorz0 X-Received: by 2002:a17:90a:5207:b0:1ee:dfa1:afa9 with SMTP id v7-20020a17090a520700b001eedfa1afa9mr4581596pjh.246.1656518588827; Wed, 29 Jun 2022 09:03:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656518588; cv=none; d=google.com; s=arc-20160816; b=hllvxCkjoNNqczmp/FgHwuPlUtHO75/Tt2hZO9Hijnd/ZGbKv1bXlKArv0n7nl9NL6 Q1QRgOUgKkMK8v/EVO/m7lbong/AsEYIVhxiDIeksK2xdlYCBhXCn5B8jRgjQf3IVXB1 YlK2FDxSPY4hwWMgO23R3kzNLHkiwbEL9DH8BmcKi0jHelmT3+GmO9pZW0Ffvid/0zuv RvhwMXt+cg/BpS8/YCaLcmO48GugKH9+5YQIZolwmUpCHEJFjRNZxfHzGtnIejN+WoeQ WVvUo0/qIyU7wqY1M9bPHO+LDqq5gKpMei783ECRQm8tauPfb2YbwTr3eMmN+zgrqzan Lzqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=JjzxgL3uMN8qytkK5uPmX8atFZsyexYJKG3fnZQ1KjQ=; b=j2IB2vMCi8uQldTSLXlF1Df/cnKAaGRXj2bMOZjcKQXbZA6SGEoR8Tn3c7x9J1mx5i fM4gzI6fczVfKaahMWY15DYAsclu8q4Z+AoY8FwCKgReP1Kwzaw1cLMYoxfQ/dEJSX6U ItjygT243JoFi4zYO7fL2uPAyFnKX1odw+sKS9MujPbHF44pT+ij/3PC7g/R/FeftA4Z fzesHQ8FKiCtEM7OujwjIuq9b6+sR/y47Y/bF7c2lbjM89BuzlVMG7sCsjNvBJP1OIg9 dNJRg8tspxQdK9Bix+HWYxaiD7kZe/QXPJ2IqttjIv5tP181kyO8/0a5i2zf6nMtMXJ6 LuMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=od8V4Ohi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u124-20020a637982000000b0040d436645f7si20207847pgc.765.2022.06.29.09.02.44; Wed, 29 Jun 2022 09:03:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=od8V4Ohi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234390AbiF2QAn (ORCPT + 99 others); Wed, 29 Jun 2022 12:00:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40262 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234348AbiF2QAR (ORCPT ); Wed, 29 Jun 2022 12:00:17 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 615111C91E; Wed, 29 Jun 2022 09:00:16 -0700 (PDT) Received: from notapiano.myfiosgateway.com (pool-98-113-53-228.nycmny.fios.verizon.net [98.113.53.228]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: nfraprado) by madras.collabora.co.uk (Postfix) with ESMTPSA id 1AAB26601958; Wed, 29 Jun 2022 17:00:14 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1656518415; bh=X4djfeiOvr0+hhslFmVTaicQ0Eq5tiO+O4aU33n4GW0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=od8V4OhiWFiwGxi74XCUBS3xq8gsAS+eNlt+qWh2PiCol5kEL2xmXFMNEw2jMumjK eYjE3iHqwZYFVv0lHESsCrYS1rq/W7LkQS6NW8Uta62OqIjO7ujTpa5BjF0xswvpeo sVgnPGYUwKkLhFs/5OPyIXwOkcpGEx7yuAxVOIFttmVk2ZMjepnvUVYaW1eBzsZDJ2 oD9FCrYZfI6hu/5SqLItS6pdIaZI4lHE3IFmpLn8QdPWzFcEETj17yHqgQNQ9ikaR/ XOIs0Pf5PPZFV6XDGoDxdhUQE2kzk/olc31/d8DU8CExUpalt98LlxC3HN3wB5T5wm pSwbk2wTlBHlQ== From: =?UTF-8?q?N=C3=ADcolas=20F=2E=20R=2E=20A=2E=20Prado?= To: Matthias Brugger Cc: AngeloGioacchino Del Regno , kernel@collabora.com, Chen-Yu Tsai , =?UTF-8?q?N=C3=ADcolas=20F=2E=20R=2E=20A=2E=20Prado?= , Krzysztof Kozlowski , Rob Herring , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org Subject: [PATCH v4 08/19] arm64: dts: mediatek: asurada: Add keyboard mapping for the top row Date: Wed, 29 Jun 2022 11:59:45 -0400 Message-Id: <20220629155956.1138955-9-nfraprado@collabora.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220629155956.1138955-1-nfraprado@collabora.com> References: <20220629155956.1138955-1-nfraprado@collabora.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Chromebooks' embedded keyboards differ from standard layouts for the top row in that they have shortcuts in place of the standard function keys. Map these keys to achieve the functionality that is pictured on the printouts. There's a minor difference between the keys present on Hayato, which uses an older layout, and Spherion, which uses a newer one. Signed-off-by: NĂ­colas F. R. A. Prado Reviewed-by: AngeloGioacchino Del Regno Tested-by: Chen-Yu Tsai --- (no changes since v3) Changes in v3: - Moved keyboard layout definition to hayato and spherion dts files, instead of common one in asurada dtsi - Changed hayato layout to be the same as older Chromebooks like Kevin - Switched KEY_ZOOM for KEY_FULL_SCREEN, just for semantics - Updated commit message .../dts/mediatek/mt8192-asurada-hayato-r1.dts | 29 +++++++++++++++++++ .../mediatek/mt8192-asurada-spherion-r0.dts | 29 +++++++++++++++++++ 2 files changed, 58 insertions(+) diff --git a/arch/arm64/boot/dts/mediatek/mt8192-asurada-hayato-r1.dts b/arch/arm64/boot/dts/mediatek/mt8192-asurada-hayato-r1.dts index 00c76709a055..ca18fcf2ad4f 100644 --- a/arch/arm64/boot/dts/mediatek/mt8192-asurada-hayato-r1.dts +++ b/arch/arm64/boot/dts/mediatek/mt8192-asurada-hayato-r1.dts @@ -9,3 +9,32 @@ / { model = "Google Hayato rev1"; compatible = "google,hayato-rev1", "google,hayato", "mediatek,mt8192"; }; + +&keyboard_controller { + function-row-physmap = < + MATRIX_KEY(0x00, 0x02, 0) /* T1 */ + MATRIX_KEY(0x03, 0x02, 0) /* T2 */ + MATRIX_KEY(0x02, 0x02, 0) /* T3 */ + MATRIX_KEY(0x01, 0x02, 0) /* T4 */ + MATRIX_KEY(0x03, 0x04, 0) /* T5 */ + MATRIX_KEY(0x02, 0x04, 0) /* T6 */ + MATRIX_KEY(0x01, 0x04, 0) /* T7 */ + MATRIX_KEY(0x02, 0x09, 0) /* T8 */ + MATRIX_KEY(0x01, 0x09, 0) /* T9 */ + MATRIX_KEY(0x00, 0x04, 0) /* T10 */ + >; + linux,keymap = < + MATRIX_KEY(0x00, 0x02, KEY_BACK) + MATRIX_KEY(0x03, 0x02, KEY_FORWARD) + MATRIX_KEY(0x02, 0x02, KEY_REFRESH) + MATRIX_KEY(0x01, 0x02, KEY_FULL_SCREEN) + MATRIX_KEY(0x03, 0x04, KEY_SCALE) + MATRIX_KEY(0x02, 0x04, KEY_BRIGHTNESSDOWN) + MATRIX_KEY(0x01, 0x04, KEY_BRIGHTNESSUP) + MATRIX_KEY(0x02, 0x09, KEY_MUTE) + MATRIX_KEY(0x01, 0x09, KEY_VOLUMEDOWN) + MATRIX_KEY(0x00, 0x04, KEY_VOLUMEUP) + + CROS_STD_MAIN_KEYMAP + >; +}; diff --git a/arch/arm64/boot/dts/mediatek/mt8192-asurada-spherion-r0.dts b/arch/arm64/boot/dts/mediatek/mt8192-asurada-spherion-r0.dts index d384d584bbcf..30b03895de41 100644 --- a/arch/arm64/boot/dts/mediatek/mt8192-asurada-spherion-r0.dts +++ b/arch/arm64/boot/dts/mediatek/mt8192-asurada-spherion-r0.dts @@ -11,3 +11,32 @@ / { "google,spherion-rev1", "google,spherion-rev0", "google,spherion", "mediatek,mt8192"; }; + +&keyboard_controller { + function-row-physmap = < + MATRIX_KEY(0x00, 0x02, 0) /* T1 */ + MATRIX_KEY(0x03, 0x02, 0) /* T2 */ + MATRIX_KEY(0x02, 0x02, 0) /* T3 */ + MATRIX_KEY(0x01, 0x02, 0) /* T4 */ + MATRIX_KEY(0x03, 0x04, 0) /* T5 */ + MATRIX_KEY(0x02, 0x04, 0) /* T6 */ + MATRIX_KEY(0x01, 0x04, 0) /* T7 */ + MATRIX_KEY(0x02, 0x09, 0) /* T8 */ + MATRIX_KEY(0x01, 0x09, 0) /* T9 */ + MATRIX_KEY(0x00, 0x04, 0) /* T10 */ + >; + linux,keymap = < + MATRIX_KEY(0x00, 0x02, KEY_BACK) + MATRIX_KEY(0x03, 0x02, KEY_REFRESH) + MATRIX_KEY(0x02, 0x02, KEY_FULL_SCREEN) + MATRIX_KEY(0x01, 0x02, KEY_SCALE) + MATRIX_KEY(0x03, 0x04, KEY_SYSRQ) + MATRIX_KEY(0x02, 0x04, KEY_BRIGHTNESSDOWN) + MATRIX_KEY(0x01, 0x04, KEY_BRIGHTNESSUP) + MATRIX_KEY(0x02, 0x09, KEY_MUTE) + MATRIX_KEY(0x01, 0x09, KEY_VOLUMEDOWN) + MATRIX_KEY(0x00, 0x04, KEY_VOLUMEUP) + + CROS_STD_MAIN_KEYMAP + >; +}; -- 2.36.1