From patchwork Fri Dec 10 16:02:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 522900 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2A501C433F5 for ; Fri, 10 Dec 2021 16:02:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238165AbhLJQGC (ORCPT ); Fri, 10 Dec 2021 11:06:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49974 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238225AbhLJQGC (ORCPT ); Fri, 10 Dec 2021 11:06:02 -0500 Received: from mail-wr1-x430.google.com (mail-wr1-x430.google.com [IPv6:2a00:1450:4864:20::430]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EF419C061746; Fri, 10 Dec 2021 08:02:26 -0800 (PST) Received: by mail-wr1-x430.google.com with SMTP id v11so15655395wrw.10; Fri, 10 Dec 2021 08:02:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=BjXW6fm0PtmxnDuZ5f1C1GLdB8wT64MP92DyErb42Vo=; b=AHPTEPEkmkZBW/y95HtVx67utNlKCNQCCPEUZCPZIUcAJ82n5XUTzyGyBjzwmYr3QQ sUhZOtD6fDyEkTGeFAV8SPSDgT4ySzhiaEsEmoWUYkLhJFd4NCkYm5Re3HDrKDxYPetZ NMlDdZsdm6mCDZi+zsefMQRbNa9r1JVd9F2jxJc8K4hJmItHAKteefYfwpuIzEKPT90g +tMyi41dNSxpFKlm639o1JJmJ0F7UFy+jrFnk1+G1w73Arzyc2bfahRyg74C/vIGulSP teIkhAftKUUszZ3k0mROLjCh+qr+7QtRMkUg1u1OhlFB/2ArDEUHHoj1ISnkLABHIc3f 9opA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=BjXW6fm0PtmxnDuZ5f1C1GLdB8wT64MP92DyErb42Vo=; b=EuMeCRfxaiVquoomUvUB5efI5W6qPcLf5okuHoaBSiUMFvYO3JrO1YQzcinLDFtdsZ Q1v/bJMtJSUjXF6h38bcLcmteJ6Kj5Dr7laaU+/QalXnmY4fWJdvR6T9FbnP1NbooCSf 7U8bd6KFv9q/qX20zS7d8HokvwlB6DyjcADpMNmnzIsgSymOoDFWeKuudlxMxJdm5u+C cwoyx9mYG+YcWh+hzYD3HcY0kiVbaZp6PD8XuZbc9cWdHtqbtY6FOGvTe2kZnZqEtHQM xuB1caomVSlphBgLXs1LQP9SXbKClVUTmu9+AxtO8eSXiQFGOK/1bvumscpm0e92pVTt FQJA== X-Gm-Message-State: AOAM531BiM6jkxOmrTyi1b7NtyEc2xlsUGHhU0z2zJGnPEDbQoL/QVe9 MKtkwpY6UJYn/gtjU4iz/w8= X-Google-Smtp-Source: ABdhPJx7s5fHaG4DshNEy4UGX63HmLh4wX5XY4VXIO2k6ftnMSJq6QFDpn6k4ktnPk7ZDmb+3Ziayw== X-Received: by 2002:adf:e387:: with SMTP id e7mr14598425wrm.412.1639152144848; Fri, 10 Dec 2021 08:02:24 -0800 (PST) Received: from localhost ([193.209.96.43]) by smtp.gmail.com with ESMTPSA id k13sm2871809wri.6.2021.12.10.08.02.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Dec 2021 08:02:23 -0800 (PST) From: Thierry Reding To: Linus Walleij , Bartosz Golaszewski Cc: Rob Herring , Jon Hunter , Prathamesh Shete , linux-gpio@vger.kernel.org, linux-tegra@vger.kernel.org, devicetree@vger.kernel.org Subject: [PATCH v4 6/6] arm64: tegra: Enable gpio-keys on Jetson AGX Orin Developer Kit Date: Fri, 10 Dec 2021 17:02:06 +0100 Message-Id: <20211210160206.872998-6-thierry.reding@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20211210160206.872998-1-thierry.reding@gmail.com> References: <20211210160206.872998-1-thierry.reding@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org From: Thierry Reding Expose power, force-recovery and sleep buttons via a gpio-keys device so that userspace can receive events from them. Signed-off-by: Thierry Reding --- .../nvidia/tegra234-p3737-0000+p3701-0000.dts | 31 +++++++++++++++++++ arch/arm64/boot/dts/nvidia/tegra234.dtsi | 1 + 2 files changed, 32 insertions(+) diff --git a/arch/arm64/boot/dts/nvidia/tegra234-p3737-0000+p3701-0000.dts b/arch/arm64/boot/dts/nvidia/tegra234-p3737-0000+p3701-0000.dts index e3bb874869df..699eaa66824d 100644 --- a/arch/arm64/boot/dts/nvidia/tegra234-p3737-0000+p3701-0000.dts +++ b/arch/arm64/boot/dts/nvidia/tegra234-p3737-0000+p3701-0000.dts @@ -1,6 +1,9 @@ // SPDX-License-Identifier: GPL-2.0 /dts-v1/; +#include +#include + #include "tegra234-p3701-0000.dtsi" #include "tegra234-p3737-0000.dtsi" @@ -18,6 +21,34 @@ chosen { stdout-path = "serial0:115200n8"; }; + gpio-keys { + compatible = "gpio-keys"; + status = "okay"; + + force-recovery { + label = "Force Recovery"; + gpios = <&gpio TEGRA234_MAIN_GPIO(G, 0) GPIO_ACTIVE_LOW>; + linux,input-type = ; + linux,code = ; + }; + + power-key { + label = "Power"; + gpios = <&gpio_aon TEGRA234_AON_GPIO(EE, 4) GPIO_ACTIVE_LOW>; + linux,input-type = ; + linux,code = ; + wakeup-event-action = ; + wakeup-source; + }; + + suspend { + label = "Suspend"; + gpios = <&gpio TEGRA234_MAIN_GPIO(G, 2) GPIO_ACTIVE_LOW>; + linux,input-type = ; + linux,code = ; + }; + }; + tcu { status = "okay"; }; diff --git a/arch/arm64/boot/dts/nvidia/tegra234.dtsi b/arch/arm64/boot/dts/nvidia/tegra234.dtsi index f715671f0333..f8061b452046 100644 --- a/arch/arm64/boot/dts/nvidia/tegra234.dtsi +++ b/arch/arm64/boot/dts/nvidia/tegra234.dtsi @@ -1,6 +1,7 @@ // SPDX-License-Identifier: GPL-2.0 #include +#include #include #include #include