mirror of
https://github.com/torvalds/linux.git
synced 2026-05-27 08:33:17 +02:00
net: fec: make PPS channel configurable
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 <Frank.Li@nxp.com> Tested-by: Rafael Beims <rafael.beims@toradex.com> Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com> Reviewed-by: Csókás, Bence <csokas.bence@prolan.hu> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
This commit is contained in:
parent
bf8ca67e21
commit
566c2d8388
|
|
@ -523,8 +523,6 @@ static int fec_ptp_enable(struct ptp_clock_info *ptp,
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
fep->pps_channel = DEFAULT_PPS_CHANNEL;
|
|
||||||
|
|
||||||
if (rq->type == PTP_CLK_REQ_PPS) {
|
if (rq->type == PTP_CLK_REQ_PPS) {
|
||||||
fep->reload_period = PPS_OUPUT_RELOAD_PERIOD;
|
fep->reload_period = PPS_OUPUT_RELOAD_PERIOD;
|
||||||
|
|
||||||
|
|
@ -706,12 +704,16 @@ void fec_ptp_init(struct platform_device *pdev, int irq_idx)
|
||||||
{
|
{
|
||||||
struct net_device *ndev = platform_get_drvdata(pdev);
|
struct net_device *ndev = platform_get_drvdata(pdev);
|
||||||
struct fec_enet_private *fep = netdev_priv(ndev);
|
struct fec_enet_private *fep = netdev_priv(ndev);
|
||||||
|
struct device_node *np = fep->pdev->dev.of_node;
|
||||||
int irq;
|
int irq;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
fep->ptp_caps.owner = THIS_MODULE;
|
fep->ptp_caps.owner = THIS_MODULE;
|
||||||
strscpy(fep->ptp_caps.name, "fec ptp", sizeof(fep->ptp_caps.name));
|
strscpy(fep->ptp_caps.name, "fec ptp", sizeof(fep->ptp_caps.name));
|
||||||
|
|
||||||
|
fep->pps_channel = DEFAULT_PPS_CHANNEL;
|
||||||
|
of_property_read_u32(np, "fsl,pps-channel", &fep->pps_channel);
|
||||||
|
|
||||||
fep->ptp_caps.max_adj = 250000000;
|
fep->ptp_caps.max_adj = 250000000;
|
||||||
fep->ptp_caps.n_alarm = 0;
|
fep->ptp_caps.n_alarm = 0;
|
||||||
fep->ptp_caps.n_ext_ts = 0;
|
fep->ptp_caps.n_ext_ts = 0;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user