From patchwork Mon Jan 9 23:41:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marijn Suijten X-Patchwork-Id: 41229 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp2442255wrt; Mon, 9 Jan 2023 15:42:17 -0800 (PST) X-Google-Smtp-Source: AMrXdXum2iWLe+wkSNw6ihZCWN7ZOk3s+jk6c3AO+T5j4PXVku02vH72dQLuwtrZf+hW1L0yj2Lt X-Received: by 2002:a17:90a:4b0a:b0:226:eb4a:87e0 with SMTP id g10-20020a17090a4b0a00b00226eb4a87e0mr11325271pjh.26.1673307737334; Mon, 09 Jan 2023 15:42:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673307737; cv=none; d=google.com; s=arc-20160816; b=YOoLyjLNNDFGtdWsWaV21/uHMnphHzyJuu5jG4Ao3Ku3mTrnNLlNZFRp/wpnkLdBYy 8eUrsckUl7thMd0waVvpVVHegv+ilZ6N+mn+n0J+I/YuuRHAzE3bLCNSw4AKIB01fjT6 1op8M6mjgkrVTQY4uZoXQaggqi2OvaCrr19fDWMp1+pF1EfcKYFLgE5gEriLA/F0lFH4 7tswTYQselB/PMwQSRUbY+dKgfMfNhNdBD0ErSQ06lLOvtX0XgyV2kGpBD/aaeUHyWeV Bjl9qRhVY5G6SkF91cZcEzOBwTeYtkZ91S7OAzm9/JdGUg1QkiAWhAzpJP0Dt4/gbXhl xE4g== 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 :message-id:date:subject:cc:to:from; bh=/RgpAIb4vcIwFrDg1NUt1HwRLnR7wVJjxr0+e9L/IXc=; b=NKyS4V01cj8aNau6BETTQXehcNgKFuYFFuo8O1e1LjtaOCgmDsA6T4aakFICs+8Ml7 PSAS0Rw5+p/s5dl2R8YSx62rCl/fKusFHPd9S0XOIQmWB9zo1JwUFZ7dzOtiI56PjzNi d6dZ+5HHYXq8Zgw/2YYR/WJHNhQ0JB+rR93LKrlVc0bNVDIOPSv+m0QjyDdWwXj2zWpD cBi3FrX/Q/EEx/rYYjdxqI+0AJ1c6mhAvRvMH4YBDd0q0os8BvTTlcvt1UFe8SZwb+j1 EnKqUL4JBiO8/Pg/6tT2XSfN/Mo06nDmpeWQfGt60FrKeK76t9jdSaU1ZB/PIMMe4EdP IE3Q== ARC-Authentication-Results: i=1; mx.google.com; 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id my8-20020a17090b4c8800b00225a2269fc8si11383293pjb.185.2023.01.09.15.42.05; Mon, 09 Jan 2023 15:42:17 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237692AbjAIXlt (ORCPT + 99 others); Mon, 9 Jan 2023 18:41:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34134 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236528AbjAIXlp (ORCPT ); Mon, 9 Jan 2023 18:41:45 -0500 Received: from relay08.th.seeweb.it (relay08.th.seeweb.it [5.144.164.169]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 68DC8120AA; Mon, 9 Jan 2023 15:41:44 -0800 (PST) Received: from localhost.localdomain (94-211-6-86.cable.dynamic.v4.ziggo.nl [94.211.6.86]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by m-r2.th.seeweb.it (Postfix) with ESMTPSA id 5C5C33EF3C; Tue, 10 Jan 2023 00:41:42 +0100 (CET) From: Marijn Suijten To: phone-devel@vger.kernel.org Cc: ~postmarketos/upstreaming@lists.sr.ht, AngeloGioacchino Del Regno , Konrad Dybcio , Martin Botka , Jami Kettunen , Marijn Suijten , Andy Gross , Bjorn Andersson , Rob Herring , Krzysztof Kozlowski , linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2] arm64: dts: qcom: sdm845-tama: Add volume up and camera GPIO keys Date: Tue, 10 Jan 2023 00:41:32 +0100 Message-Id: <20230109234133.365644-1-marijn.suijten@somainline.org> X-Mailer: git-send-email 2.39.0 MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754590334037327877?= X-GMAIL-MSGID: =?utf-8?q?1754590334037327877?= Tama has four GPIO-wired keys: two for camera focus and shutter / snapshot, and two more for volume up and down. As per the comment these used to not work because the necessary pin bias was missing, which is now set via pinctrl on pm8998_gpios. The missing bias has also been added to the existing volume down button, which receives a node name and label cleanup at the same time to be more consistent with other DTS and the newly added buttons. Its deprecated gpio-key,wakeup property has also been replaced with wakeup-source. Note that volume up is also available through the usual PON RESIN node, but unlike other platforms only triggers when the power button is held down at the same time making it unsuitable to serve as KEY_VOLUMEUP. Fixes: 30a7f99befc6 ("arm64: dts: qcom: Add support for SONY Xperia XZ2 / XZ2C / XZ3 (Tama platform)") Reviewed-by: Konrad Dybcio Signed-off-by: Marijn Suijten --- Changes since v1: - Rebased on next-20230109 and replace pm8998_gpio with plural pm8998_gpios phandle label. v1: https://lore.kernel.org/linux-arm-msm/20221222190656.31664-1-marijn.suijten@somainline.org/ .../dts/qcom/sdm845-sony-xperia-tama.dtsi | 72 +++++++++++++++++-- 1 file changed, 68 insertions(+), 4 deletions(-) diff --git a/arch/arm64/boot/dts/qcom/sdm845-sony-xperia-tama.dtsi b/arch/arm64/boot/dts/qcom/sdm845-sony-xperia-tama.dtsi index df92e8d7bf30..c611eab56724 100644 --- a/arch/arm64/boot/dts/qcom/sdm845-sony-xperia-tama.dtsi +++ b/arch/arm64/boot/dts/qcom/sdm845-sony-xperia-tama.dtsi @@ -4,6 +4,7 @@ */ #include +#include #include #include "sdm845.dtsi" #include "pm8005.dtsi" @@ -17,14 +18,43 @@ / { gpio-keys { compatible = "gpio-keys"; - /* Neither Camera Focus, nor Camera Shutter seem to work... */ + pinctrl-0 = <&focus_n &snapshot_n &vol_down_n &vol_up_n>; + pinctrl-names = "default"; - key-vol-down { - label = "volume_down"; + key-camera-focus { + label = "Camera Focus"; + gpios = <&pm8998_gpios 2 GPIO_ACTIVE_LOW>; + linux,code = ; + debounce-interval = <15>; + linux,can-disable; + wakeup-source; + }; + + key-camera-snapshot { + label = "Camera Snapshot"; + gpios = <&pm8998_gpios 7 GPIO_ACTIVE_LOW>; + linux,code = ; + debounce-interval = <15>; + linux,can-disable; + wakeup-source; + }; + + key-volume-down { + label = "Volume Down"; gpios = <&pm8998_gpios 5 GPIO_ACTIVE_LOW>; linux,code = ; debounce-interval = <15>; - gpio-key,wakeup; + linux,can-disable; + wakeup-source; + }; + + key-volume-up { + label = "Volume Up"; + gpios = <&pm8998_gpios 6 GPIO_ACTIVE_LOW>; + linux,code = ; + debounce-interval = <15>; + linux,can-disable; + wakeup-source; }; }; @@ -358,6 +388,40 @@ &i2c14 { /* AMS TCS3490 RGB+IR color sensor @ 72 */ }; +&pm8998_gpios { + focus_n: focus-n-state { + pins = "gpio2"; + function = PMIC_GPIO_FUNC_NORMAL; + power-source = <0>; + bias-pull-up; + input-enable; + }; + + vol_down_n: vol-down-n-state { + pins = "gpio5"; + function = PMIC_GPIO_FUNC_NORMAL; + power-source = <0>; + bias-pull-up; + input-enable; + }; + + vol_up_n: vol-up-n-state { + pins = "gpio6"; + function = PMIC_GPIO_FUNC_NORMAL; + power-source = <0>; + bias-pull-up; + input-enable; + }; + + snapshot_n: snapshot-n-state { + pins = "gpio7"; + function = PMIC_GPIO_FUNC_NORMAL; + power-source = <0>; + bias-pull-up; + input-enable; + }; +}; + &qupv3_id_0 { status = "okay"; };