All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ramón N.Rodriguez" <ramon.nordin.rodriguez@ferroamp.se>
To: Andrew Lunn <andrew@lunn.ch>,
	Heiner Kallweit <hkallweit1@gmail.com>,
	Russell King <linux@armlinux.org.uk>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: "Ramón N.Rodriguez" <ramon.nordin.rodriguez@ferroamp.se>
Subject: [PATCH 1/3] net: microchip_t1s: refactor reset functionality
Date: Mon, 27 Nov 2023 11:40:43 +0100	[thread overview]
Message-ID: <20231127104045.96722-2-ramon.nordin.rodriguez@ferroamp.se> (raw)
In-Reply-To: <20231127104045.96722-1-ramon.nordin.rodriguez@ferroamp.se>

From: Ramón Nordin Rodriguez <ramon.nordin.rodriguez@ferroamp.se>

This commit moves the reset functionality for lan867x from the revb1
init function to a separate function. The intention with this minor
refactor is to prepare for adding support for lan867x rev C1.

Signed-off-by: Ramón Nordin Rodriguez <ramon.nordin.rodriguez@ferroamp.se>
---
 drivers/net/phy/microchip_t1s.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/drivers/net/phy/microchip_t1s.c b/drivers/net/phy/microchip_t1s.c
index 534ca7d1b061..ace2bf35a18a 100644
--- a/drivers/net/phy/microchip_t1s.c
+++ b/drivers/net/phy/microchip_t1s.c
@@ -213,7 +213,7 @@ static int lan865x_revb0_config_init(struct phy_device *phydev)
 	return lan865x_setup_cfgparam(phydev);
 }
 
-static int lan867x_revb1_config_init(struct phy_device *phydev)
+static int lan867x_wait_for_reset_complete(struct phy_device *phydev)
 {
 	int err;
 
@@ -234,6 +234,16 @@ static int lan867x_revb1_config_init(struct phy_device *phydev)
 			return -ENODEV;
 		}
 	}
+	return 0;
+}
+
+static int lan867x_revb1_config_init(struct phy_device *phydev)
+{
+	int err;
+
+	err = lan867x_wait_for_reset_complete(phydev);
+	if (err)
+		return err;
 
 	/* Reference to AN1699
 	 * https://ww1.microchip.com/downloads/aemDocuments/documents/AIS/ProductDocuments/SupportingCollateral/AN-LAN8670-1-2-config-60001699.pdf
-- 
2.40.1


  reply	other threads:[~2023-11-27 10:41 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-27 10:40 [PATCH 0/3] net: microchip_t1s: additional phy support and collision detect handling Ramón N.Rodriguez
2023-11-27 10:40 ` Ramón N.Rodriguez [this message]
2023-11-27 13:27   ` [PATCH 1/3] net: microchip_t1s: refactor reset functionality Andrew Lunn
2023-11-27 10:40 ` [PATCH 2/3] net: microchip_t1s: add support for LAN867x Rev.C1 Ramón N.Rodriguez
2023-11-27 13:37   ` Andrew Lunn
2023-11-27 14:02     ` Ramón Nordin Rodriguez
2023-12-05 10:20     ` Félix Piédallu
2023-12-06 20:58       ` Ramón Nordin Rodriguez
2023-11-27 10:40 ` [PATCH 3/3] net: microchip_t1s: conditional collision detection Ramón N.Rodriguez
2023-11-27 16:00   ` Parthiban.Veerasooran
2023-11-27 16:32     ` Ramón Nordin Rodriguez
2023-11-28  6:52       ` Parthiban.Veerasooran
2023-11-28  9:18         ` Ramón Nordin Rodriguez
2023-11-27 13:58 ` [PATCH 0/3] net: microchip_t1s: additional phy support and collision detect handling Andrew Lunn
2023-11-27 15:30   ` Ramón Nordin Rodriguez
2023-11-27 16:03     ` Andrew Lunn
2023-11-28  8:57       ` Ramón Nordin Rodriguez
2023-12-10 12:10       ` Ramón Nordin Rodriguez
2023-12-11 13:54         ` Andrew Lunn

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=20231127104045.96722-2-ramon.nordin.rodriguez@ferroamp.se \
    --to=ramon.nordin.rodriguez@ferroamp.se \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=hkallweit1@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    /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.