All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tim Harvey <tharvey@gateworks.com>
To: u-boot@lists.denx.de, Joe Hershberger <joe.hershberger@ni.com>,
	Ramon Fried <rfried.dev@gmail.com>
Cc: Tim Harvey <tharvey@gateworks.com>,
	Sean Anderson <sean.anderson@seco.com>
Subject: [PATCH 2/2] net: eth-phy: prevent undesired de-assertion of phy-reset on request
Date: Tue,  1 Mar 2022 12:15:02 -0800	[thread overview]
Message-ID: <20220301201502.28026-3-tharvey@gateworks.com> (raw)
In-Reply-To: <20220301201502.28026-1-tharvey@gateworks.com>

When gpio_request_by_name allocates a gpio output it by default will
de-assert the gpio which for phy-reset will take the PHY out of reset.
As this occurs before eth_phy_reset is called to assert the reset
line it can cause undesired affects if reset timings are not properly
met.

Configure the gpio with GPIOD_IS_OUT_ACTIVE so that reset is kept active
(reset asserted) to avoid this.

Cc: Sean Anderson <sean.anderson@seco.com>
Signed-off-by: Tim Harvey <tharvey@gateworks.com>
---
 drivers/net/eth-phy-uclass.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/eth-phy-uclass.c b/drivers/net/eth-phy-uclass.c
index 1f285f7afd20..27b77444a0c5 100644
--- a/drivers/net/eth-phy-uclass.c
+++ b/drivers/net/eth-phy-uclass.c
@@ -137,7 +137,7 @@ static int eth_phy_of_to_plat(struct udevice *dev)
 	/* search "reset-gpios" in phy node */
 	ret = gpio_request_by_name(dev, "reset-gpios", 0,
 				   &uc_priv->reset_gpio,
-				   GPIOD_IS_OUT);
+				   GPIOD_IS_OUT | GPIOD_IS_OUT_ACTIVE);
 	if (ret && ret != -ENOENT)
 		return ret;
 
-- 
2.17.1


  parent reply	other threads:[~2022-03-01 20:15 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-01 20:15 [PATCH 0/2] prevent undesired de-assertion of phy-reset Tim Harvey
2022-03-01 20:15 ` [PATCH 1/2] net: fec: prevent undesired de-assertion of phy-reset on request Tim Harvey
2022-03-01 20:38   ` Joe Hershberger
2022-03-02  1:58     ` Adam Ford
2022-03-03  7:55       ` Ramon Fried
2022-04-10  5:05         ` Ramon Fried
2022-03-01 20:15 ` Tim Harvey [this message]
2022-03-01 20:38   ` [PATCH 2/2] net: eth-phy: " Joe Hershberger
2022-03-03  7:55     ` Ramon Fried
2022-04-10  5:05       ` Ramon Fried

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220301201502.28026-3-tharvey@gateworks.com \
    --to=tharvey@gateworks.com \
    --cc=joe.hershberger@ni.com \
    --cc=rfried.dev@gmail.com \
    --cc=sean.anderson@seco.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.