Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp3355057iob; Mon, 16 May 2022 20:29:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzD86LCUuU+yFjIwTPyBzBBUkkUEgiciN13/6pVzB+GMpqRhlY74kUVY7ByhOWX8w8JxIsW X-Received: by 2002:a17:907:3f9b:b0:6f4:4407:a421 with SMTP id hr27-20020a1709073f9b00b006f44407a421mr17798987ejc.557.1652758145007; Mon, 16 May 2022 20:29:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652758145; cv=none; d=google.com; s=arc-20160816; b=eS4xIT3Zr5DIflRh7m6xN9EcXAtZjjEKy9KyMfXyNzh4fXC4Ze6UcNEQdW4ImiknAH VVwhGuqtNEgpiGKAQngYzZDIyZ6y5rqG699B2D94p8C1lr6Fnp+WGNVozxVYPeFzVU8Y k1b7gyESE/8ZHOMLnbq1NfUMpQ67WvISa6UmAZbhulwgGQySUWl7VnAiK9Ko6M6xyKIY cyxh9Sm/vBf0EYE+jCqkny5pGMFa2imuQDfafYvTAPBF3l1VxEb4Yx7Jb/YwdsW2E3tH 3aDb4vCfVVjyacVJUDXYrLbEnRXnBf754tzIiWnhVLJzIOaeEE/P+VDK7lNmNNM4qFSC 39OA== 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 :feedback-id:references:in-reply-to:message-id:subject:reply-to:cc :from:to:dkim-signature:date; bh=VpuPzUmy8azXATgjTkDZFB1+G13PBtCz2A4M2fXlOrg=; b=YV6fLIql5c6k2QLJUWx5ILUFfFF2CCj5qDtIMFzC4hAfSXwYSVOrV/fNYFR8SOmexg rlXJ11r2SWHgYG3mrpsBnoAGqLhrsyrWHX8CA1duwUo4d1u3y9cwzREqG/Vj2I92avYP /z2L+CfswmRM5eT31NO3pCgNrp2kAopl4Lr6tr79AdorZyNle+tL7kXbWbuTSdAhAa+Q MlpCeCSXrMBktlvx9pmKe55PjYgruAbm93pMYJUXsSKhaH3Zn2G7edeA8Q5NIvDC2Yqr T6gqYzvlkb01t63yEkxIKO3EfUEBgALQCiaJNzRZ9F7Bs1TGPd78zf1eSO89KYNmL0Vk BddQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@connolly.tech header.s=protonmail header.b="cmkmMr/y"; 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=connolly.tech Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dr2-20020a170907720200b006eff03031a0si1123510ejc.100.2022.05.16.20.28.39; Mon, 16 May 2022 20:29:04 -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=@connolly.tech header.s=protonmail header.b="cmkmMr/y"; 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=connolly.tech Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244516AbiEPOXX (ORCPT + 99 others); Mon, 16 May 2022 10:23:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59560 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244501AbiEPOXM (ORCPT ); Mon, 16 May 2022 10:23:12 -0400 Received: from mail-4323.proton.ch (mail-4323.proton.ch [185.70.43.23]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 70D593B013; Mon, 16 May 2022 07:23:09 -0700 (PDT) Date: Mon, 16 May 2022 14:23:02 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=connolly.tech; s=protonmail; t=1652710988; bh=VpuPzUmy8azXATgjTkDZFB1+G13PBtCz2A4M2fXlOrg=; h=Date:To:From:Cc:Reply-To:Subject:Message-ID:In-Reply-To: References:Feedback-ID:From:To:Cc:Date:Subject:Reply-To: Feedback-ID:Message-ID; b=cmkmMr/yrS78LEZeSC33FJb4p5RmsjUu8Z7PxX+HUKNTyVl85FDFswevBA/vERRBK 1MsyAF7jd2eDZRIT5uz+wyWj+pdYIpYpWbGvc8Mi8WaVjgeL/qSILMK8YzB0SPEirf cXC+l+vWT+XejYOelC/v1uiqTiTLvcn7szs6UZNM= To: Andy Gross , Bjorn Andersson , Rob Herring , Krzysztof Kozlowski , Dmitry Torokhov , linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, phone-devel@vger.kernel.org From: Caleb Connolly Cc: Caleb Connolly Reply-To: Caleb Connolly Subject: [PATCH 2/3] arm64: dts: qcom: sdm845-oneplus: add tri-state-key Message-ID: <20220516142158.1612109-2-caleb@connolly.tech> In-Reply-To: <20220516142158.1612109-1-caleb@connolly.tech> References: <20220516142158.1612109-1-caleb@connolly.tech> Feedback-ID: 10753939:user:proton MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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 The tri-state-key is a 3-state mute slider found on the OnePlus 6. The default software maps the states to "mute", "vibrate" and "ring", expose them as generic switch events so that they can be configured by userspace. Signed-off-by: Caleb Connolly --- .../boot/dts/qcom/sdm845-oneplus-common.dtsi | 44 +++++++++++++++++-- 1 file changed, 40 insertions(+), 4 deletions(-) diff --git a/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi b/arch/arm= 64/boot/dts/qcom/sdm845-oneplus-common.dtsi index 07b729f9fec5..f134c51e17ec 100644 --- a/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi +++ b/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi @@ -7,7 +7,7 @@ /dts-v1/; -#include +#include #include #include "sdm845.dtsi" @@ -26,7 +26,7 @@ chosen { =09=09stdout-path =3D "serial0:115200n8"; =09}; -=09gpio-keys { +=09volume-keys { =09=09compatible =3D "gpio-keys"; =09=09label =3D "Volume keys"; =09=09autorepeat; @@ -49,6 +49,41 @@ vol-up { =09=09}; =09}; +=09tri-state-key { +=09=09compatible =3D "gpio-keys"; +=09=09label =3D "Tri-state key"; + +=09=09pinctrl-names =3D "default"; +=09=09pinctrl-0 =3D <&tri_state_key_default>; + +=09=09state-top { +=09=09=09label =3D "Tri-state key top"; +=09=09=09linux,input-type =3D ; +=09=09=09linux,code =3D ; +=09=09=09gpios =3D <&tlmm 126 GPIO_ACTIVE_LOW>; +=09=09=09debounce-interval =3D <50>; +=09=09=09linux,can-disable; +=09=09}; + +=09=09state-middle { +=09=09=09label =3D "Tri-state key middle"; +=09=09=09linux,input-type =3D ; +=09=09=09linux,code =3D ; +=09=09=09gpios =3D <&tlmm 52 GPIO_ACTIVE_LOW>; +=09=09=09debounce-interval =3D <50>; +=09=09=09linux,can-disable; +=09=09}; + +=09=09state-bottom { +=09=09=09label =3D "Tri-state key bottom"; +=09=09=09linux,input-type =3D ; +=09=09=09linux,code =3D ; +=09=09=09gpios =3D <&tlmm 24 GPIO_ACTIVE_LOW>; +=09=09=09debounce-interval =3D <50>; +=09=09=09linux,can-disable; +=09=09}; +=09}; + =09reserved-memory { =09=09/* The rmtfs_mem needs to be guarded due to "XPU limitations" =09=09 * it is otherwise possible for an allocation adjacent to the @@ -607,9 +642,10 @@ &usb_1_hsphy { &tlmm { =09gpio-reserved-ranges =3D <0 4>, <81 4>; -=09tri_state_key_default: tri_state_key_default { +=09/* The GPIOs have a hardware pullup */ +=09tri_state_key_default: tri-state-pins { =09=09mux { -=09=09=09pins =3D "gpio40", "gpio42", "gpio26"; +=09=09=09pins =3D "gpio126", "gpio52", "gpio24"; =09=09=09function =3D "gpio"; =09=09=09drive-strength =3D <2>; =09=09=09bias-disable; -- 2.36.1