From patchwork Wed Jun 14 12:11:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 692670 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 1B5C1EB64DC for ; Wed, 14 Jun 2023 12:12:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244534AbjFNMM1 (ORCPT ); Wed, 14 Jun 2023 08:12:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48306 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244456AbjFNMMK (ORCPT ); Wed, 14 Jun 2023 08:12:10 -0400 Received: from mail-lf1-x134.google.com (mail-lf1-x134.google.com [IPv6:2a00:1450:4864:20::134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 573CB1BC5 for ; Wed, 14 Jun 2023 05:11:58 -0700 (PDT) Received: by mail-lf1-x134.google.com with SMTP id 2adb3069b0e04-4f62b552751so8441227e87.3 for ; Wed, 14 Jun 2023 05:11:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686744716; x=1689336716; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=2GKvZ616V2FdbMtm5spz/6erBtMA2Hst579nyomUNLg=; b=Bw0+UTUC/qX0S8ZcEFmLN1g7S6E6bNXgFugnyQV4/YFAYrbS9L3rKBGw1WQal1pmaO kUhInhxIBHw9+LTsqP6eY0kCjbfYcn2HCWCj1JEDAXJEnp7apbNoacGOyFejZi1DPSWP ap/Tu4Stti5RWjktyaIf3yMWA5JtTtP9Skh7+MY+Ol8wqsiXkr/L2Xv8bMYwFTmdO/Pc bRdWfT/dF8l4kyrLrPyJmfiX6THKLmjVQ6OEjtDwW3+qrMChRxEpfYPEDmj11eRoR1KD PgADeottRZbOCca8ZRTJCN84URHocbaBCTmgy+p3pz1+d0/Ndg+uEYOBHS13SFShKbjH BLmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686744716; x=1689336716; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2GKvZ616V2FdbMtm5spz/6erBtMA2Hst579nyomUNLg=; b=e474NcAyYpoKyFtcnyWbWH4Z7jI9WFtmWQkPzLbcKYj+TupvUKKzyrr7u+X2ws3pO9 YvSARhrIJALQig4k4CKCknUPFDdb0FO7v9IHydUVkF+3ID//JzQ/8F84Zkn7QH4pXnHJ WyMMhOn21P88LutyA4zd4rpmjZ4DpgaSu+/T5yBwNgy9eMecJnIv26FaC8avefYWcqFc wpM6SkLC/aFRznGR1Cxl3VOUKzKzP0xumYJkVO7yecrQP+TtXGhc/GLueWHmkD3PY34Q LwzvWsNEPkwyCTV3JDmhbdiR4u2ttGxfZTNuYA6Uj+V9vRMXiCbud8FTN4W9Mk5bhdF5 OIKw== X-Gm-Message-State: AC+VfDzewBmGB8vfSJwoq3YEdLKU/W2BhzuA5NJINDCwJMmSHawx+4Bv sYIN7+pMj2ONomMWwK5PdaHoSQ== X-Google-Smtp-Source: ACHHUZ7MJAc2ayOShMAuvLLIYCrfWEKo2WZ7Ygh5WVoM63afj4ClelMlxOfoG4CxxKK9J29mBeJbEA== X-Received: by 2002:a19:6756:0:b0:4f1:26f5:77fb with SMTP id e22-20020a196756000000b004f126f577fbmr8018150lfj.28.1686744716565; Wed, 14 Jun 2023 05:11:56 -0700 (PDT) Received: from [192.168.1.101] (abyj190.neoplus.adsl.tpnet.pl. [83.9.29.190]) by smtp.gmail.com with ESMTPSA id d2-20020ac25ec2000000b004f24e797c55sm2109793lfq.25.2023.06.14.05.11.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Jun 2023 05:11:56 -0700 (PDT) From: Konrad Dybcio Date: Wed, 14 Jun 2023 14:11:47 +0200 Subject: [PATCH 2/4] arm64: dts: qcom: sm8250-edo: Add GPIO line names for PMIC GPIOs MIME-Version: 1.0 Message-Id: <20230614-topic-edo_pinsgpiopmic-v1-2-cf88a0bac26c@linaro.org> References: <20230614-topic-edo_pinsgpiopmic-v1-0-cf88a0bac26c@linaro.org> In-Reply-To: <20230614-topic-edo_pinsgpiopmic-v1-0-cf88a0bac26c@linaro.org> To: Andy Gross , Bjorn Andersson , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Marijn Suijten , linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Konrad Dybcio , Konrad Dybcio X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1686744712; l=3755; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=NNKUHsnSrdS4vf/kgCib1So5nPpERojtp2HUS+mt0M8=; b=+FciPhTwrnNb2M60+ATv4cP3yTRrZN8r0tkISE83J3oT3M5ofKFlHv1GieBCdeS3Jh2Xf9wEM qf1tEVfJWT/ANZbMkFNtfN9kpiTRaTT2RFopdnfrZLmZ696GzhB8YfO X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Sony ever so graciously provides GPIO line names in their downstream kernel (though sometimes they are not 100% accurate and you can judge that by simply looking at them and with what drivers they are used). Add these to the PDX203&206 DTSIs to better document the hardware. Diff between 203 and 206: pm8009_gpios < "CAM_PWR_LD_EN", > "NC", pm8150_gpios < "NC", > "G_ASSIST_N", < "WLC_EN_N", /* GPIO_10 */ > "NC", /* GPIO_10 */ Which is due to 5 II having an additional Google Assistant hardware button and 1 II having a wireless charger & different camera wiring to accommodate the additional 3D iToF sensor. Signed-off-by: Konrad Dybcio --- .../dts/qcom/sm8250-sony-xperia-edo-pdx203.dts | 50 ++++++++++++++++++++++ .../dts/qcom/sm8250-sony-xperia-edo-pdx206.dts | 50 ++++++++++++++++++++++ 2 files changed, 100 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/sm8250-sony-xperia-edo-pdx203.dts b/arch/arm64/boot/dts/qcom/sm8250-sony-xperia-edo-pdx203.dts index 84104d2b2010..62590c6bd306 100644 --- a/arch/arm64/boot/dts/qcom/sm8250-sony-xperia-edo-pdx203.dts +++ b/arch/arm64/boot/dts/qcom/sm8250-sony-xperia-edo-pdx203.dts @@ -15,6 +15,56 @@ / { /delete-node/ &vreg_l7f_1p8; +&pm8009_gpios { + gpio-line-names = "NC", /* GPIO_1 */ + "CAM_PWR_LD_EN", + "WIDEC_PWR_EN", + "NC"; +}; + +&pm8150_gpios { + gpio-line-names = "VOL_DOWN_N", /* GPIO_1 */ + "OPTION_2", + "NC", + "PM_SLP_CLK_IN", + "OPTION_1", + "NC", + "NC", + "SP_ARI_PWR_ALARM", + "NC", + "NC"; /* GPIO_10 */ +}; + +&pm8150b_gpios { + gpio-line-names = "SNAPSHOT_N", /* GPIO_1 */ + "FOCUS_N", + "NC", + "NC", + "RF_LCD_ID_EN", + "NC", + "NC", + "LCD_ID", + "NC", + "WLC_EN_N", /* GPIO_10 */ + "NC", + "RF_ID"; +}; + +&pm8150l_gpios { + gpio-line-names = "NC", /* GPIO_1 */ + "PM3003A_EN", + "NC", + "NC", + "NC", + "AUX2_THERM", + "BB_HP_EN", + "FP_LDO_EN", + "PMX_RESET_N", + "AUX3_THERM", /* GPIO_10 */ + "DTV_PWR_EN", + "PM3003A_MODE"; +}; + &tlmm { gpio-line-names = "AP_CTI_IN", /* GPIO_0 */ "MDM2AP_ERR_FATAL", diff --git a/arch/arm64/boot/dts/qcom/sm8250-sony-xperia-edo-pdx206.dts b/arch/arm64/boot/dts/qcom/sm8250-sony-xperia-edo-pdx206.dts index fae6568cb79e..ea4571bf4fbf 100644 --- a/arch/arm64/boot/dts/qcom/sm8250-sony-xperia-edo-pdx206.dts +++ b/arch/arm64/boot/dts/qcom/sm8250-sony-xperia-edo-pdx206.dts @@ -30,6 +30,56 @@ g-assist-key { }; }; +&pm8009_gpios { + gpio-line-names = "NC", /* GPIO_1 */ + "NC", + "WIDEC_PWR_EN", + "NC"; +}; + +&pm8150_gpios { + gpio-line-names = "VOL_DOWN_N", /* GPIO_1 */ + "OPTION_2", + "NC", + "PM_SLP_CLK_IN", + "OPTION_1", + "G_ASSIST_N", + "NC", + "SP_ARI_PWR_ALARM", + "NC", + "NC"; /* GPIO_10 */ +}; + +&pm8150b_gpios { + gpio-line-names = "SNAPSHOT_N", /* GPIO_1 */ + "FOCUS_N", + "NC", + "NC", + "RF_LCD_ID_EN", + "NC", + "NC", + "LCD_ID", + "NC", + "NC", /* GPIO_10 */ + "NC", + "RF_ID"; +}; + +&pm8150l_gpios { + gpio-line-names = "NC", /* GPIO_1 */ + "PM3003A_EN", + "NC", + "NC", + "NC", + "AUX2_THERM", + "BB_HP_EN", + "FP_LDO_EN", + "PMX_RESET_N", + "NC", /* GPIO_10 */ + "NC", + "PM3003A_MODE"; +}; + &tlmm { gpio-line-names = "AP_CTI_IN", /* GPIO_0 */ "MDM2AP_ERR_FATAL", From patchwork Wed Jun 14 12:11:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 692669 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 E350EEB64DB for ; Wed, 14 Jun 2023 12:12:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244506AbjFNMMl (ORCPT ); Wed, 14 Jun 2023 08:12:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48786 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244507AbjFNMMO (ORCPT ); Wed, 14 Jun 2023 08:12:14 -0400 Received: from mail-lf1-x12e.google.com (mail-lf1-x12e.google.com [IPv6:2a00:1450:4864:20::12e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 848272111 for ; Wed, 14 Jun 2023 05:12:01 -0700 (PDT) Received: by mail-lf1-x12e.google.com with SMTP id 2adb3069b0e04-4f6370ddd27so8466735e87.0 for ; Wed, 14 Jun 2023 05:12:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686744719; x=1689336719; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=Su1O/8G+NEY/y9W3jeuKWn3I4SvZSn/9II7YQB1Uo7A=; b=siUuglJ610MvCGUp2hN7/R+TnDrl5vFoKtttyUv0MV4pIkS5i1D6ZuClQiEV3+wPje RSPamO3rZpFtWIh/R0RWaGocuM4uSHsmYOyXZbMsn7MZUi8NXuf/Ac5VxUzGfeflsnT+ irBM1PNQVn/9Lfk7Z13YtKe7YOW1Quo70d7VhrsH33VX9jUUe2so4gCJWXfjhFGIziv8 D0WYzfvIPR34BIePI1H04eWV5JEym83PDdyKszkk4jE+LIa31gTsnA5XVGUFjr2ONA3p 6iLnwh1uXV3n+1Cj/WHDiDL8+HbHpp7dLxtcd9AROPSv+hz6QfNbqxIk3ljQ0+Bul2ey u4vQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686744719; x=1689336719; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Su1O/8G+NEY/y9W3jeuKWn3I4SvZSn/9II7YQB1Uo7A=; b=I4BJZOT5rX9aExkrEqo5gxDj16D0mXX39qVNJ+CRaAAz1qY8T2FOXnCyvkpxdVhdV/ TrTCWGpIa7+Eu3p6xApZUfCWo8YcJ+gHnhcGcttWLqrN0il5tM87Vcke7HS7eTy3/S9L ZbuH9z4xRcPRVmK9sf3zctTV27syccethOSD3c+GRt3lRZbDybtLOgLMyZXbJZ06VpGd S8VusPqjRvMHJpzAccJ5nee5Kbf1ewtVotYzl+3krBHjoY2N3Y5iKPGHXencuAIHx3i7 r4RGZxdlAFJ+0ngeGVOATK/DayF/Ioh74SJBlS7TSs/CYoLkNCMiA5C7FnEuCGeOGZkq YZNg== X-Gm-Message-State: AC+VfDzOMnM9M83xqzAKngwNvqEAmp9Bc0ISGzv77Y2JeKHqzBHRVztC 3Ny3Scq1xgxlZyc1gxtCgGks5g== X-Google-Smtp-Source: ACHHUZ7J2peoF6dOFwXHN4OL8HtvxmF58Nf+m8oQBd9LUKiNtAZyjDfLV5ROsb+BqcCFVJsxMsyMBA== X-Received: by 2002:a19:6402:0:b0:4f6:5068:3c11 with SMTP id y2-20020a196402000000b004f650683c11mr7269507lfb.40.1686744719772; Wed, 14 Jun 2023 05:11:59 -0700 (PDT) Received: from [192.168.1.101] (abyj190.neoplus.adsl.tpnet.pl. [83.9.29.190]) by smtp.gmail.com with ESMTPSA id d2-20020ac25ec2000000b004f24e797c55sm2109793lfq.25.2023.06.14.05.11.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Jun 2023 05:11:59 -0700 (PDT) From: Konrad Dybcio Date: Wed, 14 Jun 2023 14:11:49 +0200 Subject: [PATCH 4/4] arm64: dts: qcom: sm8250-edo: Rectify gpio-keys MIME-Version: 1.0 Message-Id: <20230614-topic-edo_pinsgpiopmic-v1-4-cf88a0bac26c@linaro.org> References: <20230614-topic-edo_pinsgpiopmic-v1-0-cf88a0bac26c@linaro.org> In-Reply-To: <20230614-topic-edo_pinsgpiopmic-v1-0-cf88a0bac26c@linaro.org> To: Andy Gross , Bjorn Andersson , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Marijn Suijten , linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Konrad Dybcio , Konrad Dybcio X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1686744712; l=3205; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=1zgJzi0lueLgpAeV9ifSlI/3hHdlL1ZQj1ZG7GOA1qs=; b=0fsvZEDoDfIjQTVta1gCstx2qgONUqi9iWUR47T413TXK47hK/Bvw7jvn84UhlZd/HL5Pc4Ji BgNf6SW979vBeMKxJCjg71GIdtDwdsymEb9e7dYrDqRudLkga/Kxd/D X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Set up the corresponding GPIOs properly and add the leftover hardware buttons to mark this piece of the puzzle complete. Fixes: 69cdb97ef652 ("arm64: dts: qcom: sm8250: Add support for SONY Xperia 1 II / 5 II (Edo platform)") Signed-off-by: Konrad Dybcio --- .../dts/qcom/sm8250-sony-xperia-edo-pdx206.dts | 10 ++++ .../boot/dts/qcom/sm8250-sony-xperia-edo.dtsi | 54 +++++++++++++++++++--- 2 files changed, 58 insertions(+), 6 deletions(-) diff --git a/arch/arm64/boot/dts/qcom/sm8250-sony-xperia-edo-pdx206.dts b/arch/arm64/boot/dts/qcom/sm8250-sony-xperia-edo-pdx206.dts index ea4571bf4fbf..58a521046f5f 100644 --- a/arch/arm64/boot/dts/qcom/sm8250-sony-xperia-edo-pdx206.dts +++ b/arch/arm64/boot/dts/qcom/sm8250-sony-xperia-edo-pdx206.dts @@ -20,6 +20,8 @@ &framebuffer { }; &gpio_keys { + pinctrl-0 = <&focus_n &snapshot_n &vol_down_n &g_assist_n>; + g-assist-key { label = "Google Assistant Key"; linux,code = ; @@ -48,6 +50,14 @@ &pm8150_gpios { "SP_ARI_PWR_ALARM", "NC", "NC"; /* GPIO_10 */ + + g_assist_n: g-assist-n-state { + pins = "gpio6"; + function = "normal"; + power-source = <1>; + bias-pull-up; + input-enable; + }; }; &pm8150b_gpios { diff --git a/arch/arm64/boot/dts/qcom/sm8250-sony-xperia-edo.dtsi b/arch/arm64/boot/dts/qcom/sm8250-sony-xperia-edo.dtsi index 9f9e7e9784fe..e55a94e5ff08 100644 --- a/arch/arm64/boot/dts/qcom/sm8250-sony-xperia-edo.dtsi +++ b/arch/arm64/boot/dts/qcom/sm8250-sony-xperia-edo.dtsi @@ -50,12 +50,26 @@ framebuffer: framebuffer@9c000000 { gpio_keys: gpio-keys { compatible = "gpio-keys"; - /* - * Camera focus (light press) and camera snapshot (full press) - * seem not to work properly.. Adding the former one stalls the CPU - * and the latter kills the volume down key for whatever reason. In any - * case, they are both on &pm8150b_gpios: camera focus(2), camera snapshot(1). - */ + pinctrl-0 = <&focus_n &snapshot_n &vol_down_n>; + pinctrl-names = "default"; + + key-camera-focus { + label = "Camera Focus"; + linux,code = ; + gpios = <&pm8150b_gpios 2 GPIO_ACTIVE_LOW>; + debounce-interval = <15>; + linux,can-disable; + gpio-key,wakeup; + }; + + key-camera-snapshot { + label = "Camera Snapshot"; + linux,code = ; + gpios = <&pm8150b_gpios 1 GPIO_ACTIVE_LOW>; + debounce-interval = <15>; + linux,can-disable; + gpio-key,wakeup; + }; key-vol-down { label = "Volume Down"; @@ -543,6 +557,34 @@ &pcie2_phy { vdda-pll-supply = <&vreg_l9a_1p2>; }; +&pm8150_gpios { + vol_down_n: vol-down-n-state { + pins = "gpio1"; + function = "normal"; + power-source = <0>; + bias-pull-up; + input-enable; + }; +}; + +&pm8150b_gpios { + snapshot_n: snapshot-n-state { + pins = "gpio1"; + function = "normal"; + power-source = <0>; + bias-pull-up; + input-enable; + }; + + focus_n: focus-n-state { + pins = "gpio2"; + function = "normal"; + power-source = <0>; + bias-pull-up; + input-enable; + }; +}; + &pon_pwrkey { status = "okay"; };