Message ID | 20240121-msm8976-dt-v2-6-7b186a02dc72@somainline.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-32218-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2bc4:b0:101:a8e8:374 with SMTP id hx4csp2265464dyb; Sun, 21 Jan 2024 14:43:48 -0800 (PST) X-Google-Smtp-Source: AGHT+IERHUlGhhUC9x1g8gQ3DIEV8tR3L2vk7sIunzH3LmwFG9EYBdcbIHmELR0zjJcsRcCo1ZS6 X-Received: by 2002:a05:6870:d88b:b0:210:de3e:26ed with SMTP id oe11-20020a056870d88b00b00210de3e26edmr3114076oac.30.1705877028247; Sun, 21 Jan 2024 14:43:48 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705877028; cv=pass; d=google.com; s=arc-20160816; b=SVO8Ll7HSbaLpL/oOUNuLKVl3iY732tTKxBMC08Ajz0tYq+gY4B+WF2irFBLqg4vQR tYOdtQSkA+S1D+Qigt3o1gEqGFZjflA3/pdh8uO2RuSql7+1brGLjxazZd05RYKeN/y3 1PT2QgGmh/fQ8bnA+HoJ0Q0oX8nP0OswXWMBr1SaVbOSO+UWaOZwDesF3GyQnHgyH9WE OGq4p2HBxqxshM+9PA4oWMhhbrRNszyK9tcQQ13D0z/vymkMZ8E3TfCTbk6OCTm39cv8 F038AbFlGz6uqGpEtME/5opPUBP6huxjKFdtxjOnZUzlkN9WZVEYeb2Ybc9OJhPaDWzZ krfA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from; bh=Z1rfyTOSb68rp2u9fNXOZX9pB7MN4GNV8cILgQNPmVo=; fh=cIXbSO4AX1Qnl5qlb1ihZ3NJfL1FzL7RHuzbkbWyu6k=; b=foDMqg8pgOIYig+lpL4iHPFMvjrb9wXs04heWs4Rb8tKNFYSfeSyi929BZYljkICwE cSNTobkWllte85pjy587cC8uW15fZyFHVJSbuA8QTsK4seSYvGIu3yb7egewyjAPC4Lk 17tvj53zF2+UTWo0/Cty2PNuX+wZzxMCsZRLpaMv0SrTxJzhVcXc1w2jfR4zRPfXYlIx h8cH9KSoHkbCNcbE7YGlzqpLJ9B19c8a8HaV53IGgAeaGvPToukdU8q9GRnfJExCnEO0 dMSHO/S5qZNXY3h0efY/QOcLbOvE//aRlUCbWiRVQYmywZ+bvupmqef8oDTYJckss9cy rZcQ== ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=somainline.org); spf=pass (google.com: domain of linux-kernel+bounces-32218-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-32218-ouuuleilei=gmail.com@vger.kernel.org" Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id g17-20020a63dd51000000b005cfbd864267si3436375pgj.307.2024.01.21.14.43.47 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 21 Jan 2024 14:43:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-32218-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=somainline.org); spf=pass (google.com: domain of linux-kernel+bounces-32218-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-32218-ouuuleilei=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 6B6E0B219BA for <ouuuleilei@gmail.com>; Sun, 21 Jan 2024 22:43:13 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E483F39FE0; Sun, 21 Jan 2024 22:41:45 +0000 (UTC) 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 <marijn.suijten@somainline.org> 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: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit 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 <andersson@kernel.org>, Rob Herring <robh+dt@kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Conor Dooley <conor+dt@kernel.org> Cc: ~postmarketos/upstreaming@lists.sr.ht, AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>, Luca Weiss <luca@z3ntu.xyz>, Adam Skladowski <a39.skl@gmail.com>, Konrad Dybcio <konrad.dybcio@linaro.org>, Martin Botka <martin.botka@somainline.org>, Jami Kettunen <jami.kettunen@somainline.org>, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Marijn Suijten <marijn.suijten@somainline.org> X-Mailer: b4 0.12.4 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1788741710852254663 X-GMAIL-MSGID: 1788741710852254663 |
Series |
arm64: dts: qcom: msm8956-loire: SDCard and USB support
|
|
Commit Message
Marijn Suijten
Jan. 21, 2024, 10:33 p.m. UTC
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 <marijn.suijten@somainline.org>
---
arch/arm64/boot/dts/qcom/msm8956-sony-xperia-loire.dtsi | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
Comments
Il 21/01/24 23:33, Marijn Suijten ha scritto: > 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 <marijn.suijten@somainline.org> > --- > 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; > + }; Are you sure that you really don't want card detect during system suspend? You could simply add a sdc2-cd-pins out of sdc2_{on,off}_state and add use it for both default and sleep. pinctrl-0 = <&sdc2_on_state>, <&sdc2_card_det_n>; pinctrl-1 = <&sdc2_off_state>; Cheers, Angelo > +}; > + > &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 { >
On 2024-01-22 12:48:27, AngeloGioacchino Del Regno wrote: > Il 21/01/24 23:33, Marijn Suijten ha scritto: > > 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 <marijn.suijten@somainline.org> > > --- > > 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; > > + }; > > Are you sure that you really don't want card detect during system suspend? Does it make a difference if the rest of pinctrl and the SDHCI controller are also turned off? > You could simply add a sdc2-cd-pins out of sdc2_{on,off}_state and add use it for > both default and sleep. This sounds close to what Konrad suggested by using a new block wit its own label rather than extending the existing state. > pinctrl-0 = <&sdc2_on_state>, <&sdc2_card_det_n>; > pinctrl-1 = <&sdc2_off_state>; You said both, but it's not in pinctrl-1 here? (And might unselect bias-pull-up implicitly instead of explicitly selecting bias-disable via an off node?) - Marijn > Cheers, > Angelo > > > +}; > > + > > &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 { > > > >
Il 22/01/24 14:49, Marijn Suijten ha scritto: > On 2024-01-22 12:48:27, AngeloGioacchino Del Regno wrote: >> Il 21/01/24 23:33, Marijn Suijten ha scritto: >>> 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 <marijn.suijten@somainline.org> >>> --- >>> 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; >>> + }; >> >> Are you sure that you really don't want card detect during system suspend? > > Does it make a difference if the rest of pinctrl and the SDHCI controller are > also turned off? > >> You could simply add a sdc2-cd-pins out of sdc2_{on,off}_state and add use it for >> both default and sleep. > > This sounds close to what Konrad suggested by using a new block wit its own > label rather than extending the existing state. > >> pinctrl-0 = <&sdc2_on_state>, <&sdc2_card_det_n>; >> pinctrl-1 = <&sdc2_off_state>; > > You said both, but it's not in pinctrl-1 here? (And might unselect bias-pull-up > implicitly instead of explicitly selecting bias-disable via an off node?) > I meant to add it to both, sorry. In any case, take the typo'ed example as a simplification of your first version :-) > - Marijn > >> Cheers, >> Angelo >> >>> +}; >>> + >>> &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 { >>> >> >>
On 2024-01-22 15:59:37, AngeloGioacchino Del Regno wrote: > Il 22/01/24 14:49, Marijn Suijten ha scritto: > > On 2024-01-22 12:48:27, AngeloGioacchino Del Regno wrote: > >> Il 21/01/24 23:33, Marijn Suijten ha scritto: > >>> 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 <marijn.suijten@somainline.org> > >>> --- > >>> 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; > >>> + }; > >> > >> Are you sure that you really don't want card detect during system suspend? > > > > Does it make a difference if the rest of pinctrl and the SDHCI controller are > > also turned off? > > > >> You could simply add a sdc2-cd-pins out of sdc2_{on,off}_state and add use it for > >> both default and sleep. > > > > This sounds close to what Konrad suggested by using a new block wit its own > > label rather than extending the existing state. > > > >> pinctrl-0 = <&sdc2_on_state>, <&sdc2_card_det_n>; > >> pinctrl-1 = <&sdc2_off_state>; > > > > You said both, but it's not in pinctrl-1 here? (And might unselect bias-pull-up > > implicitly instead of explicitly selecting bias-disable via an off node?) > > > > I meant to add it to both, sorry. > > In any case, take the typo'ed example as a simplification of your first version :-) Okay, I'll resend a version that creates a new pinctrl node and applies it to both cases. Unfortunately I can no longer test and confirm that it makes a difference to have the card-detect IRQ always biased, even while the SDHCI controller is "asleep" or off, so I'll trust your word for it. If I remember correctly downstream turns it off as well? - Marijn
Il 22/01/24 16:15, Marijn Suijten ha scritto: > On 2024-01-22 15:59:37, AngeloGioacchino Del Regno wrote: >> Il 22/01/24 14:49, Marijn Suijten ha scritto: >>> On 2024-01-22 12:48:27, AngeloGioacchino Del Regno wrote: >>>> Il 21/01/24 23:33, Marijn Suijten ha scritto: >>>>> 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 <marijn.suijten@somainline.org> >>>>> --- >>>>> 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; >>>>> + }; >>>> >>>> Are you sure that you really don't want card detect during system suspend? >>> >>> Does it make a difference if the rest of pinctrl and the SDHCI controller are >>> also turned off? >>> >>>> You could simply add a sdc2-cd-pins out of sdc2_{on,off}_state and add use it for >>>> both default and sleep. >>> >>> This sounds close to what Konrad suggested by using a new block wit its own >>> label rather than extending the existing state. >>> >>>> pinctrl-0 = <&sdc2_on_state>, <&sdc2_card_det_n>; >>>> pinctrl-1 = <&sdc2_off_state>; >>> >>> You said both, but it's not in pinctrl-1 here? (And might unselect bias-pull-up >>> implicitly instead of explicitly selecting bias-disable via an off node?) >>> >> >> I meant to add it to both, sorry. >> >> In any case, take the typo'ed example as a simplification of your first version :-) > > Okay, I'll resend a version that creates a new pinctrl node and applies it to both cases. > > Unfortunately I can no longer test and confirm that it makes a difference > to have the card-detect IRQ always biased, even while the SDHCI controller > is "asleep" or off, so I'll trust your word for it. If I remember correctly > downstream turns it off as well? Marijn, I don't remember anything about a downstream kernel from 10 years ago..! But yes, it's okay to do so - the worst case is that it won't wake up, but that won't happen, as it's going to generate an interrupt and wake up the entire system which includes the SDHCI controller. Go on! Cheers, Angelo
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 {