Message ID | 20230124184440.1421074-4-quic_bjorande@quicinc.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2316412wrn; Tue, 24 Jan 2023 10:47:15 -0800 (PST) X-Google-Smtp-Source: AMrXdXsmX42au4K5r/CmYU3NLCF7VBCQ0OnFxRHellcWkno0Qz6+Et2ygEn32scbelFNJvzZHUFV X-Received: by 2002:a17:906:fb16:b0:7c1:6d65:4718 with SMTP id lz22-20020a170906fb1600b007c16d654718mr30730399ejb.33.1674586035485; Tue, 24 Jan 2023 10:47:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674586035; cv=none; d=google.com; s=arc-20160816; b=E/PB6nbn1xKGOAUIiwl5fQt/UXLv84Hs9A23q9/dmbGLXo7TlVQ4GveXKuYyTtKMPF 2DDAO+F43leLArU6CuTw0bDa2N9Tt+1FZGLm673pbh0K1Pl/T94Qjfk5GAm8xZIgrLto LgL+utkxkvMZjZ7NQqIU/6xhR1XLH4TLrb6qgB6podAhQJMxLx3++GbXLuNApG2ofrie nSExF/dZnSKzEz1XczMpngKiHPFiOnZ1s7LargncWLGIzTyUyl1slWGpo1ohN7Xbo9xs g6cxgWc/RjSRtF4emDWTz47nv1SE2A+tA//dUpDebkh02jiiLqp/trC6fIf2/T6zZSs1 gvqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=an6GQ7C4x8r1owOs4PWQW974MIIzzFEe9T+hV8d3vd0=; b=yDTORTk10hFvu+0mNLSaaEFRzQUI5KRbd3lM/xVY3qq+5HOS8lhSFRGjiF0vhzB6vC pLjMJQTatdiTpJ2Th4dx/54O29nCCbnvd5G1nNOEOoy2YunEdQxYiL1jw5blkrvuCN/s J1iXnWRMGWMg3xe+jtTgFsIggdeeBwiLS2HPHG24sAtSjK3kZTc9gu9PSwjiEKLnKKfL q8kaCSe7D9eOrRxzk7iZR4UTKymPAJnnk0nCyuwR2ZLeO0E4wJobeDwaUDTGmS8SoOAt vyOh8IygdekMzhXbxYzvjsadNdk+uuE//B5GefVg/k7q4n+o7ztmvQIf4opjmADNVeUy wipQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=ftJrR9Mn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id fv21-20020a170907509500b0083b6e04f33esi2975944ejc.280.2023.01.24.10.46.51; Tue, 24 Jan 2023 10:47:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=ftJrR9Mn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234139AbjAXSpR (ORCPT <rfc822;rust.linux@gmail.com> + 99 others); Tue, 24 Jan 2023 13:45:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50494 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234234AbjAXSo6 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 24 Jan 2023 13:44:58 -0500 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 062AC3ABD; Tue, 24 Jan 2023 10:44:58 -0800 (PST) Received: from pps.filterd (m0279864.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 30OFDxYl030407; Tue, 24 Jan 2023 18:44:48 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=an6GQ7C4x8r1owOs4PWQW974MIIzzFEe9T+hV8d3vd0=; b=ftJrR9MnAI3cjWYuXAvyz4iMIRVJiDhyCgLJqosP/WP3P/RsqaAIh38snMOLgkyqiWVp wb0dSRTXy/8ilQDAnfMoOKrQnXc/3TqblWZeFO0wWlG5fdpPM2vQYwLJyh9KqSB7cYrY z/lZUI/DA0vjyGCz/Hep3tbqubQNUc1FYiXN4tRnTsZPxt8kO7+rdoTvCRI8hXYbAFUR 38a6QszHqhJWKHMshrdZSRBrAowLMmWcMOi9WPwYDQd0MpX4ymMTgI0cnHh4fV3blv7c z1onsJshGA9t3r7gWvGlsO2Cv7phgprWWOYSo5Uwvw8hS9dWFammvJUrnuzbcu8z+Kmb Jw== Received: from nasanppmta03.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3n89dr5n9x-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 24 Jan 2023 18:44:48 +0000 Received: from nasanex01c.na.qualcomm.com (nasanex01c.na.qualcomm.com [10.45.79.139]) by NASANPPMTA03.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 30OIildc013441 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 24 Jan 2023 18:44:47 GMT Received: from hu-bjorande-lv.qualcomm.com (10.49.16.6) by nasanex01c.na.qualcomm.com (10.45.79.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.36; Tue, 24 Jan 2023 10:44:47 -0800 From: Bjorn Andersson <quic_bjorande@quicinc.com> To: Andy Gross <agross@kernel.org>, Bjorn Andersson <andersson@kernel.org>, Konrad Dybcio <konrad.dybcio@linaro.org> CC: Liam Girdwood <lgirdwood@gmail.com>, Mark Brown <broonie@kernel.org>, Rob Herring <robh+dt@kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, <linux-kernel@vger.kernel.org>, <devicetree@vger.kernel.org>, <linux-arm-msm@vger.kernel.org> Subject: [PATCH v2 3/3] arm64: dts: qcom: sa8295p-adp: Add max20411 on i2c12 Date: Tue, 24 Jan 2023 10:44:40 -0800 Message-ID: <20230124184440.1421074-4-quic_bjorande@quicinc.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230124184440.1421074-1-quic_bjorande@quicinc.com> References: <20230124184440.1421074-1-quic_bjorande@quicinc.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.49.16.6] X-ClientProxiedBy: nalasex01c.na.qualcomm.com (10.47.97.35) To nasanex01c.na.qualcomm.com (10.45.79.139) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: 2IjXJ8kt_I3qudQasyWyp_hAF0BYR0Vw X-Proofpoint-ORIG-GUID: 2IjXJ8kt_I3qudQasyWyp_hAF0BYR0Vw X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.930,Hydra:6.0.562,FMLib:17.11.122.1 definitions=2023-01-24_13,2023-01-24_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 clxscore=1015 priorityscore=1501 impostorscore=0 suspectscore=0 spamscore=0 adultscore=0 bulkscore=0 mlxlogscore=945 phishscore=0 malwarescore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2301240171 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1755930726959208506?= X-GMAIL-MSGID: =?utf-8?q?1755930726959208506?= |
Series |
regulator: Add Maxim MAX20411 support
|
|
Commit Message
Bjorn Andersson
Jan. 24, 2023, 6:44 p.m. UTC
From: Bjorn Andersson <bjorn.andersson@linaro.org> The SA8295P ADP has a Maxim max20411 step-down converter on i2c12. Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org> Signed-off-by: Bjorn Andersson <quic_bjorande@quicinc.com> --- Changes since v1: - i2c node had changed name arch/arm64/boot/dts/qcom/sa8295p-adp.dts | 41 ++++++++++++++++++++++++ 1 file changed, 41 insertions(+)
Comments
On Tue, Jan 24, 2023 at 10:44:40AM -0800, Bjorn Andersson wrote: > From: Bjorn Andersson <bjorn.andersson@linaro.org> > > The SA8295P ADP has a Maxim max20411 step-down converter on i2c12. > > Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org> > Signed-off-by: Bjorn Andersson <quic_bjorande@quicinc.com> > --- > > Changes since v1: > - i2c node had changed name > > arch/arm64/boot/dts/qcom/sa8295p-adp.dts | 41 ++++++++++++++++++++++++ > 1 file changed, 41 insertions(+) I realized today this has to do with the comment over at: https://lore.kernel.org/all/30166208-ba9d-e6e6-1cd2-807a80536052@quicinc.com/ and I just didn't realize that the schematic I've started looking at black boxes the SOM/SIP which holds this... darn I thought I could see more than I could :( I took a similiar patch for a spin on sa8540p-ride (which I'll later submit), and things worked fine (I'm not really consuming the output of the regulator mind you). Downstream devicetree indicates all of this looks ok except for possibly the below comment: > > diff --git a/arch/arm64/boot/dts/qcom/sa8295p-adp.dts b/arch/arm64/boot/dts/qcom/sa8295p-adp.dts > index bb4270e8f551..642000d95812 100644 > --- a/arch/arm64/boot/dts/qcom/sa8295p-adp.dts > +++ b/arch/arm64/boot/dts/qcom/sa8295p-adp.dts > @@ -266,6 +266,27 @@ &dispcc1 { > status = "okay"; > }; > > +&i2c12 { > + pinctrl-names = "default"; > + pinctrl-0 = <&i2c12_state>; > + > + status = "okay"; > + > + vdd_gfx: regulator@39 { > + compatible = "maxim,max20411"; > + reg = <0x39>; > + > + regulator-name = "vdd_gfx"; > + regulator-min-microvolt = <800000>; Is there a reason you chose this instead of the 500000 I see downstream? > + regulator-max-microvolt = <968750>; Likewise, I see in this brief description of the regulator that the upper bound is higher than this (1.275 V). I am not sure if the values in the devicetree are supposed to describe the min/max of the regulator itself, or of what your board can really handle/needs (the latter I guess makes more sense since you wouldn't want to accidentally request a current draw that could melt something.. that can be fun). I do see you've got that min/max in the driver itself (now that I peaked at that patch). https://www.analog.com/en/products/MAX20411.html#product-overview For what it is worth, I also see a SIP document that states vdd_gfx min/max is 0.56/1.03 V, which is ultimately what you'd feed this into. The downstream devicetree uses the max value you provide though. No idea how much faith I should put into the SIP document's bounds, or downstream, but I thought I should at least highlight them. Thanks, Andrew
On 26.01.2023 23:54, Andrew Halaney wrote: > On Tue, Jan 24, 2023 at 10:44:40AM -0800, Bjorn Andersson wrote: >> From: Bjorn Andersson <bjorn.andersson@linaro.org> >> >> The SA8295P ADP has a Maxim max20411 step-down converter on i2c12. >> >> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org> >> Signed-off-by: Bjorn Andersson <quic_bjorande@quicinc.com> >> --- >> >> Changes since v1: >> - i2c node had changed name >> >> arch/arm64/boot/dts/qcom/sa8295p-adp.dts | 41 ++++++++++++++++++++++++ >> 1 file changed, 41 insertions(+) > > I realized today this has to do with the comment over at: > > https://lore.kernel.org/all/30166208-ba9d-e6e6-1cd2-807a80536052@quicinc.com/ > > and I just didn't realize that the schematic I've started looking at > black boxes the SOM/SIP which holds this... darn I thought I could see > more than I could :( > > I took a similiar patch for a spin on sa8540p-ride (which I'll later > submit), and things worked fine (I'm not really consuming the output of > the regulator mind you). > > Downstream devicetree indicates all of this looks ok except for possibly > the below comment: > >> >> diff --git a/arch/arm64/boot/dts/qcom/sa8295p-adp.dts b/arch/arm64/boot/dts/qcom/sa8295p-adp.dts >> index bb4270e8f551..642000d95812 100644 >> --- a/arch/arm64/boot/dts/qcom/sa8295p-adp.dts >> +++ b/arch/arm64/boot/dts/qcom/sa8295p-adp.dts >> @@ -266,6 +266,27 @@ &dispcc1 { >> status = "okay"; >> }; >> >> +&i2c12 { >> + pinctrl-names = "default"; >> + pinctrl-0 = <&i2c12_state>; >> + >> + status = "okay"; >> + >> + vdd_gfx: regulator@39 { >> + compatible = "maxim,max20411"; >> + reg = <0x39>; >> + >> + regulator-name = "vdd_gfx"; >> + regulator-min-microvolt = <800000>; > > Is there a reason you chose this instead of the 500000 I see downstream? > >> + regulator-max-microvolt = <968750>; > > Likewise, I see in this brief description of the regulator > that the upper bound is higher than this (1.275 V). I am not sure if > the values in the devicetree are supposed to describe the > min/max of the regulator itself, or of what your board can really > handle/needs (the latter I guess makes more sense since you wouldn't want to > accidentally request a current draw that could melt something.. that can > be fun). I do see you've got that min/max in the driver itself (now that > I peaked at that patch). Yes, your suspicions are correct and the DT sets the actual ranges for the voltage regulators on this specific board while the hardware reachable ranges are defined in the .c driver. Konrad > > https://www.analog.com/en/products/MAX20411.html#product-overview > > For what it is worth, I also see a SIP document that states vdd_gfx min/max > is 0.56/1.03 V, which is ultimately what you'd feed this into. The > downstream devicetree uses the max value you provide though. > > No idea how much faith I should put into the SIP document's bounds, or > downstream, but I thought I should at least highlight them. > > Thanks, > Andrew >
On Fri, Jan 27, 2023 at 12:35:37AM +0100, Konrad Dybcio wrote: > > > On 26.01.2023 23:54, Andrew Halaney wrote: > > On Tue, Jan 24, 2023 at 10:44:40AM -0800, Bjorn Andersson wrote: > >> From: Bjorn Andersson <bjorn.andersson@linaro.org> > >> > >> The SA8295P ADP has a Maxim max20411 step-down converter on i2c12. > >> > >> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org> > >> Signed-off-by: Bjorn Andersson <quic_bjorande@quicinc.com> > >> --- > >> > >> Changes since v1: > >> - i2c node had changed name > >> > >> arch/arm64/boot/dts/qcom/sa8295p-adp.dts | 41 ++++++++++++++++++++++++ > >> 1 file changed, 41 insertions(+) > > > > I realized today this has to do with the comment over at: > > > > https://lore.kernel.org/all/30166208-ba9d-e6e6-1cd2-807a80536052@quicinc.com/ > > > > and I just didn't realize that the schematic I've started looking at > > black boxes the SOM/SIP which holds this... darn I thought I could see > > more than I could :( > > > > I took a similiar patch for a spin on sa8540p-ride (which I'll later > > submit), and things worked fine (I'm not really consuming the output of > > the regulator mind you). > > > > Downstream devicetree indicates all of this looks ok except for possibly > > the below comment: > > > >> > >> diff --git a/arch/arm64/boot/dts/qcom/sa8295p-adp.dts b/arch/arm64/boot/dts/qcom/sa8295p-adp.dts > >> index bb4270e8f551..642000d95812 100644 > >> --- a/arch/arm64/boot/dts/qcom/sa8295p-adp.dts > >> +++ b/arch/arm64/boot/dts/qcom/sa8295p-adp.dts > >> @@ -266,6 +266,27 @@ &dispcc1 { > >> status = "okay"; > >> }; > >> > >> +&i2c12 { > >> + pinctrl-names = "default"; > >> + pinctrl-0 = <&i2c12_state>; > >> + > >> + status = "okay"; > >> + > >> + vdd_gfx: regulator@39 { > >> + compatible = "maxim,max20411"; > >> + reg = <0x39>; > >> + > >> + regulator-name = "vdd_gfx"; > >> + regulator-min-microvolt = <800000>; > > > > Is there a reason you chose this instead of the 500000 I see downstream? > > > >> + regulator-max-microvolt = <968750>; > > > > Likewise, I see in this brief description of the regulator > > that the upper bound is higher than this (1.275 V). I am not sure if > > the values in the devicetree are supposed to describe the > > min/max of the regulator itself, or of what your board can really > > handle/needs (the latter I guess makes more sense since you wouldn't want to > > accidentally request a current draw that could melt something.. that can > > be fun). I do see you've got that min/max in the driver itself (now that > > I peaked at that patch). > Yes, your suspicions are correct and the DT sets the actual ranges > for the voltage regulators on this specific board while the > hardware reachable ranges are defined in the .c driver. > > Konrad Thanks Konrad, then I think: Reviewed-by: Andrew Halaney <ahalaney@redhat.com> Tested-by: Andrew Halaney <ahalaney@redhat.com> is appropriate since things are within range on all accounts. I would appreciate an explanation on the current min/max values though if possible!
On Tue, Jan 24, 2023 at 10:44:40AM -0800, Bjorn Andersson wrote: > From: Bjorn Andersson <bjorn.andersson@linaro.org> > > The SA8295P ADP has a Maxim max20411 step-down converter on i2c12. > > Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org> > Signed-off-by: Bjorn Andersson <quic_bjorande@quicinc.com> > --- > > Changes since v1: > - i2c node had changed name > > arch/arm64/boot/dts/qcom/sa8295p-adp.dts | 41 ++++++++++++++++++++++++ > 1 file changed, 41 insertions(+) > > diff --git a/arch/arm64/boot/dts/qcom/sa8295p-adp.dts b/arch/arm64/boot/dts/qcom/sa8295p-adp.dts > index bb4270e8f551..642000d95812 100644 > --- a/arch/arm64/boot/dts/qcom/sa8295p-adp.dts > +++ b/arch/arm64/boot/dts/qcom/sa8295p-adp.dts > @@ -266,6 +266,27 @@ &dispcc1 { > status = "okay"; > }; > > +&i2c12 { > + pinctrl-names = "default"; > + pinctrl-0 = <&i2c12_state>; > + > + status = "okay"; > + > + vdd_gfx: regulator@39 { Nit: Should the label be named 'vreg_gfx' (or 'vreg_vdd_gfx)') for consistency with rest of the file? > + compatible = "maxim,max20411"; > + reg = <0x39>; > + > + regulator-name = "vdd_gfx"; > + regulator-min-microvolt = <800000>; > + regulator-max-microvolt = <968750>; > + > + enable-gpios = <&pmm8540a_gpios 2 GPIO_ACTIVE_HIGH>; > + > + pinctrl-names = "default"; > + pinctrl-0 = <&vdd_gfx_enable_state>; > + }; > +}; > + > &mdss0 { > status = "okay"; > }; > @@ -476,6 +497,10 @@ &pcie4_phy { > status = "okay"; > }; > > +&qup1 { > + status = "okay"; > +}; > + > &qup2 { > status = "okay"; > }; > @@ -636,7 +661,23 @@ &xo_board_clk { > > /* PINCTRL */ > > +&pmm8540a_gpios { > + vdd_gfx_enable_state: vdd-gfx-enable-state { For consistency with the rest of sc8280xp, can you rename this vdd_gfx_en: vdd-gfx-en-state { (i.e. drop the 'state' from the label and shorten 'enable')? > + pins = "gpio2"; > + function = "normal"; > + output-enable; > + }; > +}; > + > &tlmm { > + i2c12_state: i2c12-state { Similar here, this should be i2c12_default: i2c12-default-state { > + pins = "gpio0", "gpio1"; > + function = "qup12"; > + And this newline can be removed. > + drive-strength = <2>; > + bias-pull-up; > + }; > + > pcie2a_default: pcie2a-default-state { > clkreq-n-pins { > pins = "gpio142"; Johan
On Fri, Jan 27, 2023 at 10:55:21AM +0100, Johan Hovold wrote: > On Tue, Jan 24, 2023 at 10:44:40AM -0800, Bjorn Andersson wrote: > > From: Bjorn Andersson <bjorn.andersson@linaro.org> > > > > The SA8295P ADP has a Maxim max20411 step-down converter on i2c12. > > > > Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org> > > Signed-off-by: Bjorn Andersson <quic_bjorande@quicinc.com> > > --- > > > > Changes since v1: > > - i2c node had changed name > > > > arch/arm64/boot/dts/qcom/sa8295p-adp.dts | 41 ++++++++++++++++++++++++ > > 1 file changed, 41 insertions(+) > > > > diff --git a/arch/arm64/boot/dts/qcom/sa8295p-adp.dts b/arch/arm64/boot/dts/qcom/sa8295p-adp.dts > > index bb4270e8f551..642000d95812 100644 > > --- a/arch/arm64/boot/dts/qcom/sa8295p-adp.dts > > +++ b/arch/arm64/boot/dts/qcom/sa8295p-adp.dts > > @@ -266,6 +266,27 @@ &dispcc1 { > > status = "okay"; > > }; > > > > +&i2c12 { > > + pinctrl-names = "default"; > > + pinctrl-0 = <&i2c12_state>; > > + > > + status = "okay"; > > + > > + vdd_gfx: regulator@39 { > > Nit: Should the label be named 'vreg_gfx' (or 'vreg_vdd_gfx)') for > consistency with rest of the file? > I will investigate what the appropriate name is, consistency would be nice though. > > + compatible = "maxim,max20411"; > > + reg = <0x39>; > > + > > + regulator-name = "vdd_gfx"; > > + regulator-min-microvolt = <800000>; > > + regulator-max-microvolt = <968750>; > > + > > + enable-gpios = <&pmm8540a_gpios 2 GPIO_ACTIVE_HIGH>; > > + > > + pinctrl-names = "default"; > > + pinctrl-0 = <&vdd_gfx_enable_state>; > > + }; > > +}; > > + > > &mdss0 { > > status = "okay"; > > }; > > @@ -476,6 +497,10 @@ &pcie4_phy { > > status = "okay"; > > }; > > > > +&qup1 { > > + status = "okay"; > > +}; > > + > > &qup2 { > > status = "okay"; > > }; > > @@ -636,7 +661,23 @@ &xo_board_clk { > > > > /* PINCTRL */ > > > > +&pmm8540a_gpios { > > + vdd_gfx_enable_state: vdd-gfx-enable-state { > > For consistency with the rest of sc8280xp, can you rename this > > vdd_gfx_en: vdd-gfx-en-state { > > (i.e. drop the 'state' from the label and shorten 'enable')? > Will do. > > + pins = "gpio2"; > > + function = "normal"; > > + output-enable; > > + }; > > +}; > > + > > &tlmm { > > + i2c12_state: i2c12-state { > > Similar here, this should be > > i2c12_default: i2c12-default-state { > Sounds reasonable. > > + pins = "gpio0", "gpio1"; > > + function = "qup12"; > > + > > And this newline can be removed. > Sure > > + drive-strength = <2>; > > + bias-pull-up; > > + }; > > + > > pcie2a_default: pcie2a-default-state { > > clkreq-n-pins { > > pins = "gpio142"; > > Johan Thanks Johan, Bjorn
On Thu, Jan 26, 2023 at 05:43:54PM -0600, Andrew Halaney wrote: > On Fri, Jan 27, 2023 at 12:35:37AM +0100, Konrad Dybcio wrote: > > > > > > On 26.01.2023 23:54, Andrew Halaney wrote: > > > On Tue, Jan 24, 2023 at 10:44:40AM -0800, Bjorn Andersson wrote: > > >> From: Bjorn Andersson <bjorn.andersson@linaro.org> > > >> > > >> The SA8295P ADP has a Maxim max20411 step-down converter on i2c12. > > >> > > >> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org> > > >> Signed-off-by: Bjorn Andersson <quic_bjorande@quicinc.com> > > >> --- > > >> > > >> Changes since v1: > > >> - i2c node had changed name > > >> > > >> arch/arm64/boot/dts/qcom/sa8295p-adp.dts | 41 ++++++++++++++++++++++++ > > >> 1 file changed, 41 insertions(+) > > > > > > I realized today this has to do with the comment over at: > > > > > > https://lore.kernel.org/all/30166208-ba9d-e6e6-1cd2-807a80536052@quicinc.com/ > > > > > > and I just didn't realize that the schematic I've started looking at > > > black boxes the SOM/SIP which holds this... darn I thought I could see > > > more than I could :( > > > > > > I took a similiar patch for a spin on sa8540p-ride (which I'll later > > > submit), and things worked fine (I'm not really consuming the output of > > > the regulator mind you). > > > > > > Downstream devicetree indicates all of this looks ok except for possibly > > > the below comment: > > > > > >> > > >> diff --git a/arch/arm64/boot/dts/qcom/sa8295p-adp.dts b/arch/arm64/boot/dts/qcom/sa8295p-adp.dts > > >> index bb4270e8f551..642000d95812 100644 > > >> --- a/arch/arm64/boot/dts/qcom/sa8295p-adp.dts > > >> +++ b/arch/arm64/boot/dts/qcom/sa8295p-adp.dts > > >> @@ -266,6 +266,27 @@ &dispcc1 { > > >> status = "okay"; > > >> }; > > >> > > >> +&i2c12 { > > >> + pinctrl-names = "default"; > > >> + pinctrl-0 = <&i2c12_state>; > > >> + > > >> + status = "okay"; > > >> + > > >> + vdd_gfx: regulator@39 { > > >> + compatible = "maxim,max20411"; > > >> + reg = <0x39>; > > >> + > > >> + regulator-name = "vdd_gfx"; > > >> + regulator-min-microvolt = <800000>; > > > > > > Is there a reason you chose this instead of the 500000 I see downstream? > > > > > >> + regulator-max-microvolt = <968750>; > > > > > > Likewise, I see in this brief description of the regulator > > > that the upper bound is higher than this (1.275 V). I am not sure if > > > the values in the devicetree are supposed to describe the > > > min/max of the regulator itself, or of what your board can really > > > handle/needs (the latter I guess makes more sense since you wouldn't want to > > > accidentally request a current draw that could melt something.. that can > > > be fun). I do see you've got that min/max in the driver itself (now that > > > I peaked at that patch). > > Yes, your suspicions are correct and the DT sets the actual ranges > > for the voltage regulators on this specific board while the > > hardware reachable ranges are defined in the .c driver. > > > > Konrad > > Thanks Konrad, then I think: > > Reviewed-by: Andrew Halaney <ahalaney@redhat.com> > Tested-by: Andrew Halaney <ahalaney@redhat.com> > > is appropriate since things are within range on all accounts. I would > appreciate an explanation on the current min/max values though if possible! > I will add a line about the range as I resubmit the patch. Thanks, Bjorn
diff --git a/arch/arm64/boot/dts/qcom/sa8295p-adp.dts b/arch/arm64/boot/dts/qcom/sa8295p-adp.dts index bb4270e8f551..642000d95812 100644 --- a/arch/arm64/boot/dts/qcom/sa8295p-adp.dts +++ b/arch/arm64/boot/dts/qcom/sa8295p-adp.dts @@ -266,6 +266,27 @@ &dispcc1 { status = "okay"; }; +&i2c12 { + pinctrl-names = "default"; + pinctrl-0 = <&i2c12_state>; + + status = "okay"; + + vdd_gfx: regulator@39 { + compatible = "maxim,max20411"; + reg = <0x39>; + + regulator-name = "vdd_gfx"; + regulator-min-microvolt = <800000>; + regulator-max-microvolt = <968750>; + + enable-gpios = <&pmm8540a_gpios 2 GPIO_ACTIVE_HIGH>; + + pinctrl-names = "default"; + pinctrl-0 = <&vdd_gfx_enable_state>; + }; +}; + &mdss0 { status = "okay"; }; @@ -476,6 +497,10 @@ &pcie4_phy { status = "okay"; }; +&qup1 { + status = "okay"; +}; + &qup2 { status = "okay"; }; @@ -636,7 +661,23 @@ &xo_board_clk { /* PINCTRL */ +&pmm8540a_gpios { + vdd_gfx_enable_state: vdd-gfx-enable-state { + pins = "gpio2"; + function = "normal"; + output-enable; + }; +}; + &tlmm { + i2c12_state: i2c12-state { + pins = "gpio0", "gpio1"; + function = "qup12"; + + drive-strength = <2>; + bias-pull-up; + }; + pcie2a_default: pcie2a-default-state { clkreq-n-pins { pins = "gpio142";