From patchwork Sun Jan 21 22:33:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marijn Suijten X-Patchwork-Id: 764510 Received: from relay02.th.seeweb.it (relay02.th.seeweb.it [5.144.164.163]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AA30438DFE; Sun, 21 Jan 2024 22:41:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=5.144.164.163 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705876903; cv=none; b=DEi7cAbVtbgYskOYpv/xhzTP7ZCR/6BgHf5wlyVbo6YLkj57WuF7nbiFao69z4t6pp6x2H0rj1QoZgSk7pSxY3hNIp8Cdlm3DhMBfUY7hbUGUE8LIqJqwKfjtzwcllHrIZjkkKG4G8xeZ7jJeWI6DPhqH3pUaBnWdm1/CtumHDE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705876903; c=relaxed/simple; bh=v0gMRoyQDCC1TKIVZdeJRib9E5iuXMlTlBxUT/A1zTQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ZG9JZ7Eo1o5fB4+vffTLv4+iSSIGBJTVTvT2TCLtmCwJ8Cf15UFjtVvZuuZ0UQXAUTV42ObQ8CQaI7Y0DtlVMEfm1k6LqozTdwnjOVLvsahy7V03SBZefYNuzFXFg832PiejO4cD4/asnzoAPkAWJJdsMQI2zAQSVdyKnirIsXw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=somainline.org; spf=pass smtp.mailfrom=somainline.org; arc=none smtp.client-ip=5.144.164.163 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=somainline.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=somainline.org Received: from Marijn-Arch-PC.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-r1.th.seeweb.it (Postfix) with ESMTPSA id 24B0020332; Sun, 21 Jan 2024 23:33:40 +0100 (CET) From: Marijn Suijten Date: Sun, 21 Jan 2024 23:33:38 +0100 Subject: [PATCH v2 1/6] arm64: dts: qcom: pmi8950: Add USB vbus and id sensing nodes Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240121-msm8976-dt-v2-1-7b186a02dc72@somainline.org> References: <20240121-msm8976-dt-v2-0-7b186a02dc72@somainline.org> In-Reply-To: <20240121-msm8976-dt-v2-0-7b186a02dc72@somainline.org> To: Bjorn Andersson , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: ~postmarketos/upstreaming@lists.sr.ht, AngeloGioacchino Del Regno , Luca Weiss , Adam Skladowski , Konrad Dybcio , Martin Botka , Jami Kettunen , linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Marijn Suijten , AngeloGioacchino Del Regno X-Mailer: b4 0.12.4 USB sensing is performed on the PMIC, exposed as extcon nodes for use in the relevant USB (otg) driver nodes as the hardware itself is not able to sense USB presence (5V vbus) nor the role (ID pin). Signed-off-by: Marijn Suijten Reviewed-by: AngeloGioacchino Del Regno --- arch/arm64/boot/dts/qcom/pmi8950.dtsi | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/pmi8950.dtsi b/arch/arm64/boot/dts/qcom/pmi8950.dtsi index 1029f3b1bb9a..49e97ebdbb3c 100644 --- a/arch/arm64/boot/dts/qcom/pmi8950.dtsi +++ b/arch/arm64/boot/dts/qcom/pmi8950.dtsi @@ -12,6 +12,20 @@ pmic@2 { #address-cells = <1>; #size-cells = <0>; + pmi8950_usb_id: usb-id@1100 { + compatible = "qcom,pm8941-misc"; + reg = <0x1100>; + interrupts = <0x2 0x11 0x3 IRQ_TYPE_NONE>; + interrupt-names = "usb_id"; + }; + + pmi8950_usb_vbus: usb-detect@1300 { + compatible = "qcom,pm8941-misc"; + reg = <0x1300>; + interrupts = <0x2 0x13 0x2 IRQ_TYPE_NONE>; + interrupt-names = "usb_vbus"; + }; + pmi8950_vadc: adc@3100 { compatible = "qcom,spmi-vadc"; reg = <0x3100>; From patchwork Sun Jan 21 22:33:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marijn Suijten X-Patchwork-Id: 764511 Received: from m-r1.th.seeweb.it (m-r1.th.seeweb.it [5.144.164.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9AF3938DD1 for ; Sun, 21 Jan 2024 22:41:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=5.144.164.170 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705876903; cv=none; b=t27lO+ITVt6CkR9y3gtP75bVoOvVzYPphc2kPUoFiDINERAmmFCg58nAIITnCBZkeBe0+nflKR3I6bYKtl3przYaaF/jQlazZR+YB12kkaf4e11YJCxCTNHDXkPXi2YhRfVABXdCfSPSruEBIiyaf7R2oG/hve3JJwGMBT2dwTQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705876903; c=relaxed/simple; bh=RvaElXuVtRhvPwJGK8Oks7pSDH9b73Y6G9Dj7yXJywI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=llpfYR34g2Xa69bbLeJ1G3O+gsNCMNDYZv2MJWnskCj7V0UD7dJp3hb8p2vFff0nv+Q3B2IfscF0xJOsiRLaZ+yDxnGoBTB/8gfr+r/O0sP7dKHEo4onEw+wuoc/W3SRfBIgiFrkp/QJUMmQZj40kH/2OlA37NUwGPgMPRJj+pA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=somainline.org; spf=pass smtp.mailfrom=somainline.org; arc=none smtp.client-ip=5.144.164.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=somainline.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=somainline.org Received: from Marijn-Arch-PC.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-r1.th.seeweb.it (Postfix) with ESMTPSA id E24AD20375; Sun, 21 Jan 2024 23:33:40 +0100 (CET) From: Marijn Suijten Date: Sun, 21 Jan 2024 23:33:39 +0100 Subject: [PATCH v2 2/6] arm64: dts: qcom: msm8956-loire: Add usb vbus and id extcons to ci-hdrc Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240121-msm8976-dt-v2-2-7b186a02dc72@somainline.org> References: <20240121-msm8976-dt-v2-0-7b186a02dc72@somainline.org> In-Reply-To: <20240121-msm8976-dt-v2-0-7b186a02dc72@somainline.org> To: Bjorn Andersson , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: ~postmarketos/upstreaming@lists.sr.ht, AngeloGioacchino Del Regno , Luca Weiss , Adam Skladowski , Konrad Dybcio , Martin Botka , Jami Kettunen , linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Marijn Suijten , AngeloGioacchino Del Regno X-Mailer: b4 0.12.4 ci-hdrc does not have the ability to detect voltage presence (5V vbus) on the USB connector nor the role (via an ID sensing pin), and relies on the PMIC-side charger to provide such information through an extcon driver. Signed-off-by: Marijn Suijten Reviewed-by: AngeloGioacchino Del Regno --- arch/arm64/boot/dts/qcom/msm8956-sony-xperia-loire.dtsi | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/msm8956-sony-xperia-loire.dtsi b/arch/arm64/boot/dts/qcom/msm8956-sony-xperia-loire.dtsi index 085d79542e1b..a82b58cdd99c 100644 --- a/arch/arm64/boot/dts/qcom/msm8956-sony-xperia-loire.dtsi +++ b/arch/arm64/boot/dts/qcom/msm8956-sony-xperia-loire.dtsi @@ -76,6 +76,8 @@ &gcc { }; &otg { + extcon = <&pmi8950_usb_vbus>, <&pmi8950_usb_id>; + status = "okay"; }; From patchwork Sun Jan 21 22:33:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marijn Suijten X-Patchwork-Id: 764512 Received: from m-r1.th.seeweb.it (m-r1.th.seeweb.it [5.144.164.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E098B364DA for ; Sun, 21 Jan 2024 22:33:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=5.144.164.170 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705876425; cv=none; b=m0NAYUkpn8/uLwfypaeLzhc1JvBHpZuqF5czwrSsD4wHxjTL7LW8QDuFBiyceJQmUX0807ZeqyQFQWPlNnLR3rYYS/FmfXlN/HlYLQwNjljVBkoVGH3+8rIjom2GTa9sUz9rUNzbqvzI3+NhhWFkLohY3MAaTMS7kmqgijGis1g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705876425; c=relaxed/simple; bh=CTNcfJwybjX/Tkl9gEBdYFF2xig/uDP3Ncqgqn4vJJ0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=oD6/4rwx059DGpUcIOc23OIt5HdK/XFVdfF94/rqtZPHEv5L8E/taR4okrPOVQ3BYSYBPCbWbNpmu2cHaRQ6a02SdHjA45vUYkpx67nejsP2z3YKwFdSd4vcmutzhs3du5IEfaXiYsC1jgfD1+RrRpbMM4wF1CJQfHsNNoQVA1I= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=somainline.org; spf=pass smtp.mailfrom=somainline.org; arc=none smtp.client-ip=5.144.164.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=somainline.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=somainline.org Received: from Marijn-Arch-PC.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-r1.th.seeweb.it (Postfix) with ESMTPSA id B06C32037A; Sun, 21 Jan 2024 23:33:41 +0100 (CET) From: Marijn Suijten Date: Sun, 21 Jan 2024 23:33:40 +0100 Subject: [PATCH v2 3/6] arm64: dts: qcom: pmi8950: Add missing ADC channels Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240121-msm8976-dt-v2-3-7b186a02dc72@somainline.org> References: <20240121-msm8976-dt-v2-0-7b186a02dc72@somainline.org> In-Reply-To: <20240121-msm8976-dt-v2-0-7b186a02dc72@somainline.org> To: Bjorn Andersson , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: ~postmarketos/upstreaming@lists.sr.ht, AngeloGioacchino Del Regno , Luca Weiss , Adam Skladowski , Konrad Dybcio , Martin Botka , Jami Kettunen , linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Marijn Suijten X-Mailer: b4 0.12.4 These seem to have previously been excluded due to either not residing on the test board, and/or lacking VADC_USB_DP/VADC_USB_DM definitions. Now that the channel constants are included in dt-bindings, add the channels to DT as well. Reviewed-by: Konrad Dybcio Signed-off-by: Marijn Suijten --- arch/arm64/boot/dts/qcom/pmi8950.dtsi | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/pmi8950.dtsi b/arch/arm64/boot/dts/qcom/pmi8950.dtsi index 49e97ebdbb3c..bc341849b9fe 100644 --- a/arch/arm64/boot/dts/qcom/pmi8950.dtsi +++ b/arch/arm64/boot/dts/qcom/pmi8950.dtsi @@ -69,6 +69,30 @@ channel@d { qcom,pre-scaling = <1 1>; label = "chg_temp"; }; + + channel@e { + reg = ; + qcom,pre-scaling = <1 1>; + label = "ref_gnd"; + }; + + channel@f { + reg = ; + qcom,pre-scaling = <1 1>; + label = "ref_vdd"; + }; + + channel@43 { + reg = ; + qcom,pre-scaling = <1 1>; + label = "usb_dp"; + }; + + channel@44 { + reg = ; + qcom,pre-scaling = <1 1>; + label = "usb_dm"; + }; }; pmi8950_mpps: mpps@a000 { From patchwork Sun Jan 21 22:33:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marijn Suijten X-Patchwork-Id: 764816 Received: from relay01.th.seeweb.it (relay01.th.seeweb.it [5.144.164.162]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 09B9D383B5; Sun, 21 Jan 2024 22:33:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=5.144.164.162 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705876426; cv=none; b=tzfkIgvaQ0hkLyQqQUKCy4rDbgo9gOQGW7irnxkPUF/oqA6FF4020TvkPvh9sMX39WcG9AFUw8Fv5o4I9+GuYXa06sgPj2kCbH5iB49tL6LIw70ZYr0w8LKTSIeXelC+zPoonouHmcNwbdGgRyDkbZem/h0HaNmtokL9aAFxwiI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705876426; c=relaxed/simple; bh=Ka0suA2f6Mht4+t9XWWJHrO4gwspsyTwEIQwdjMFPoc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=m5ROh4ec+oxRymrZ1qku5+kgPhwiUcje/Hy+hqTvt+SiRBKkz+Da7RlDy/BTOHtgf2JgvKEhcWnglGE+gH7PpDgK3FFU12uE9tlihYStbVJXs1rNcvsjCEO4s7d4BNssH49vv4hJklbE0MqShVTJPKg5yolrjnCQCN7esiRViIQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=somainline.org; spf=pass smtp.mailfrom=somainline.org; arc=none smtp.client-ip=5.144.164.162 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=somainline.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=somainline.org Received: from Marijn-Arch-PC.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-r1.th.seeweb.it (Postfix) with ESMTPSA id 7436720385; Sun, 21 Jan 2024 23:33:42 +0100 (CET) From: Marijn Suijten Date: Sun, 21 Jan 2024 23:33:41 +0100 Subject: [PATCH v2 4/6] arm64: dts: qcom: msm8976: Declare and use SDC1 pins Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240121-msm8976-dt-v2-4-7b186a02dc72@somainline.org> References: <20240121-msm8976-dt-v2-0-7b186a02dc72@somainline.org> In-Reply-To: <20240121-msm8976-dt-v2-0-7b186a02dc72@somainline.org> To: Bjorn Andersson , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: ~postmarketos/upstreaming@lists.sr.ht, AngeloGioacchino Del Regno , Luca Weiss , Adam Skladowski , Konrad Dybcio , Martin Botka , Jami Kettunen , linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Marijn Suijten X-Mailer: b4 0.12.4 Add the pinctrl states for SDC1 and use them on sdhc_1. Signed-off-by: Marijn Suijten --- arch/arm64/boot/dts/qcom/msm8976.dtsi | 55 +++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/msm8976.dtsi b/arch/arm64/boot/dts/qcom/msm8976.dtsi index d2bb1ada361a..1d06f9b8a0f1 100644 --- a/arch/arm64/boot/dts/qcom/msm8976.dtsi +++ b/arch/arm64/boot/dts/qcom/msm8976.dtsi @@ -669,6 +669,56 @@ tlmm: pinctrl@1000000 { interrupt-controller; #interrupt-cells = <2>; + sdc1_off_state: sdc1-off-state { + clk-pins { + pins = "sdc1_clk"; + drive-strength = <2>; + bias-disable; + }; + + cmd-pins { + pins = "sdc1_cmd"; + drive-strength = <2>; + bias-pull-up; + }; + + data-pins { + pins = "sdc1_data"; + drive-strength = <2>; + bias-pull-up; + }; + + rclk-pins { + pins = "sdc1_rclk"; + bias-pull-down; + }; + }; + + sdc1_on_state: sdc1-on-state { + clk-pins { + pins = "sdc1_clk"; + drive-strength = <16>; + bias-disable; + }; + + cmd-pins { + pins = "sdc1_cmd"; + drive-strength = <10>; + bias-pull-up; + }; + + data-pins { + pins = "sdc1_data"; + drive-strength = <10>; + bias-pull-up; + }; + + rclk-pins { + pins = "sdc1_rclk"; + bias-pull-down; + }; + }; + spi1_default: spi0-default-state { spi-pins { pins = "gpio0", "gpio1", "gpio3"; @@ -840,6 +890,11 @@ sdhc_1: mmc@7824900 { <&gcc GCC_SDCC1_APPS_CLK>, <&rpmcc RPM_SMD_XO_CLK_SRC>; clock-names = "iface", "core", "xo"; + + pinctrl-names = "default", "sleep"; + pinctrl-0 = <&sdc1_on_state>; + pinctrl-1 = <&sdc1_off_state>; + status = "disabled"; }; From patchwork Sun Jan 21 22:33:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marijn Suijten X-Patchwork-Id: 764815 Received: from m-r1.th.seeweb.it (m-r1.th.seeweb.it [5.144.164.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9AF13383BA for ; Sun, 21 Jan 2024 22:41:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=5.144.164.170 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705876903; cv=none; b=s00bqfOx6YhXo1hGRli9Tbq8u0ALOHpd4BgAJAewZ1PByWIPsYf1Yqhodw8dRNSgQrVjCMModMZ+IMC56+xgaezhTmA+ap0+Mn2ETEocv6uyUTfj+cHMY+AcLjQpvZq7/8CZD6cPVm3Rz+4DB7X7vs1ttUfwbU7T/a3rLcidxE0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705876903; c=relaxed/simple; bh=VbDBG4qhPodRfMvJ9XKMOJeUDdjCBEhllCKMHhMsXow=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Qng7nE75QL3zpTMOaeM7HIAhs2AXRMMRatGiY/5R8c6KnD479dQOXPY8k4+I0BBEWzr0RVpUUvinxsf0a7pIeQUCbBm+AzrGa1MQlCPfBOpPFGV/4Irmo9TFibi1+6iq9nvA4wkigKV6kfnT5lZiaxONdjS9of6Hm4PP1xr2hMA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=somainline.org; spf=pass smtp.mailfrom=somainline.org; arc=none smtp.client-ip=5.144.164.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=somainline.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=somainline.org Received: from Marijn-Arch-PC.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-r1.th.seeweb.it (Postfix) with ESMTPSA id 3A7DD20300; Sun, 21 Jan 2024 23:33:43 +0100 (CET) From: Marijn Suijten Date: Sun, 21 Jan 2024 23:33:42 +0100 Subject: [PATCH v2 5/6] arm64: dts: qcom: msm8976: Declare and use SDC2 pins Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240121-msm8976-dt-v2-5-7b186a02dc72@somainline.org> References: <20240121-msm8976-dt-v2-0-7b186a02dc72@somainline.org> In-Reply-To: <20240121-msm8976-dt-v2-0-7b186a02dc72@somainline.org> To: Bjorn Andersson , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: ~postmarketos/upstreaming@lists.sr.ht, AngeloGioacchino Del Regno , Luca Weiss , Adam Skladowski , Konrad Dybcio , Martin Botka , Jami Kettunen , linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Marijn Suijten X-Mailer: b4 0.12.4 Add the pinctrl states for SDC2 and use them on sdhc_2 to support SD Cards on the currently mainlined Sony Loire platform. Signed-off-by: Marijn Suijten --- .../dts/qcom/msm8956-sony-xperia-loire-kugo.dts | 6 +++ .../boot/dts/qcom/msm8956-sony-xperia-loire.dtsi | 6 +++ arch/arm64/boot/dts/qcom/msm8976.dtsi | 45 ++++++++++++++++++++++ 3 files changed, 57 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/msm8956-sony-xperia-loire-kugo.dts b/arch/arm64/boot/dts/qcom/msm8956-sony-xperia-loire-kugo.dts index 3fb8e23e4330..9178943e2ee1 100644 --- a/arch/arm64/boot/dts/qcom/msm8956-sony-xperia-loire-kugo.dts +++ b/arch/arm64/boot/dts/qcom/msm8956-sony-xperia-loire-kugo.dts @@ -33,3 +33,9 @@ &pm8950_l1 { regulator-min-microvolt = <1100000>; regulator-max-microvolt = <1300000>; }; + +&sdc2_on_state { + data-pins { + drive-strength = <8>; + }; +}; diff --git a/arch/arm64/boot/dts/qcom/msm8956-sony-xperia-loire.dtsi b/arch/arm64/boot/dts/qcom/msm8956-sony-xperia-loire.dtsi index a82b58cdd99c..b0b83edd3627 100644 --- a/arch/arm64/boot/dts/qcom/msm8956-sony-xperia-loire.dtsi +++ b/arch/arm64/boot/dts/qcom/msm8956-sony-xperia-loire.dtsi @@ -264,6 +264,12 @@ &sdhc_1 { status = "okay"; }; +&sdc2_on_state { + clk-pins { + drive-strength = <10>; + }; +}; + &sdhc_2 { bus-width = <4>; cd-gpios = <&tlmm 100 GPIO_ACTIVE_HIGH>; diff --git a/arch/arm64/boot/dts/qcom/msm8976.dtsi b/arch/arm64/boot/dts/qcom/msm8976.dtsi index 1d06f9b8a0f1..c100f63b1883 100644 --- a/arch/arm64/boot/dts/qcom/msm8976.dtsi +++ b/arch/arm64/boot/dts/qcom/msm8976.dtsi @@ -719,6 +719,46 @@ rclk-pins { }; }; + sdc2_off_state: sdc2-off-state { + clk-pins { + pins = "sdc2_clk"; + drive-strength = <2>; + bias-disable; + }; + + cmd-pins { + pins = "sdc2_cmd"; + drive-strength = <2>; + bias-pull-up; + }; + + data-pins { + pins = "sdc2_data"; + drive-strength = <2>; + bias-pull-up; + }; + }; + + sdc2_on_state: sdc2-on-state { + clk-pins { + pins = "sdc2_clk"; + drive-strength = <16>; + bias-disable; + }; + + cmd-pins { + pins = "sdc2_cmd"; + drive-strength = <10>; + bias-pull-up; + }; + + data-pins { + pins = "sdc2_data"; + drive-strength = <10>; + bias-pull-up; + }; + }; + spi1_default: spi0-default-state { spi-pins { pins = "gpio0", "gpio1", "gpio3"; @@ -911,6 +951,11 @@ sdhc_2: mmc@7864900 { <&gcc GCC_SDCC2_APPS_CLK>, <&rpmcc RPM_SMD_XO_CLK_SRC>; clock-names = "iface", "core", "xo"; + + pinctrl-names = "default", "sleep"; + pinctrl-0 = <&sdc2_on_state>; + pinctrl-1 = <&sdc2_off_state>; + status = "disabled"; }; From patchwork Sun Jan 21 22:33:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marijn Suijten X-Patchwork-Id: 764814 Received: from relay02.th.seeweb.it (relay02.th.seeweb.it [5.144.164.163]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9600638384; Sun, 21 Jan 2024 22:41:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=5.144.164.163 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705876904; cv=none; b=r0pIWznhxuWOVaGh1POM6trHhNnhOvTgD856WzqzgKgovlPHXLaO6vpe8S+DfLswMAj9Wp6RS9W40wrnsVW2VkvPThso7R57pP3c2bkJumJNTH46IVN1JT9oIC2WijrXTcv2R5kDKKI4ONVQ31FhfKiaGS8m7WWSajrCesMrTfs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705876904; c=relaxed/simple; bh=WJ4yt2ceaxagRwjbxAaPjRX6Swf4XBTvvfUCXxi7z30=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=NlpNbgb7spG5SCcoARM4en9i7VOtcgfRqyYsf04AXD876HBTZdRuN0yek7VsklDVCgTwgSx9ApzQXMn0GUuBXusklf0HKJRMb89jY6vETjXawT+jU/ggRXfiRaH2G4GtHCoI2kzG5K/h8wxh8YLsgneKjOl9FyYpgFs7ixncgiQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=somainline.org; spf=pass smtp.mailfrom=somainline.org; arc=none smtp.client-ip=5.144.164.163 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=somainline.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=somainline.org Received: from Marijn-Arch-PC.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-r1.th.seeweb.it (Postfix) with ESMTPSA id 00E04203AA; Sun, 21 Jan 2024 23:33:43 +0100 (CET) From: Marijn Suijten Date: Sun, 21 Jan 2024 23:33:43 +0100 Subject: [PATCH v2 6/6] arm64: dts: qcom: msm8956-loire: Add SD Card Detect to SDC2 pin states Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240121-msm8976-dt-v2-6-7b186a02dc72@somainline.org> References: <20240121-msm8976-dt-v2-0-7b186a02dc72@somainline.org> In-Reply-To: <20240121-msm8976-dt-v2-0-7b186a02dc72@somainline.org> To: Bjorn Andersson , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: ~postmarketos/upstreaming@lists.sr.ht, AngeloGioacchino Del Regno , Luca Weiss , Adam Skladowski , Konrad Dybcio , Martin Botka , Jami Kettunen , linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Marijn Suijten X-Mailer: b4 0.12.4 In addition to the SDC2 pins, set the SD Card Detect pin in a sane state to be used as an interrupt when an SD Card is slotted in or removed. Signed-off-by: Marijn Suijten --- arch/arm64/boot/dts/qcom/msm8956-sony-xperia-loire.dtsi | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/msm8956-sony-xperia-loire.dtsi b/arch/arm64/boot/dts/qcom/msm8956-sony-xperia-loire.dtsi index b0b83edd3627..75412e37334c 100644 --- a/arch/arm64/boot/dts/qcom/msm8956-sony-xperia-loire.dtsi +++ b/arch/arm64/boot/dts/qcom/msm8956-sony-xperia-loire.dtsi @@ -264,10 +264,27 @@ &sdhc_1 { status = "okay"; }; +&sdc2_off_state { + sd-cd-pins { + pins = "gpio100"; + function = "gpio"; + drive-strength = <2>; + bias-disable; + }; +}; + &sdc2_on_state { clk-pins { drive-strength = <10>; }; + + sd-cd-pins { + pins = "gpio100"; + function = "gpio"; + drive-strength = <2>; + input-enable; + bias-pull-up; + }; }; &sdhc_2 {