Message ID | 20240206114745.1388491-3-quic_kriskura@quicinc.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-54834-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:168b:b0:106:860b:bbdd with SMTP id ma11csp1488216dyb; Tue, 6 Feb 2024 04:04:37 -0800 (PST) X-Google-Smtp-Source: AGHT+IH8ixAhrQwPhLv294JUs/QuNWxQ5SDBAngIKVqfxmBTcGCupGkz5Zyy/VJxAjWQxroIYUAn X-Received: by 2002:a17:902:9f8e:b0:1d9:61f1:571 with SMTP id g14-20020a1709029f8e00b001d961f10571mr1327088plq.31.1707221077685; Tue, 06 Feb 2024 04:04:37 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707221077; cv=pass; d=google.com; s=arc-20160816; b=EtZTKHX4kDIW4c20hcLuACC0LEkwigAgCbOqcvQycuC+wBtdOR+Q8mHitaYpAbVzP0 wnQDsenZRRoaVqfDSlyo8nEziw3vgLeFWtOYg/85MLjUlFEfx9I10tNLit0IRuA5AI6I wfYdHK9p3TlOb07auOrHOgv0m5iGCytVI7QErudMess3Kbk+7+pEieXNjOt7j8PQUs8A VvJoQFOnlKRMnunYB/ooFGMzXjX/0h8llx6d5jAEU3l1rRJm8khCP0fmnfbBsVlL977+ HIwQYcg8MDBmOEqDaaHCCM3Dq3xhPwv1tC8dqxy8I7xfA98E+PFn8KKVCzxUd/78Hiwd udbQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=CY3N/nDEDwhXEdlnDpgUtfMLvdJp4cINjI0iGKTecUc=; fh=PnAJBUYNDKmmXkyqi6iTbg5WfV/BgpnIlq3SMBDysL0=; b=Qh1cGAGvEW1Yv5ILpumzJhYWTS5Aym8FvNsurRxYCZdTczFPPVPTx6MPJKNPyHiQ6M D69YqV1LuUAMkIOrUWwW420h2m6IxjNdqGDh/LabBSce3YFbnjVbFtcwRm/DOCx/dqUB M+TAUNshWutnUlCF/S+DEJLcMPnq4VYfAnClk7f9AVaYa7178hrfKzMGP10EukEmpVZ6 QOAqQ1P7L1OIo3bceVLQ5+0VY7H+LgOCCNhxtzVfByB8xK9QG/CVAnBS9fvEUVxsB8Dx JmRT3eDCD3arU8GT6aQKGE7x790jP8Qc3xN1i1VuakUhd+hfAdJ1nWaT9509deozy6DP g8bQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=XqIBGUMX; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-kernel+bounces-54834-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-54834-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com X-Forwarded-Encrypted: i=1; AJvYcCWZvAkvlY+u+ZGC7qz9AE7NEByVGGxIW9tZlOVgEZd20VtKYIlXa2DLF8020Up9kwlJJSxCNs4mUhaHL1LMBcy1gD8XRQ== Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id s6-20020a170902ea0600b001d8882dd695si1636055plg.251.2024.02.06.04.04.37 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Feb 2024 04:04:37 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-54834-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=XqIBGUMX; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-kernel+bounces-54834-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-54834-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id B537D283F68 for <ouuuleilei@gmail.com>; Tue, 6 Feb 2024 12:03:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 267881350F2; Tue, 6 Feb 2024 11:48:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="XqIBGUMX" Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (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 F3E2B1350D5; Tue, 6 Feb 2024 11:48:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707220095; cv=none; b=nMdLvTVjWESxf8uC8Xu5dNgPJxL0AJhiTsTvTzLi8qqiieLUauF80ZOb0ELyiZrODs6jbKSndPNF1i2GIBER85b+h+hw8Z2p7HYhzkGBjPk59SdXKQENx1BjJZHIm+lRPpdN6JMpxg2o5j0dQDaHxeERsTSSBVUSlnl/fmWlvS8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707220095; c=relaxed/simple; bh=ddel/XIxqBvx0M3F8boknndMEkOJvPvc+PT/9tfwYYU=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=O4ec1O4Tim4WBHL0Nny4+xS/dj7JWDUTQbb4VQMOB95qMVlyoNxonbeOf1Jm+V7Z403HnulXywexLkDh9IcRgvfBkWTiyAl4Tc+fbRmgKj1MM/aL68+3JMNvX+4zTIMUMHGofp7zXWg8wwiV/EFsEx+f226YRdjQj6SbyZuXoOo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=XqIBGUMX; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Received: from pps.filterd (m0279863.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 41650BT2001304; Tue, 6 Feb 2024 11:48:11 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s= qcppdkim1; bh=CY3N/nDEDwhXEdlnDpgUtfMLvdJp4cINjI0iGKTecUc=; b=Xq IBGUMXEO4MTmX5u258kmDppEdKClAj68BySx5SHsVU1041hEG4rWBs02jqHdK8MT erGJk6utShEcRliGde3kNlm6uU6dp38A2JQ9Sgp0NYR2j60GogpNC0V9BzYz8qG4 BMSw57/waS6bmR0ojoHSxj+jjPcfx8kl+ZvSgyScZ7NytcpZiW/QsZYQLueZ6Pso eIHQ0PzEkJRrdy0+czFmrfpGNrNPTZ8EifMOfDWbammdRx7g5dEtDkQjImXj496r JZM8OqQmk2SLHxj+j4w1srJ0hYiy7S5SfDTI3Lsc48Tj/EcJaly8bmpoqgwvE09F g70+yku7+kdTwBRE1Blw== Received: from nalasppmta01.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3w3e7g0sap-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 06 Feb 2024 11:48:10 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA01.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 416BmAwe025013 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 6 Feb 2024 11:48:10 GMT Received: from hu-kriskura-hyd.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Tue, 6 Feb 2024 03:48:06 -0800 From: Krishna Kurapati <quic_kriskura@quicinc.com> To: Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Rob Herring <robh+dt@kernel.org>, Bjorn Andersson <andersson@kernel.org>, Konrad Dybcio <konrad.dybcio@linaro.org>, Conor Dooley <conor+dt@kernel.org> CC: <linux-kernel@vger.kernel.org>, <linux-arm-msm@vger.kernel.org>, <devicetree@vger.kernel.org>, <quic_ppratap@quicinc.com>, <quic_jackp@quicinc.com>, Krishna Kurapati <quic_kriskura@quicinc.com> Subject: [PATCH 2/3] arm64: dts: qcom: sa8295p: Enable tertiary controller and its 4 USB ports Date: Tue, 6 Feb 2024 17:17:44 +0530 Message-ID: <20240206114745.1388491-3-quic_kriskura@quicinc.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240206114745.1388491-1-quic_kriskura@quicinc.com> References: <20240206114745.1388491-1-quic_kriskura@quicinc.com> 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-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: jgSbkpc9G5Cn6sITfWVBYSsxjNGavLio X-Proofpoint-ORIG-GUID: jgSbkpc9G5Cn6sITfWVBYSsxjNGavLio X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-02-06_05,2024-01-31_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 suspectscore=0 adultscore=0 mlxscore=0 mlxlogscore=590 lowpriorityscore=0 bulkscore=0 spamscore=0 clxscore=1015 priorityscore=1501 phishscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2401310000 definitions=main-2402060083 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790151048606819677 X-GMAIL-MSGID: 1790151048606819677 |
Series |
Add DT support for Multiport controller on SC8280XP
|
|
Commit Message
Krishna Kurapati
Feb. 6, 2024, 11:47 a.m. UTC
Enable tertiary controller for SA8295P (based on SC8280XP).
Add pinctrl support for usb ports to provide VBUS to connected peripherals.
Signed-off-by: Krishna Kurapati <quic_kriskura@quicinc.com>
---
arch/arm64/boot/dts/qcom/sa8295p-adp.dts | 49 ++++++++++++++++++++++++
1 file changed, 49 insertions(+)
Comments
On Tue, 6 Feb 2024 at 14:03, Krishna Kurapati <quic_kriskura@quicinc.com> wrote: > > Enable tertiary controller for SA8295P (based on SC8280XP). > Add pinctrl support for usb ports to provide VBUS to connected peripherals. These are not just pinctrl entries. They hide VBUS regulators. Please implement them properly as corresponding vbus regulators. > > Signed-off-by: Krishna Kurapati <quic_kriskura@quicinc.com> > --- > arch/arm64/boot/dts/qcom/sa8295p-adp.dts | 49 ++++++++++++++++++++++++ > 1 file changed, 49 insertions(+) > > diff --git a/arch/arm64/boot/dts/qcom/sa8295p-adp.dts b/arch/arm64/boot/dts/qcom/sa8295p-adp.dts > index fd253942e5e5..6da444042f82 100644 > --- a/arch/arm64/boot/dts/qcom/sa8295p-adp.dts > +++ b/arch/arm64/boot/dts/qcom/sa8295p-adp.dts > @@ -9,6 +9,7 @@ > #include <dt-bindings/gpio/gpio.h> > #include <dt-bindings/regulator/qcom,rpmh-regulator.h> > #include <dt-bindings/spmi/spmi.h> > +#include <dt-bindings/pinctrl/qcom,pmic-gpio.h> > > #include "sa8540p.dtsi" > #include "sa8540p-pmics.dtsi" > @@ -584,6 +585,16 @@ &usb_1_qmpphy { > status = "okay"; > }; > > +&usb_2 { > + pinctrl-0 = <&usb2_en>, > + <&usb3_en>, > + <&usb4_en>, > + <&usb5_en>; > + pinctrl-names = "default"; > + > + status = "okay"; > +}; > + > &usb_2_hsphy0 { > vdda-pll-supply = <&vreg_l5a>; > vdda18-supply = <&vreg_l7g>; > @@ -636,6 +647,44 @@ &xo_board_clk { > > /* PINCTRL */ > > +&pmm8540c_gpios { > + usb2_en: usb2-en-state { > + pins = "gpio9"; > + function = "normal"; > + qcom,drive-strength = <PMIC_GPIO_STRENGTH_HIGH>; > + output-high; > + power-source = <0>; > + }; > +}; > + > +&pmm8540e_gpios { > + usb3_en: usb3-en-state { > + pins = "gpio5"; > + function = "normal"; > + qcom,drive-strength = <PMIC_GPIO_STRENGTH_HIGH>; > + output-high; > + power-source = <0>; > + }; > +}; > + > +&pmm8540g_gpios { > + usb4_en: usb4-en-state { > + pins = "gpio5"; > + function = "normal"; > + qcom,drive-strength = <PMIC_GPIO_STRENGTH_HIGH>; > + output-high; > + power-source = <0>; > + }; > + > + usb5_en: usb5-en-state { > + pins = "gpio9"; > + function = "normal"; > + qcom,drive-strength = <PMIC_GPIO_STRENGTH_HIGH>; > + output-high; > + power-source = <0>; > + }; > +}; > + > &tlmm { > pcie2a_default: pcie2a-default-state { > clkreq-n-pins { > -- > 2.34.1 > >
On 2/6/2024 5:43 PM, Dmitry Baryshkov wrote: > On Tue, 6 Feb 2024 at 14:03, Krishna Kurapati <quic_kriskura@quicinc.com> wrote: >> >> Enable tertiary controller for SA8295P (based on SC8280XP). >> Add pinctrl support for usb ports to provide VBUS to connected peripherals. > > These are not just pinctrl entries. They hide VBUS regulators. Please > implement them properly as corresponding vbus regulators. > Hi Dmitry. Apologies, can you elaborate on your comment. I thought this implementation was fine as Konrad reviewed it in v13 [1]. I removed his RB tag as I made one change of dropping "_state" in labels. [1]: https://lore.kernel.org/all/7141c2dd-9dcd-4186-ba83-829fe925e464@linaro.org/ Regards, Krishna, >> >> Signed-off-by: Krishna Kurapati <quic_kriskura@quicinc.com> >> --- >> arch/arm64/boot/dts/qcom/sa8295p-adp.dts | 49 ++++++++++++++++++++++++ >> 1 file changed, 49 insertions(+) >> >> diff --git a/arch/arm64/boot/dts/qcom/sa8295p-adp.dts b/arch/arm64/boot/dts/qcom/sa8295p-adp.dts >> index fd253942e5e5..6da444042f82 100644 >> --- a/arch/arm64/boot/dts/qcom/sa8295p-adp.dts >> +++ b/arch/arm64/boot/dts/qcom/sa8295p-adp.dts >> @@ -9,6 +9,7 @@ >> #include <dt-bindings/gpio/gpio.h> >> #include <dt-bindings/regulator/qcom,rpmh-regulator.h> >> #include <dt-bindings/spmi/spmi.h> >> +#include <dt-bindings/pinctrl/qcom,pmic-gpio.h> >> >> #include "sa8540p.dtsi" >> #include "sa8540p-pmics.dtsi" >> @@ -584,6 +585,16 @@ &usb_1_qmpphy { >> status = "okay"; >> }; >> >> +&usb_2 { >> + pinctrl-0 = <&usb2_en>, >> + <&usb3_en>, >> + <&usb4_en>, >> + <&usb5_en>; >> + pinctrl-names = "default"; >> + >> + status = "okay"; >> +}; >> + >> &usb_2_hsphy0 { >> vdda-pll-supply = <&vreg_l5a>; >> vdda18-supply = <&vreg_l7g>; >> @@ -636,6 +647,44 @@ &xo_board_clk { >> >> /* PINCTRL */ >> >> +&pmm8540c_gpios { >> + usb2_en: usb2-en-state { >> + pins = "gpio9"; >> + function = "normal"; >> + qcom,drive-strength = <PMIC_GPIO_STRENGTH_HIGH>; >> + output-high; >> + power-source = <0>; >> + }; >> +}; >> + >> +&pmm8540e_gpios { >> + usb3_en: usb3-en-state { >> + pins = "gpio5"; >> + function = "normal"; >> + qcom,drive-strength = <PMIC_GPIO_STRENGTH_HIGH>; >> + output-high; >> + power-source = <0>; >> + }; >> +}; >> + >> +&pmm8540g_gpios { >> + usb4_en: usb4-en-state { >> + pins = "gpio5"; >> + function = "normal"; >> + qcom,drive-strength = <PMIC_GPIO_STRENGTH_HIGH>; >> + output-high; >> + power-source = <0>; >> + }; >> + >> + usb5_en: usb5-en-state { >> + pins = "gpio9"; >> + function = "normal"; >> + qcom,drive-strength = <PMIC_GPIO_STRENGTH_HIGH>; >> + output-high; >> + power-source = <0>; >> + }; >> +}; >> + >> &tlmm { >> pcie2a_default: pcie2a-default-state { >> clkreq-n-pins { >> -- >> 2.34.1 >> >> > >
On Tue, 6 Feb 2024 at 14:28, Krishna Kurapati PSSNV <quic_kriskura@quicinc.com> wrote: > > > > On 2/6/2024 5:43 PM, Dmitry Baryshkov wrote: > > On Tue, 6 Feb 2024 at 14:03, Krishna Kurapati <quic_kriskura@quicinc.com> wrote: > >> > >> Enable tertiary controller for SA8295P (based on SC8280XP). > >> Add pinctrl support for usb ports to provide VBUS to connected peripherals. > > > > These are not just pinctrl entries. They hide VBUS regulators. Please > > implement them properly as corresponding vbus regulators. > > > > Hi Dmitry. Apologies, can you elaborate on your comment. I thought this > implementation was fine as Konrad reviewed it in v13 [1]. I removed his > RB tag as I made one change of dropping "_state" in labels. My comment is pretty simple: if I'm not mistaken, your DT doesn't reflect your hardware design. You have actual VBUS regulators driven by these GPIO pins. Is this correct? If so, you should describe them properly in the device tree rather than describing them just as USB host's pinctrl state. > > [1]: > https://lore.kernel.org/all/7141c2dd-9dcd-4186-ba83-829fe925e464@linaro.org/ > > Regards, > Krishna, > > >> > >> Signed-off-by: Krishna Kurapati <quic_kriskura@quicinc.com> > >> --- > >> arch/arm64/boot/dts/qcom/sa8295p-adp.dts | 49 ++++++++++++++++++++++++ > >> 1 file changed, 49 insertions(+) > >> > >> diff --git a/arch/arm64/boot/dts/qcom/sa8295p-adp.dts b/arch/arm64/boot/dts/qcom/sa8295p-adp.dts > >> index fd253942e5e5..6da444042f82 100644 > >> --- a/arch/arm64/boot/dts/qcom/sa8295p-adp.dts > >> +++ b/arch/arm64/boot/dts/qcom/sa8295p-adp.dts > >> @@ -9,6 +9,7 @@ > >> #include <dt-bindings/gpio/gpio.h> > >> #include <dt-bindings/regulator/qcom,rpmh-regulator.h> > >> #include <dt-bindings/spmi/spmi.h> > >> +#include <dt-bindings/pinctrl/qcom,pmic-gpio.h> > >> > >> #include "sa8540p.dtsi" > >> #include "sa8540p-pmics.dtsi" > >> @@ -584,6 +585,16 @@ &usb_1_qmpphy { > >> status = "okay"; > >> }; > >> > >> +&usb_2 { > >> + pinctrl-0 = <&usb2_en>, > >> + <&usb3_en>, > >> + <&usb4_en>, > >> + <&usb5_en>; > >> + pinctrl-names = "default"; > >> + > >> + status = "okay"; > >> +}; > >> + > >> &usb_2_hsphy0 { > >> vdda-pll-supply = <&vreg_l5a>; > >> vdda18-supply = <&vreg_l7g>; > >> @@ -636,6 +647,44 @@ &xo_board_clk { > >> > >> /* PINCTRL */ > >> > >> +&pmm8540c_gpios { > >> + usb2_en: usb2-en-state { > >> + pins = "gpio9"; > >> + function = "normal"; > >> + qcom,drive-strength = <PMIC_GPIO_STRENGTH_HIGH>; > >> + output-high; > >> + power-source = <0>; > >> + }; > >> +}; > >> + > >> +&pmm8540e_gpios { > >> + usb3_en: usb3-en-state { > >> + pins = "gpio5"; > >> + function = "normal"; > >> + qcom,drive-strength = <PMIC_GPIO_STRENGTH_HIGH>; > >> + output-high; > >> + power-source = <0>; > >> + }; > >> +}; > >> + > >> +&pmm8540g_gpios { > >> + usb4_en: usb4-en-state { > >> + pins = "gpio5"; > >> + function = "normal"; > >> + qcom,drive-strength = <PMIC_GPIO_STRENGTH_HIGH>; > >> + output-high; > >> + power-source = <0>; > >> + }; > >> + > >> + usb5_en: usb5-en-state { > >> + pins = "gpio9"; > >> + function = "normal"; > >> + qcom,drive-strength = <PMIC_GPIO_STRENGTH_HIGH>; > >> + output-high; > >> + power-source = <0>; > >> + }; > >> +}; > >> + > >> &tlmm { > >> pcie2a_default: pcie2a-default-state { > >> clkreq-n-pins { > >> -- > >> 2.34.1 > >> > >> > > > >
On 2/6/2024 6:54 PM, Dmitry Baryshkov wrote: > On Tue, 6 Feb 2024 at 14:28, Krishna Kurapati PSSNV > <quic_kriskura@quicinc.com> wrote: >> >> >> >> On 2/6/2024 5:43 PM, Dmitry Baryshkov wrote: >>> On Tue, 6 Feb 2024 at 14:03, Krishna Kurapati <quic_kriskura@quicinc.com> wrote: >>>> >>>> Enable tertiary controller for SA8295P (based on SC8280XP). >>>> Add pinctrl support for usb ports to provide VBUS to connected peripherals. >>> >>> These are not just pinctrl entries. They hide VBUS regulators. Please >>> implement them properly as corresponding vbus regulators. >>> >> >> Hi Dmitry. Apologies, can you elaborate on your comment. I thought this >> implementation was fine as Konrad reviewed it in v13 [1]. I removed his >> RB tag as I made one change of dropping "_state" in labels. > > My comment is pretty simple: if I'm not mistaken, your DT doesn't > reflect your hardware design. > You have actual VBUS regulators driven by these GPIO pins. Is this correct? > If so, you should describe them properly in the device tree rather > than describing them just as USB host's pinctrl state. > Hi Dmitry, I have very little idea about the gpio controller regulators. I will go through it and see how I can implement it. I just found this : https://www.kernel.org/doc/Documentation/devicetree/bindings/regulator/gpio-regulator.txt One query. If we model it as a regulator, do we need to add it as a supply and call regulator_enable in dwc3_qcom probe again ? Regards, Krishna,
On Thu, 8 Feb 2024 at 04:40, Krishna Kurapati PSSNV <quic_kriskura@quicinc.com> wrote: > On 2/6/2024 6:54 PM, Dmitry Baryshkov wrote: > > On Tue, 6 Feb 2024 at 14:28, Krishna Kurapati PSSNV > > <quic_kriskura@quicinc.com> wrote: > >> > >> > >> > >> On 2/6/2024 5:43 PM, Dmitry Baryshkov wrote: > >>> On Tue, 6 Feb 2024 at 14:03, Krishna Kurapati <quic_kriskura@quicinc.com> wrote: > >>>> > >>>> Enable tertiary controller for SA8295P (based on SC8280XP). > >>>> Add pinctrl support for usb ports to provide VBUS to connected peripherals. > >>> > >>> These are not just pinctrl entries. They hide VBUS regulators. Please > >>> implement them properly as corresponding vbus regulators. > >>> > >> > >> Hi Dmitry. Apologies, can you elaborate on your comment. I thought this > >> implementation was fine as Konrad reviewed it in v13 [1]. I removed his > >> RB tag as I made one change of dropping "_state" in labels. > > > > My comment is pretty simple: if I'm not mistaken, your DT doesn't > > reflect your hardware design. > > You have actual VBUS regulators driven by these GPIO pins. Is this correct? > > If so, you should describe them properly in the device tree rather > > than describing them just as USB host's pinctrl state. > > > > Hi Dmitry, > > I have very little idea about the gpio controller regulators. I will > go through it and see how I can implement it. I just found this : > https://www.kernel.org/doc/Documentation/devicetree/bindings/regulator/gpio-regulator.txt Much simpler, it can be found at Documentation/devicetree/bindings/regulator/fixed-regulator.yaml > One query. If we model it as a regulator, do we need to add it as a > supply and call regulator_enable in dwc3_qcom probe again ? Not in probe(), but yes. It needs to be enabled when the VBUS has to be powered up, when the device is initialised or switched to the host mode, and disabled when the VBUS has to be powered down, if the device is being switched to the device mode.
On 2/8/2024 10:11 AM, Dmitry Baryshkov wrote: > On Thu, 8 Feb 2024 at 04:40, Krishna Kurapati PSSNV > <quic_kriskura@quicinc.com> wrote: >> On 2/6/2024 6:54 PM, Dmitry Baryshkov wrote: >>> On Tue, 6 Feb 2024 at 14:28, Krishna Kurapati PSSNV >>> <quic_kriskura@quicinc.com> wrote: >>>> >>>> >>>> >>>> On 2/6/2024 5:43 PM, Dmitry Baryshkov wrote: >>>>> On Tue, 6 Feb 2024 at 14:03, Krishna Kurapati <quic_kriskura@quicinc.com> wrote: >>>>>> >>>>>> Enable tertiary controller for SA8295P (based on SC8280XP). >>>>>> Add pinctrl support for usb ports to provide VBUS to connected peripherals. >>>>> >>>>> These are not just pinctrl entries. They hide VBUS regulators. Please >>>>> implement them properly as corresponding vbus regulators. >>>>> >>>> >>>> Hi Dmitry. Apologies, can you elaborate on your comment. I thought this >>>> implementation was fine as Konrad reviewed it in v13 [1]. I removed his >>>> RB tag as I made one change of dropping "_state" in labels. >>> >>> My comment is pretty simple: if I'm not mistaken, your DT doesn't >>> reflect your hardware design. >>> You have actual VBUS regulators driven by these GPIO pins. Is this correct? >>> If so, you should describe them properly in the device tree rather >>> than describing them just as USB host's pinctrl state. >>> >> >> Hi Dmitry, >> >> I have very little idea about the gpio controller regulators. I will >> go through it and see how I can implement it. I just found this : >> https://www.kernel.org/doc/Documentation/devicetree/bindings/regulator/gpio-regulator.txt > > Much simpler, it can be found at > Documentation/devicetree/bindings/regulator/fixed-regulator.yaml Thanks for the reference. > >> One query. If we model it as a regulator, do we need to add it as a >> supply and call regulator_enable in dwc3_qcom probe again ? > > Not in probe(), but yes. It needs to be enabled when the VBUS has to > be powered up, when the device is initialised or switched to the host > mode, and disabled when the VBUS has to be powered down, if the device > is being switched to the device mode. > Actually since we never go to device mode, can't we just stick to this pinctrl approach and skip turning on regulator in driver ? Regards, Krishna,
On Thu, 8 Feb 2024 at 06:48, Krishna Kurapati PSSNV <quic_kriskura@quicinc.com> wrote: > > > > On 2/8/2024 10:11 AM, Dmitry Baryshkov wrote: > > On Thu, 8 Feb 2024 at 04:40, Krishna Kurapati PSSNV > > <quic_kriskura@quicinc.com> wrote: > >> On 2/6/2024 6:54 PM, Dmitry Baryshkov wrote: > >>> On Tue, 6 Feb 2024 at 14:28, Krishna Kurapati PSSNV > >>> <quic_kriskura@quicinc.com> wrote: > >>>> > >>>> > >>>> > >>>> On 2/6/2024 5:43 PM, Dmitry Baryshkov wrote: > >>>>> On Tue, 6 Feb 2024 at 14:03, Krishna Kurapati <quic_kriskura@quicinc.com> wrote: > >>>>>> > >>>>>> Enable tertiary controller for SA8295P (based on SC8280XP). > >>>>>> Add pinctrl support for usb ports to provide VBUS to connected peripherals. > >>>>> > >>>>> These are not just pinctrl entries. They hide VBUS regulators. Please > >>>>> implement them properly as corresponding vbus regulators. > >>>>> > >>>> > >>>> Hi Dmitry. Apologies, can you elaborate on your comment. I thought this > >>>> implementation was fine as Konrad reviewed it in v13 [1]. I removed his > >>>> RB tag as I made one change of dropping "_state" in labels. > >>> > >>> My comment is pretty simple: if I'm not mistaken, your DT doesn't > >>> reflect your hardware design. > >>> You have actual VBUS regulators driven by these GPIO pins. Is this correct? > >>> If so, you should describe them properly in the device tree rather > >>> than describing them just as USB host's pinctrl state. > >>> > >> > >> Hi Dmitry, > >> > >> I have very little idea about the gpio controller regulators. I will > >> go through it and see how I can implement it. I just found this : > >> https://www.kernel.org/doc/Documentation/devicetree/bindings/regulator/gpio-regulator.txt > > > > Much simpler, it can be found at > > Documentation/devicetree/bindings/regulator/fixed-regulator.yaml > > Thanks for the reference. > > > > >> One query. If we model it as a regulator, do we need to add it as a > >> supply and call regulator_enable in dwc3_qcom probe again ? > > > > Not in probe(), but yes. It needs to be enabled when the VBUS has to > > be powered up, when the device is initialised or switched to the host > > mode, and disabled when the VBUS has to be powered down, if the device > > is being switched to the device mode. > > > > Actually since we never go to device mode, can't we just stick to this > pinctrl approach and skip turning on regulator in driver ? Scroll several emails back. DT should describe the hardware. Hardware has VBUS regulators.
On 2/8/2024 10:37 AM, Dmitry Baryshkov wrote: > On Thu, 8 Feb 2024 at 06:48, Krishna Kurapati PSSNV > <quic_kriskura@quicinc.com> wrote: >> >> >> >> On 2/8/2024 10:11 AM, Dmitry Baryshkov wrote: >>> On Thu, 8 Feb 2024 at 04:40, Krishna Kurapati PSSNV >>> <quic_kriskura@quicinc.com> wrote: >>>> On 2/6/2024 6:54 PM, Dmitry Baryshkov wrote: >>>>> On Tue, 6 Feb 2024 at 14:28, Krishna Kurapati PSSNV >>>>> <quic_kriskura@quicinc.com> wrote: >>>>>> >>>>>> >>>>>> >>>>>> On 2/6/2024 5:43 PM, Dmitry Baryshkov wrote: >>>>>>> On Tue, 6 Feb 2024 at 14:03, Krishna Kurapati <quic_kriskura@quicinc.com> wrote: >>>>>>>> >>>>>>>> Enable tertiary controller for SA8295P (based on SC8280XP). >>>>>>>> Add pinctrl support for usb ports to provide VBUS to connected peripherals. >>>>>>> >>>>>>> These are not just pinctrl entries. They hide VBUS regulators. Please >>>>>>> implement them properly as corresponding vbus regulators. >>>>>>> >>>>>> >>>>>> Hi Dmitry. Apologies, can you elaborate on your comment. I thought this >>>>>> implementation was fine as Konrad reviewed it in v13 [1]. I removed his >>>>>> RB tag as I made one change of dropping "_state" in labels. >>>>> >>>>> My comment is pretty simple: if I'm not mistaken, your DT doesn't >>>>> reflect your hardware design. >>>>> You have actual VBUS regulators driven by these GPIO pins. Is this correct? >>>>> If so, you should describe them properly in the device tree rather >>>>> than describing them just as USB host's pinctrl state. >>>>> >>>> >>>> Hi Dmitry, >>>> >>>> I have very little idea about the gpio controller regulators. I will >>>> go through it and see how I can implement it. I just found this : >>>> https://www.kernel.org/doc/Documentation/devicetree/bindings/regulator/gpio-regulator.txt >>> >>> Much simpler, it can be found at >>> Documentation/devicetree/bindings/regulator/fixed-regulator.yaml >> >> Thanks for the reference. >> >>> >>>> One query. If we model it as a regulator, do we need to add it as a >>>> supply and call regulator_enable in dwc3_qcom probe again ? >>> >>> Not in probe(), but yes. It needs to be enabled when the VBUS has to >>> be powered up, when the device is initialised or switched to the host >>> mode, and disabled when the VBUS has to be powered down, if the device >>> is being switched to the device mode. >>> >> >> Actually since we never go to device mode, can't we just stick to this >> pinctrl approach and skip turning on regulator in driver ? > > Scroll several emails back. DT should describe the hardware. Hardware > has VBUS regulators. > Hi Dmitry, I dug up the schematic and I see that the gpio's we are using in this patch are actually "Enable Pins" to an external chip that provides vbus to the peripherals connected. So from the perspective of SoC, it is a GPIO and not to be represented as a regulator I believe. Regards, Krishna,
On 08/02/2024 10:07, Krishna Kurapati PSSNV wrote: >>>> >>>>> One query. If we model it as a regulator, do we need to add it as a >>>>> supply and call regulator_enable in dwc3_qcom probe again ? >>>> >>>> Not in probe(), but yes. It needs to be enabled when the VBUS has to >>>> be powered up, when the device is initialised or switched to the host >>>> mode, and disabled when the VBUS has to be powered down, if the device >>>> is being switched to the device mode. >>>> >>> >>> Actually since we never go to device mode, can't we just stick to this >>> pinctrl approach and skip turning on regulator in driver ? >> >> Scroll several emails back. DT should describe the hardware. Hardware >> has VBUS regulators. >> > > Hi Dmitry, > > I dug up the schematic and I see that the gpio's we are using in this > patch are actually "Enable Pins" to an external chip that provides vbus > to the peripherals connected. So from the perspective of SoC, it is a > GPIO and not to be represented as a regulator I believe. According to such logic nothing is a regulator... sorry, you just described regulator. Best regards, Krzysztof
On Tue, Feb 06, 2024 at 03:24:45PM +0200, Dmitry Baryshkov wrote: > On Tue, 6 Feb 2024 at 14:28, Krishna Kurapati PSSNV > <quic_kriskura@quicinc.com> wrote: > > > > > > > > On 2/6/2024 5:43 PM, Dmitry Baryshkov wrote: > > > On Tue, 6 Feb 2024 at 14:03, Krishna Kurapati <quic_kriskura@quicinc.com> wrote: > > >> > > >> Enable tertiary controller for SA8295P (based on SC8280XP). > > >> Add pinctrl support for usb ports to provide VBUS to connected peripherals. > > > > > > These are not just pinctrl entries. They hide VBUS regulators. Please > > > implement them properly as corresponding vbus regulators. > > > > > > > Hi Dmitry. Apologies, can you elaborate on your comment. I thought this > > implementation was fine as Konrad reviewed it in v13 [1]. I removed his > > RB tag as I made one change of dropping "_state" in labels. > > My comment is pretty simple: if I'm not mistaken, your DT doesn't > reflect your hardware design. > You have actual VBUS regulators driven by these GPIO pins. Is this correct? > If so, you should describe them properly in the device tree rather > than describing them just as USB host's pinctrl state. > This is correct, these gpios are wired to the enable-pin of a set of regulators providing the VBUS voltage. Please, Krishna, represent them as always-on fixed-regulators instead. Regards, Bjorn
On 2/9/2024 8:11 AM, Bjorn Andersson wrote: > On Tue, Feb 06, 2024 at 03:24:45PM +0200, Dmitry Baryshkov wrote: >> On Tue, 6 Feb 2024 at 14:28, Krishna Kurapati PSSNV >> <quic_kriskura@quicinc.com> wrote: >>> >>> >>> >>> On 2/6/2024 5:43 PM, Dmitry Baryshkov wrote: >>>> On Tue, 6 Feb 2024 at 14:03, Krishna Kurapati <quic_kriskura@quicinc.com> wrote: >>>>> >>>>> Enable tertiary controller for SA8295P (based on SC8280XP). >>>>> Add pinctrl support for usb ports to provide VBUS to connected peripherals. >>>> >>>> These are not just pinctrl entries. They hide VBUS regulators. Please >>>> implement them properly as corresponding vbus regulators. >>>> >>> >>> Hi Dmitry. Apologies, can you elaborate on your comment. I thought this >>> implementation was fine as Konrad reviewed it in v13 [1]. I removed his >>> RB tag as I made one change of dropping "_state" in labels. >> >> My comment is pretty simple: if I'm not mistaken, your DT doesn't >> reflect your hardware design. >> You have actual VBUS regulators driven by these GPIO pins. Is this correct? >> If so, you should describe them properly in the device tree rather >> than describing them just as USB host's pinctrl state. >> > > This is correct, these gpios are wired to the enable-pin of a set of > regulators providing the VBUS voltage. Please, Krishna, represent them > as always-on fixed-regulators instead. > Hi Dmitry, Krzysztof, Bjorn, Thanks for the review on this patch. Will convert the pinctrl DT's to regulator entries. Regards, Krishna,
diff --git a/arch/arm64/boot/dts/qcom/sa8295p-adp.dts b/arch/arm64/boot/dts/qcom/sa8295p-adp.dts index fd253942e5e5..6da444042f82 100644 --- a/arch/arm64/boot/dts/qcom/sa8295p-adp.dts +++ b/arch/arm64/boot/dts/qcom/sa8295p-adp.dts @@ -9,6 +9,7 @@ #include <dt-bindings/gpio/gpio.h> #include <dt-bindings/regulator/qcom,rpmh-regulator.h> #include <dt-bindings/spmi/spmi.h> +#include <dt-bindings/pinctrl/qcom,pmic-gpio.h> #include "sa8540p.dtsi" #include "sa8540p-pmics.dtsi" @@ -584,6 +585,16 @@ &usb_1_qmpphy { status = "okay"; }; +&usb_2 { + pinctrl-0 = <&usb2_en>, + <&usb3_en>, + <&usb4_en>, + <&usb5_en>; + pinctrl-names = "default"; + + status = "okay"; +}; + &usb_2_hsphy0 { vdda-pll-supply = <&vreg_l5a>; vdda18-supply = <&vreg_l7g>; @@ -636,6 +647,44 @@ &xo_board_clk { /* PINCTRL */ +&pmm8540c_gpios { + usb2_en: usb2-en-state { + pins = "gpio9"; + function = "normal"; + qcom,drive-strength = <PMIC_GPIO_STRENGTH_HIGH>; + output-high; + power-source = <0>; + }; +}; + +&pmm8540e_gpios { + usb3_en: usb3-en-state { + pins = "gpio5"; + function = "normal"; + qcom,drive-strength = <PMIC_GPIO_STRENGTH_HIGH>; + output-high; + power-source = <0>; + }; +}; + +&pmm8540g_gpios { + usb4_en: usb4-en-state { + pins = "gpio5"; + function = "normal"; + qcom,drive-strength = <PMIC_GPIO_STRENGTH_HIGH>; + output-high; + power-source = <0>; + }; + + usb5_en: usb5-en-state { + pins = "gpio9"; + function = "normal"; + qcom,drive-strength = <PMIC_GPIO_STRENGTH_HIGH>; + output-high; + power-source = <0>; + }; +}; + &tlmm { pcie2a_default: pcie2a-default-state { clkreq-n-pins {