Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp6544561rwp; Tue, 18 Jul 2023 01:57:13 -0700 (PDT) X-Google-Smtp-Source: APBJJlENFD31soa7tQMxCK87c1/GylJ2uu0jsjuJ0s4UH1QLsQcm3BYerDxtj9DK1kGywrgXKvfv X-Received: by 2002:a05:6a00:849:b0:680:d00c:b164 with SMTP id q9-20020a056a00084900b00680d00cb164mr20594353pfk.34.1689670632696; Tue, 18 Jul 2023 01:57:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689670632; cv=none; d=google.com; s=arc-20160816; b=mBniGQ2CoHQ+2i6o8x/QiIqZZi3AUVNBRPPXKxOBwcrKp+9Wj65TZjJB4eRHIYpu/G VT/Yq3UfKNYN/6qllt79yLFt31U/pDp3Ee2BRkhbmnzg5I7rC3elucaAWph1sGXUUFGe zHlGK4tOjzr6TwHJWf7/xfA0kgVVw/CiPCjwKPNmsYREwRZ65FF/6VNfAfKc0L2nYBIg Kk2iuQMW0yPZfdanVd2gdV2DcAsNoADO3dUk0RPsqO+s2adrh62rueb6s/hcLsthFrH/ tEx4RoIsrL3MYCF3WlAcwyBXC+GgQNlAA2p6mzwDt4YU/Smrao4O2XmYj2gg7lw4lTp4 T9Vg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=KjIPNC9LheY1huYP2OsrIp5zKyRHQOQ+PTzgB72titA=; fh=JAekWGGAN/5nNRzEdl3j8uZg1u4oOZCz9QGYctGnai0=; b=H+o8k0azj8ahqnWMPzu8gZn3ChBKyMX9t0evqxe4lstDl4Ju39r2JSfkjMuNgbE3kv 0jAnTxLdbgCSfzWhvkQhz7Z0uWNXmyyoCyX2lqE5IZ3cUP9++PYWH9V6oP6yd1H+6YBQ brE50U96bJAUsShmNqwKzoaDwxqQpM3gfF46hyoIOz0Kj41cuxtDjmMTcrDZZMKjXwS8 A6BZ9QscuTDHYcOzugz4HPbpAPauoGN3wHmBO0gKxwXg4HAaTRwFx6lNWjALAwJJ4lJl Kw7/UqT6iZZzsrS9Psy0UVBZilYZnKv4uP3+AxOjr3mC0El3bTJ6gJKLQRnJjCeoawsQ gt+w== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c4-20020a056a00248400b00665c24182bcsi1298348pfv.219.2023.07.18.01.57.00; Tue, 18 Jul 2023 01:57:12 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231805AbjGRIfj (ORCPT + 99 others); Tue, 18 Jul 2023 04:35:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53528 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231843AbjGRIfe (ORCPT ); Tue, 18 Jul 2023 04:35:34 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8207F1726 for ; Tue, 18 Jul 2023 01:35:31 -0700 (PDT) Received: from ptx.hi.pengutronix.de ([2001:67c:670:100:1d::c0]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qLgAn-00036C-J1; Tue, 18 Jul 2023 10:35:09 +0200 Received: from mfe by ptx.hi.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1qLgAi-0004Wq-Q5; Tue, 18 Jul 2023 10:35:04 +0200 Date: Tue, 18 Jul 2023 10:35:04 +0200 From: Marco Felsch To: Andrew Lunn Cc: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, peppe.cavallaro@st.com, alexandre.torgue@foss.st.com, joabreu@synopsys.com, mcoquelin.stm32@gmail.com, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: Re: [PATCH net-next 2/2] net: stmmac: platform: add support for phy-supply Message-ID: <20230718083504.r3znx6iixtq7vkjt@pengutronix.de> References: <20230717164307.2868264-1-m.felsch@pengutronix.de> <20230717164307.2868264-2-m.felsch@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180716 X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c0 X-SA-Exim-Mail-From: mfe@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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: X-Mailing-List: linux-kernel@vger.kernel.org On 23-07-18, Andrew Lunn wrote: > On Mon, Jul 17, 2023 at 06:43:07PM +0200, Marco Felsch wrote: > > Add generic phy-supply handling support to control the phy regulator. > > Use the common stmmac_platform code path so all drivers using > > stmmac_probe_config_dt() and stmmac_pltfr_pm_ops can use it. > > > > Signed-off-by: Marco Felsch > > --- > > .../ethernet/stmicro/stmmac/stmmac_platform.c | 51 +++++++++++++++++++ > > include/linux/stmmac.h | 1 + > > 2 files changed, 52 insertions(+) > > > > diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c > > index eb0b2898daa3d..6193d42b53fb7 100644 > > --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c > > +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c > > @@ -10,6 +10,7 @@ > > > > #include > > #include > > +#include > > #include > > #include > > #include > > @@ -423,6 +424,15 @@ stmmac_probe_config_dt(struct platform_device *pdev, u8 *mac) > > if (plat->interface < 0) > > plat->interface = plat->phy_interface; > > > > + /* Optional regulator for PHY */ > > + plat->phy_regulator = devm_regulator_get_optional(&pdev->dev, "phy"); > > + if (IS_ERR(plat->phy_regulator)) { > > + if (PTR_ERR(plat->phy_regulator) == -EPROBE_DEFER) > > + return ERR_CAST(plat->phy_regulator); > > + dev_info(&pdev->dev, "No regulator found\n"); > > + plat->phy_regulator = NULL; > > + } > > + > > So this gets the regulator. When do you actually turn it on? During the suspend/resume logic like the rockchip, sun8i platform integrations did. Regards, Marco > > Andrew >