Skip to content

Commit 742ae92

Browse files
dolcinigregkh
authored andcommitted
net: fec: make PPS channel configurable
commit 566c2d8 upstream. Depending on the SoC where the FEC is integrated into the PPS channel might be routed to different timer instances. Make this configurable from the devicetree. When the related DT property is not present fallback to the previous default and use channel 0. Reviewed-by: Frank Li <[email protected]> Tested-by: Rafael Beims <[email protected]> Signed-off-by: Francesco Dolcini <[email protected]> Reviewed-by: Csókás, Bence <[email protected]> Signed-off-by: Paolo Abeni <[email protected]> Signed-off-by: Csókás, Bence <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 75d06a0 commit 742ae92

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

drivers/net/ethernet/freescale/fec_ptp.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -523,8 +523,6 @@ static int fec_ptp_enable(struct ptp_clock_info *ptp,
523523
unsigned long flags;
524524
int ret = 0;
525525

526-
fep->pps_channel = DEFAULT_PPS_CHANNEL;
527-
528526
if (rq->type == PTP_CLK_REQ_PPS) {
529527
fep->reload_period = PPS_OUPUT_RELOAD_PERIOD;
530528

@@ -706,12 +704,16 @@ void fec_ptp_init(struct platform_device *pdev, int irq_idx)
706704
{
707705
struct net_device *ndev = platform_get_drvdata(pdev);
708706
struct fec_enet_private *fep = netdev_priv(ndev);
707+
struct device_node *np = fep->pdev->dev.of_node;
709708
int irq;
710709
int ret;
711710

712711
fep->ptp_caps.owner = THIS_MODULE;
713712
strscpy(fep->ptp_caps.name, "fec ptp", sizeof(fep->ptp_caps.name));
714713

714+
fep->pps_channel = DEFAULT_PPS_CHANNEL;
715+
of_property_read_u32(np, "fsl,pps-channel", &fep->pps_channel);
716+
715717
fep->ptp_caps.max_adj = 250000000;
716718
fep->ptp_caps.n_alarm = 0;
717719
fep->ptp_caps.n_ext_ts = 0;

0 commit comments

Comments
 (0)