From patchwork Sat Dec 10 13:38:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 632975 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 AF2C3C4332F for ; Sat, 10 Dec 2022 13:48:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229813AbiLJNsx (ORCPT ); Sat, 10 Dec 2022 08:48:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60192 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229811AbiLJNsv (ORCPT ); Sat, 10 Dec 2022 08:48:51 -0500 Received: from mail-wr1-x42f.google.com (mail-wr1-x42f.google.com [IPv6:2a00:1450:4864:20::42f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6E3CB1B1E2 for ; Sat, 10 Dec 2022 05:48:50 -0800 (PST) Received: by mail-wr1-x42f.google.com with SMTP id q7so7827189wrr.8 for ; Sat, 10 Dec 2022 05:48:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=dSQKkxRzbEqk8NGysQnios/WZfjA0FuVvZI1N95s5Ak=; b=SdA04jqB0UoHdIJkeCpZLL5hrjqwJnYjNYgtb8KK61KaFXvfk5vDXphWTHwMToj80O FFLj+XlDxAX0GjxHzhUYM/lTAy2nKPahLb5bbfySjWNrEM2OL6UE6U1xp4RVxhS7rGuv PtYWyxYtT0JH/T5fM1MsRtltDgOfZaZJ/ySa1DkMdImn51J93NhtJnBqtoLyBHY9rEaw TGFYGnqOovVcOnsKtPz63KiUd33qtOceMCaaKGkq5ZwuGSE1uXMb+EkjLupRAOLZUsMA GVkvgdL4YR/mzomfbEFjNNrWJEm1rzSg3iZ5sp6/eDYnitspPnWJz6HUDSwQ25w2BiHl maXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=dSQKkxRzbEqk8NGysQnios/WZfjA0FuVvZI1N95s5Ak=; b=iXOSP8UVlyclmjuri2cV/lWCk2VsAV+wcnQsxeYVl54WQJaBkA1kSfRYGDM879OjxG /V3LmFvqapwG5w8C0FfeQfDNscWU7CnwzfM8iyEgCjpJfadMGFToCqZSwPkmAnUsMaHB Ph+kBFDSpTQ8BQhY+kRth61dOdJnTOeRfktO0SPqqUTsLc6jRxxXjB0s1KnFn77OgrgQ 4kyUat2CoSvTA3JsxWKQ+Qqpkdya5TFiwZ8UO9yBJ2YFrOf/4GI8qNUXSxJrNYT6RG01 gZa/6Ib0HeAVz6uk1rcj5VWyXefVNPMKPoHOV/R9/OTGBY9KfbBAEhhsWQ3qdTMU05BL qo0Q== X-Gm-Message-State: ANoB5pk1CTuB9l6G1h47IlLJ8QEKAZBPl/56XQBahhe+NPFPr3+9e4hL PENuRwKlpW33w+orD7dAFHbHhKZ7BzjdgLJX X-Google-Smtp-Source: AA0mqf5//g7RtnurYSmzlilQego85/+M/3CO6DQQUrfZUnsocmkGcLiPK2bC4qeGFlu1DQUpKbQVdg== X-Received: by 2002:a05:651c:17a7:b0:276:5727:c57a with SMTP id bn39-20020a05651c17a700b002765727c57amr3116582ljb.29.1670679534637; Sat, 10 Dec 2022 05:38:54 -0800 (PST) Received: from localhost.localdomain (abxh44.neoplus.adsl.tpnet.pl. [83.9.1.44]) by smtp.gmail.com with ESMTPSA id 11-20020a2eb94b000000b0026c5579c64csm605052ljs.89.2022.12.10.05.38.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 10 Dec 2022 05:38:54 -0800 (PST) From: Konrad Dybcio To: linux-arm-msm@vger.kernel.org, andersson@kernel.org, agross@kernel.org, krzysztof.kozlowski@linaro.org Cc: patches@linaro.org, Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] arm64: dts: qcom: sm8350-sagami: Rectify GPIO keys Date: Sat, 10 Dec 2022 14:38:50 +0100 Message-Id: <20221210133850.3664-1-konrad.dybcio@linaro.org> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org With enough pins set properly, the hardware buttons now also work like a charm. Fixes: c2721b0c23d9 ("arm64: dts: qcom: Add support for Xperia 1 III / 5 III") Signed-off-by: Konrad Dybcio Tested-by: Marijn Suijten # On Xperia 5 III --- .../qcom/sm8350-sony-xperia-sagami-pdx214.dts | 24 ++++++++++ .../dts/qcom/sm8350-sony-xperia-sagami.dtsi | 47 ++++++++++++++++++- 2 files changed, 70 insertions(+), 1 deletion(-) diff --git a/arch/arm64/boot/dts/qcom/sm8350-sony-xperia-sagami-pdx214.dts b/arch/arm64/boot/dts/qcom/sm8350-sony-xperia-sagami-pdx214.dts index e6824c8c2774..6fa830bdc6bd 100644 --- a/arch/arm64/boot/dts/qcom/sm8350-sony-xperia-sagami-pdx214.dts +++ b/arch/arm64/boot/dts/qcom/sm8350-sony-xperia-sagami-pdx214.dts @@ -10,6 +10,20 @@ / { model = "Sony Xperia 5 III"; compatible = "sony,pdx214-generic", "qcom,sm8350"; + + gpio-keys { + pinctrl-names = "default"; + pinctrl-0 = <&focus_n &snapshot_n &vol_down_n &g_assist_n>; + + key-google-assist { + label = "Google Assistant Key"; + gpios = <&pm8350_gpios 9 GPIO_ACTIVE_LOW>; + linux,code = ; + debounce-interval = <15>; + linux,can-disable; + gpio-key,wakeup; + }; + }; }; &framebuffer { @@ -18,6 +32,16 @@ &framebuffer { stride = <(1080 * 4)>; }; +&pm8350_gpios { + g_assist_n: g-assist-n-state { + pins = "gpio9"; + function = "normal"; + power-source = <1>; + bias-pull-up; + input-enable; + }; +}; + &pm8350b_gpios { gpio-line-names = "NC", /* GPIO_1 */ "NC", diff --git a/arch/arm64/boot/dts/qcom/sm8350-sony-xperia-sagami.dtsi b/arch/arm64/boot/dts/qcom/sm8350-sony-xperia-sagami.dtsi index d73e1f3fa501..557b4538a031 100644 --- a/arch/arm64/boot/dts/qcom/sm8350-sony-xperia-sagami.dtsi +++ b/arch/arm64/boot/dts/qcom/sm8350-sony-xperia-sagami.dtsi @@ -49,7 +49,26 @@ framebuffer: framebuffer@e1000000 { gpio-keys { compatible = "gpio-keys"; - /* For reasons still unknown, GAssist key and Camera Focus/Shutter don't work.. */ + pinctrl-names = "default"; + pinctrl-0 = <&focus_n &snapshot_n &vol_down_n>; + + key-camera-focus { + label = "Camera Focus"; + linux,code = ; + gpios = <&pm8350b_gpios 8 GPIO_ACTIVE_LOW>; + debounce-interval = <15>; + linux,can-disable; + gpio-key,wakeup; + }; + + key-camera-snapshot { + label = "Camera Snapshot"; + linux,code = ; + gpios = <&pm8350b_gpios 5 GPIO_ACTIVE_LOW>; + debounce-interval = <15>; + linux,can-disable; + gpio-key,wakeup; + }; key-vol-down { label = "Volume Down"; @@ -547,11 +566,37 @@ &pm8350_gpios { "PM8350_OPTION"; /* GPIO_10 */ }; +&pm8350b_gpios { + snapshot_n: snapshot-n-state { + pins = "gpio5"; + function = "normal"; + power-source = <0>; + bias-pull-up; + input-enable; + }; + + focus_n: focus-n-state { + pins = "gpio8"; + function = "normal"; + power-source = <0>; + input-enable; + bias-pull-up; + }; +}; + &pmk8350_gpios { gpio-line-names = "NC", /* GPIO_1 */ "NC", "VOL_DOWN_N", "PMK8350_OPTION"; + + vol_down_n: vol-down-n-state { + pins = "gpio3"; + function = "normal"; + power-source = <0>; + bias-pull-up; + input-enable; + }; }; &pmk8350_rtc {