From: "Niklas Söderlund" <niklas.soderlund+renesas@ragnatech.se>
To: "David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Richard Cochran <richardcochran@gmail.com>,
netdev@vger.kernel.org
Cc: linux-renesas-soc@vger.kernel.org,
"Niklas Söderlund" <niklas.soderlund+renesas@ragnatech.se>
Subject: [net-next v3 5/5] net: ethernet: renesas: rcar_gen4_ptp: Break out to module
Date: Tue, 21 Nov 2023 16:53:06 +0100 [thread overview]
Message-ID: <20231121155306.515446-6-niklas.soderlund+renesas@ragnatech.se> (raw)
In-Reply-To: <20231121155306.515446-1-niklas.soderlund+renesas@ragnatech.se>
The Gen4 gPTP support will be shared between the existing Renesas
Ethernet Switch driver and the upcoming Renesas Ethernet-TSN driver. In
preparation for this break out the gPTP support to its own module.
Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
---
* Changes since v2
- Drop the unneeded 'depends on' line from Kconfig symbol
RENESAS_GEN4_PTP.
* Changes since v1
- s/Gen3/Gen4/ in commit message.
- Add missing MODULE_AUTHOR() and MODULE_DESCRIPTION() definitions.
- Make Kconfig tristate depend on COMPILE_TEST. All drivers that make
use of the shared code auto selects this anyhow.
---
drivers/net/ethernet/renesas/Kconfig | 9 +++++++++
drivers/net/ethernet/renesas/Makefile | 5 +++--
drivers/net/ethernet/renesas/rcar_gen4_ptp.c | 7 +++++++
3 files changed, 19 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/renesas/Kconfig b/drivers/net/ethernet/renesas/Kconfig
index 8ef5b0241e64..733cbb6eb3ed 100644
--- a/drivers/net/ethernet/renesas/Kconfig
+++ b/drivers/net/ethernet/renesas/Kconfig
@@ -44,7 +44,16 @@ config RENESAS_ETHER_SWITCH
select CRC32
select MII
select PHYLINK
+ select RENESAS_GEN4_PTP
help
Renesas Ethernet Switch device driver.
+config RENESAS_GEN4_PTP
+ tristate "Renesas R-Car Gen4 gPTP support" if COMPILE_TEST
+ select CRC32
+ select MII
+ select PHYLIB
+ help
+ Renesas R-Car Gen4 gPTP device driver.
+
endif # NET_VENDOR_RENESAS
diff --git a/drivers/net/ethernet/renesas/Makefile b/drivers/net/ethernet/renesas/Makefile
index e8fd85b5fe8f..9070acfd6aaf 100644
--- a/drivers/net/ethernet/renesas/Makefile
+++ b/drivers/net/ethernet/renesas/Makefile
@@ -8,5 +8,6 @@ obj-$(CONFIG_SH_ETH) += sh_eth.o
ravb-objs := ravb_main.o ravb_ptp.o
obj-$(CONFIG_RAVB) += ravb.o
-rswitch_drv-objs := rswitch.o rcar_gen4_ptp.o
-obj-$(CONFIG_RENESAS_ETHER_SWITCH) += rswitch_drv.o
+obj-$(CONFIG_RENESAS_ETHER_SWITCH) += rswitch.o
+
+obj-$(CONFIG_RENESAS_GEN4_PTP) += rcar_gen4_ptp.o
diff --git a/drivers/net/ethernet/renesas/rcar_gen4_ptp.c b/drivers/net/ethernet/renesas/rcar_gen4_ptp.c
index 9583894634ae..72e7fcc56693 100644
--- a/drivers/net/ethernet/renesas/rcar_gen4_ptp.c
+++ b/drivers/net/ethernet/renesas/rcar_gen4_ptp.c
@@ -176,6 +176,7 @@ int rcar_gen4_ptp_register(struct rcar_gen4_ptp_private *ptp_priv,
return 0;
}
+EXPORT_SYMBOL_GPL(rcar_gen4_ptp_register);
int rcar_gen4_ptp_unregister(struct rcar_gen4_ptp_private *ptp_priv)
{
@@ -183,6 +184,7 @@ int rcar_gen4_ptp_unregister(struct rcar_gen4_ptp_private *ptp_priv)
return ptp_clock_unregister(ptp_priv->clock);
}
+EXPORT_SYMBOL_GPL(rcar_gen4_ptp_unregister);
struct rcar_gen4_ptp_private *rcar_gen4_ptp_alloc(struct platform_device *pdev)
{
@@ -196,3 +198,8 @@ struct rcar_gen4_ptp_private *rcar_gen4_ptp_alloc(struct platform_device *pdev)
return ptp;
}
+EXPORT_SYMBOL_GPL(rcar_gen4_ptp_alloc);
+
+MODULE_AUTHOR("Yoshihiro Shimoda");
+MODULE_DESCRIPTION("Renesas R-Car Gen4 gPTP driver");
+MODULE_LICENSE("GPL");
--
2.42.1
next prev parent reply other threads:[~2023-11-21 15:53 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-21 15:53 [net-next v3 0/5] net: ethernet: renesas: rcar_gen4_ptp: Add V4H support Niklas Söderlund
2023-11-21 15:53 ` [net-next v3 1/5] net: ethernet: renesas: rcar_gen4_ptp: Remove incorrect comment Niklas Söderlund
2023-11-22 20:32 ` Simon Horman
2023-11-21 15:53 ` [net-next v3 2/5] net: ethernet: renesas: rcar_gen4_ptp: Fail on unknown register layout Niklas Söderlund
2023-11-22 20:32 ` Simon Horman
2023-11-21 15:53 ` [net-next v3 3/5] net: ethernet: renesas: rcar_gen4_ptp: Prepare for shared " Niklas Söderlund
2023-11-22 20:32 ` Simon Horman
2023-11-21 15:53 ` [net-next v3 4/5] net: ethernet: renesas: rcar_gen4_ptp: Get clock increment from clock rate Niklas Söderlund
2023-11-22 20:33 ` Simon Horman
2023-11-21 15:53 ` Niklas Söderlund [this message]
2023-11-22 20:33 ` [net-next v3 5/5] net: ethernet: renesas: rcar_gen4_ptp: Break out to module Simon Horman
2023-11-23 11:10 ` [net-next v3 0/5] net: ethernet: renesas: rcar_gen4_ptp: Add V4H support patchwork-bot+netdevbpf
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=20231121155306.515446-6-niklas.soderlund+renesas@ragnatech.se \
--to=niklas.soderlund+renesas@ragnatech.se \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=richardcochran@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).