mirror of
https://github.com/torvalds/linux.git
synced 2026-06-03 20:14:06 +02:00
net: ethernet: renesas: rcar_gen4_ptp: Add helper to get clock index
Instead of accessing the Gen4 PTP specific structure directly in drivers add a helper to read the clock index. This is done in preparation to completely hide the Gen4 PTP specific structure from users. Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> Link: https://patch.msgid.link/20260201183745.1075399-3-niklas.soderlund+renesas@ragnatech.se Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
642377346a
commit
9afe65e7e7
|
|
@ -185,6 +185,15 @@ struct rcar_gen4_ptp_private *rcar_gen4_ptp_alloc(struct platform_device *pdev,
|
|||
}
|
||||
EXPORT_SYMBOL_GPL(rcar_gen4_ptp_alloc);
|
||||
|
||||
int rcar_gen4_ptp_clock_index(struct rcar_gen4_ptp_private *priv)
|
||||
{
|
||||
if (!priv->initialized)
|
||||
return -1;
|
||||
|
||||
return ptp_clock_index(priv->clock);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(rcar_gen4_ptp_clock_index);
|
||||
|
||||
MODULE_AUTHOR("Yoshihiro Shimoda");
|
||||
MODULE_DESCRIPTION("Renesas R-Car Gen4 gPTP driver");
|
||||
MODULE_LICENSE("GPL");
|
||||
|
|
|
|||
|
|
@ -23,4 +23,6 @@ int rcar_gen4_ptp_unregister(struct rcar_gen4_ptp_private *ptp_priv);
|
|||
struct rcar_gen4_ptp_private *rcar_gen4_ptp_alloc(struct platform_device *pdev,
|
||||
void __iomem *addr);
|
||||
|
||||
int rcar_gen4_ptp_clock_index(struct rcar_gen4_ptp_private *priv);
|
||||
|
||||
#endif /* #ifndef __RCAR_GEN4_PTP_H__ */
|
||||
|
|
|
|||
|
|
@ -1891,7 +1891,7 @@ static int rswitch_get_ts_info(struct net_device *ndev, struct kernel_ethtool_ts
|
|||
{
|
||||
struct rswitch_device *rdev = netdev_priv(ndev);
|
||||
|
||||
info->phc_index = ptp_clock_index(rdev->priv->ptp_priv->clock);
|
||||
info->phc_index = rcar_gen4_ptp_clock_index(rdev->priv->ptp_priv);
|
||||
info->so_timestamping = SOF_TIMESTAMPING_TX_SOFTWARE |
|
||||
SOF_TIMESTAMPING_TX_HARDWARE |
|
||||
SOF_TIMESTAMPING_RX_HARDWARE |
|
||||
|
|
|
|||
|
|
@ -1197,7 +1197,7 @@ static int rtsn_get_ts_info(struct net_device *ndev,
|
|||
{
|
||||
struct rtsn_private *priv = netdev_priv(ndev);
|
||||
|
||||
info->phc_index = ptp_clock_index(priv->ptp_priv->clock);
|
||||
info->phc_index = rcar_gen4_ptp_clock_index(priv->ptp_priv);
|
||||
info->so_timestamping = SOF_TIMESTAMPING_TX_SOFTWARE |
|
||||
SOF_TIMESTAMPING_TX_HARDWARE |
|
||||
SOF_TIMESTAMPING_RX_HARDWARE |
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user