From: Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>
To: <davem@davemloft.net>, <edumazet@google.com>, <kuba@kernel.org>,
<pabeni@redhat.com>, <robh@kernel.org>, <krzk+dt@kernel.org>,
<conor+dt@kernel.org>, <michal.simek@amd.com>,
<harini.katakam@amd.com>
Cc: <netdev@vger.kernel.org>, <devicetree@vger.kernel.org>,
<linux-kernel@vger.kernel.org>,
<linux-arm-kernel@lists.infradead.org>, <git@amd.com>,
Abin Joseph <abin.joseph@amd.com>,
Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>
Subject: [PATCH net-next v2 3/3] net: emaclite: Adopt clock support
Date: Mon, 7 Oct 2024 20:36:03 +0530 [thread overview]
Message-ID: <1728313563-722267-4-git-send-email-radhey.shyam.pandey@amd.com> (raw)
In-Reply-To: <1728313563-722267-1-git-send-email-radhey.shyam.pandey@amd.com>
From: Abin Joseph <abin.joseph@amd.com>
Adapt to use the clock framework. Add s_axi_aclk clock from the processor
bus clock domain and make clk optional to keep DTB backward compatibility.
Signed-off-by: Abin Joseph <abin.joseph@amd.com>
Signed-off-by: Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>
---
changes for v2:
- None.
---
drivers/net/ethernet/xilinx/xilinx_emaclite.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/net/ethernet/xilinx/xilinx_emaclite.c b/drivers/net/ethernet/xilinx/xilinx_emaclite.c
index 418587942527..fe901af5ddfa 100644
--- a/drivers/net/ethernet/xilinx/xilinx_emaclite.c
+++ b/drivers/net/ethernet/xilinx/xilinx_emaclite.c
@@ -7,6 +7,7 @@
* Copyright (c) 2007 - 2013 Xilinx, Inc.
*/
+#include <linux/clk.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/uaccess.h>
@@ -1091,6 +1092,7 @@ static int xemaclite_of_probe(struct platform_device *ofdev)
struct net_device *ndev = NULL;
struct net_local *lp = NULL;
struct device *dev = &ofdev->dev;
+ struct clk *clkin;
int rc = 0;
@@ -1127,6 +1129,12 @@ static int xemaclite_of_probe(struct platform_device *ofdev)
lp->tx_ping_pong = get_bool(ofdev, "xlnx,tx-ping-pong");
lp->rx_ping_pong = get_bool(ofdev, "xlnx,rx-ping-pong");
+ clkin = devm_clk_get_optional_enabled(&ofdev->dev, NULL);
+ if (IS_ERR(clkin)) {
+ return dev_err_probe(&ofdev->dev, PTR_ERR(clkin),
+ "Failed to get and enable clock from Device Tree\n");
+ }
+
rc = of_get_ethdev_address(ofdev->dev.of_node, ndev);
if (rc) {
dev_warn(dev, "No MAC address found, using random\n");
--
2.34.1
next prev parent reply other threads:[~2024-10-07 15:14 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-07 15:06 [PATCH net-next v2 0/3] net: xilinx: emaclite: Adopt clock support Radhey Shyam Pandey
2024-10-07 15:06 ` [PATCH net-next v2 1/3] dt-bindings: net: emaclite: Add " Radhey Shyam Pandey
2024-10-07 16:58 ` Conor Dooley
2024-10-07 15:06 ` [PATCH net-next v2 2/3] net: emaclite: Replace alloc_etherdev() with devm_alloc_etherdev() Radhey Shyam Pandey
2024-10-07 15:06 ` Radhey Shyam Pandey [this message]
2024-10-08 3:42 ` [PATCH net-next v2 3/3] net: emaclite: Adopt clock support Kalesh Anakkur Purayil
2024-10-08 14:08 ` Pandey, Radhey Shyam
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=1728313563-722267-4-git-send-email-radhey.shyam.pandey@amd.com \
--to=radhey.shyam.pandey@amd.com \
--cc=abin.joseph@amd.com \
--cc=conor+dt@kernel.org \
--cc=davem@davemloft.net \
--cc=devicetree@vger.kernel.org \
--cc=edumazet@google.com \
--cc=git@amd.com \
--cc=harini.katakam@amd.com \
--cc=krzk+dt@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=michal.simek@amd.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=robh@kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox