From patchwork Wed Apr 5 12:38:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Robinson X-Patchwork-Id: 13201709 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 30034C76188 for ; Wed, 5 Apr 2023 12:39:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=TKA6ZHZyhIPzZDN7hF+Y1L7KS5/XNujdGbojAXwKd+o=; b=t1Ic/mtx6ydmCh vKoQCIi7jvPBGDIP7HQPkEYkWliWniWyVArwQT07DsOsgKw49Cf4vRNBQXV0XDAphA2bZV2NAt8pW n5HgcHLU111Yjkz2UoCr9/+fXWdGJQoVXdk38qK+w8WbnqRZ0xxteHzUhOapymESLwsvD9wl2+YiQ HLQbRrfYuzXhxq7+pvI/yGl9n6+Z/eveYpKub+UCo1sLnKWtxXMM0K8127bjDDMJNYcstimpK7v81 S6eJbvHCboPfoA87m4sMUPJL/3+vYsZQ8z4YYtALLtK4Cmck3bf29trIR5IcAA6r9LzDpmV/u6b/+ ZIb9Xe1Cdb9hhiBkG9RA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pk2P9-004QQE-1Y; Wed, 05 Apr 2023 12:38:23 +0000 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pk2P6-004QOy-1R; Wed, 05 Apr 2023 12:38:21 +0000 Received: by mail-wr1-x42e.google.com with SMTP id h17so36029020wrt.8; Wed, 05 Apr 2023 05:38:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1680698296; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=l2D7J+jiJON7Q9iMerF9wUCEq2MkEeshCjVOJN+IjIU=; b=Zy+7Yp0Go7z6QYKD1XsRLWRBjKocGSpUcbP3ev3NnJVR45oaiEAYkxbDrUKL9kpHha O2gyCjuZybPMqbcwiicgWDgMes43WYcqM1hCXWQy/AL6iQq9JrnSyGu/aNuVfMDq4FZF UJpeWVc1jN63BxsHbT0OjCPFBhWiXEKFvxhX83dG670jyyFkk69dSOViLPQHFsIO/xTw zwNtmydV0Jw83HtOHqbkMD6WG3gMkgCsAn+v9r7NXwtlsA+n9Z9xfWQJCNrwV9UiT6BG maje+hcmHA7VPl3KYJPX4E7ApWdnKRMeTmVqmFbxNyqn1Pg6fISbO0G2jr9ESTVbZmjM YDWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680698296; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=l2D7J+jiJON7Q9iMerF9wUCEq2MkEeshCjVOJN+IjIU=; b=5FMLM13sNUbJhx7W6w5XZFVkWjnzR4i7trvjdrBLEPXB6l8W9SClaYsnwDXEYLwpws Z/SOIWBKkbx6Xa+SItGVvlzxr2achGOqpJeAyM7fzd+dmEV7MW42MRvHXhbdzTG6Zw5S 4kogisKNsWqWD35xRA//kDHjl7alWJAbFSJU94NP0WwXTDxmftU5qhghPoPyOz3R2h8e 4CLs/uPCnfu+A+Iq/Sh26ZMXpKcjIgoKrzxa2ZRiZTT76f6SA04MCjVoAIViMnetU5q3 av9WXLSEu3ciT2nTYE+KhgbXsgabHeZEOZF9UYiojrFR9OLE7X3K8jC//+QgIlHFtb5Y T0xw== X-Gm-Message-State: AAQBX9dcWv71JG+qU7zP6P27V1pRh88/o4oxNn6dBKnVse4DS35vrMFv M66j+mo+7EcF/5mAElkOeU0= X-Google-Smtp-Source: AKy350bDkNl6lpyilJ15fMuDfjsdTwlUYtX9rOugcaON4O5ZwIz5R0EfQbZO0xzZVivOHl9+e0Btfw== X-Received: by 2002:adf:cd82:0:b0:2d8:908c:8fa0 with SMTP id q2-20020adfcd82000000b002d8908c8fa0mr4397915wrj.9.1680698296038; Wed, 05 Apr 2023 05:38:16 -0700 (PDT) Received: from morpheus.home.roving-it.com (9.f.4.0.0.0.0.0.0.0.0.0.0.0.0.0.1.8.6.2.1.1.b.f.0.b.8.0.1.0.0.2.ip6.arpa. [2001:8b0:fb11:2681::4f9]) by smtp.googlemail.com with ESMTPSA id j8-20020adfe508000000b002cfe71153b4sm14829623wrm.60.2023.04.05.05.38.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Apr 2023 05:38:15 -0700 (PDT) From: Peter Robinson To: Rob Herring , Krzysztof Kozlowski , Heiko Stuebner , Ondrej Jirman , Tom Fitzhenry , Martijn Braam , Caleb Connolly , Jarrah Gosbell , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org Cc: =?utf-8?q?Kamil_Trzci=C5=84ski?= , Peter Robinson Subject: [PATCH] arm64: dts: rk3399-pinephone-pro: Add support for volume keys Date: Wed, 5 Apr 2023 13:38:13 +0100 Message-Id: <20230405123813.2272919-1-pbrobinson@gmail.com> X-Mailer: git-send-email 2.40.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230405_053820_502104_FB2971F5 X-CRM114-Status: GOOD ( 11.72 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Ondrej Jirman These are implemented via regular ADC, so regular polling is needed, for these keys to work. Signed-off-by: Martijn Braam Co-developed-by: Kamil TrzciƄski Signed-off-by: Ondrej Jirman Signed-off-by: Peter Robinson Tested-by: Ondrej Jirman --- .../dts/rockchip/rk3399-pinephone-pro.dts | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts b/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts index a0795a2b1cb1..ecd48040eb0c 100644 --- a/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts +++ b/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts @@ -10,6 +10,7 @@ */ /dts-v1/; +#include #include #include "rk3399.dtsi" #include "rk3399-opp.dtsi" @@ -29,6 +30,26 @@ chosen { stdout-path = "serial2:115200n8"; }; + adc-keys { + compatible = "adc-keys"; + io-channels = <&saradc 1>; + io-channel-names = "buttons"; + keyup-threshold-microvolt = <1600000>; + poll-interval = <100>; + + button-up { + label = "Volume Up"; + linux,code = ; + press-threshold-microvolt = <100000>; + }; + + button-down { + label = "Volume Down"; + linux,code = ; + press-threshold-microvolt = <300000>; + }; + }; + gpio-keys { compatible = "gpio-keys"; pinctrl-names = "default"; @@ -429,6 +450,11 @@ &sdio0 { status = "okay"; }; +&saradc { + vref-supply = <&vcca1v8_s3>; + status = "okay"; +}; + &sdmmc { bus-width = <4>; cap-sd-highspeed;