Lines Matching full:ds
61 int sja1105_hwtstamp_set(struct dsa_switch *ds, int port, struct ifreq *ifr) in sja1105_hwtstamp_set() argument
63 struct sja1105_private *priv = ds->priv; in sja1105_hwtstamp_set()
94 int sja1105_hwtstamp_get(struct dsa_switch *ds, int port, struct ifreq *ifr) in sja1105_hwtstamp_get() argument
96 struct sja1105_private *priv = ds->priv; in sja1105_hwtstamp_get()
113 int sja1105_get_ts_info(struct dsa_switch *ds, int port, in sja1105_get_ts_info() argument
116 struct sja1105_private *priv = ds->priv; in sja1105_get_ts_info()
168 int sja1105_ptp_commit(struct dsa_switch *ds, struct sja1105_ptp_cmd *cmd, in sja1105_ptp_commit() argument
171 const struct sja1105_private *priv = ds->priv; in sja1105_ptp_commit()
202 static u64 sja1105_tstamp_reconstruct(struct dsa_switch *ds, u64 now, in sja1105_tstamp_reconstruct() argument
205 struct sja1105_private *priv = ds->priv; in sja1105_tstamp_reconstruct()
247 static int sja1105_ptpegr_ts_poll(struct dsa_switch *ds, int port, u64 *ts) in sja1105_ptpegr_ts_poll() argument
249 struct sja1105_private *priv = ds->priv; in sja1105_ptpegr_ts_poll()
323 dev_err_ratelimited(priv->ds->dev, in sja1105_extts_poll()
340 struct dsa_switch *ds = priv->ds; in sja1105_rxtstamp_work() local
352 dev_err(ds->dev, "Failed to read PTP clock: %d\n", rc); in sja1105_rxtstamp_work()
360 ts = sja1105_tstamp_reconstruct(ds, ticks, ts); in sja1105_rxtstamp_work()
375 bool sja1105_rxtstamp(struct dsa_switch *ds, int port, struct sk_buff *skb) in sja1105_rxtstamp() argument
377 struct sja1105_private *priv = ds->priv; in sja1105_rxtstamp()
391 bool sja1110_rxtstamp(struct dsa_switch *ds, int port, struct sk_buff *skb) in sja1110_rxtstamp() argument
405 bool sja1105_port_rxtstamp(struct dsa_switch *ds, int port, in sja1105_port_rxtstamp() argument
408 struct sja1105_private *priv = ds->priv; in sja1105_port_rxtstamp()
410 return priv->info->rxtstamp(ds, port, skb); in sja1105_port_rxtstamp()
413 void sja1110_process_meta_tstamp(struct dsa_switch *ds, int port, u8 ts_id, in sja1110_process_meta_tstamp() argument
416 struct sja1105_private *priv = ds->priv; in sja1110_process_meta_tstamp()
450 void sja1110_txtstamp(struct dsa_switch *ds, int port, struct sk_buff *skb) in sja1110_txtstamp() argument
453 struct sja1105_private *priv = ds->priv; in sja1110_txtstamp()
476 void sja1105_port_txtstamp(struct dsa_switch *ds, int port, struct sk_buff *skb) in sja1105_port_txtstamp() argument
478 struct sja1105_private *priv = ds->priv; in sja1105_port_txtstamp()
491 priv->info->txtstamp(ds, port, skb); in sja1105_port_txtstamp()
494 static int sja1105_ptp_reset(struct dsa_switch *ds) in sja1105_ptp_reset() argument
496 struct sja1105_private *priv = ds->priv; in sja1105_ptp_reset()
505 dev_dbg(ds->dev, "Resetting PTP clock\n"); in sja1105_ptp_reset()
506 rc = sja1105_ptp_commit(ds, &cmd, SPI_WRITE); in sja1105_ptp_reset()
508 sja1105_tas_clockstep(priv->ds); in sja1105_ptp_reset()
516 int __sja1105_ptp_gettimex(struct dsa_switch *ds, u64 *ns, in __sja1105_ptp_gettimex() argument
519 struct sja1105_private *priv = ds->priv; in __sja1105_ptp_gettimex()
525 dev_err(ds->dev, "Failed to read PTP clock: %d\n", rc); in __sja1105_ptp_gettimex()
545 rc = __sja1105_ptp_gettimex(priv->ds, &now, ptp_sts); in sja1105_ptp_gettimex()
564 return sja1105_ptp_commit(priv->ds, &ptp_data->cmd, SPI_WRITE); in sja1105_ptp_mode_set()
568 int __sja1105_ptp_settime(struct dsa_switch *ds, u64 ns, in __sja1105_ptp_settime() argument
571 struct sja1105_private *priv = ds->priv; in __sja1105_ptp_settime()
577 dev_err(priv->ds->dev, "Failed to put PTPCLK in set mode\n"); in __sja1105_ptp_settime()
583 sja1105_tas_clockstep(priv->ds); in __sja1105_ptp_settime()
598 rc = __sja1105_ptp_settime(priv->ds, ns, NULL); in sja1105_ptp_settime()
627 sja1105_tas_adjfreq(priv->ds); in sja1105_ptp_adjfine()
635 int __sja1105_ptp_adjtime(struct dsa_switch *ds, s64 delta) in __sja1105_ptp_adjtime() argument
637 struct sja1105_private *priv = ds->priv; in __sja1105_ptp_adjtime()
643 dev_err(priv->ds->dev, "Failed to put PTPCLK in add mode\n"); in __sja1105_ptp_adjtime()
649 sja1105_tas_clockstep(priv->ds); in __sja1105_ptp_adjtime()
662 rc = __sja1105_ptp_adjtime(priv->ds, delta); in sja1105_ptp_adjtime()
771 rc = __sja1105_ptp_gettimex(priv->ds, &now, NULL); in sja1105_per_out_enable()
795 rc = sja1105_ptp_commit(priv->ds, &cmd, SPI_WRITE); in sja1105_per_out_enable()
885 int sja1105_ptp_clock_register(struct dsa_switch *ds) in sja1105_ptp_clock_register() argument
887 struct sja1105_private *priv = ds->priv; in sja1105_ptp_clock_register()
912 ptp_data->clock = ptp_clock_register(&ptp_data->caps, ds->dev); in sja1105_ptp_clock_register()
921 return sja1105_ptp_reset(ds); in sja1105_ptp_clock_register()
924 void sja1105_ptp_clock_unregister(struct dsa_switch *ds) in sja1105_ptp_clock_unregister() argument
926 struct sja1105_private *priv = ds->priv; in sja1105_ptp_clock_unregister()
940 void sja1105_ptp_txtstamp_skb(struct dsa_switch *ds, int port, in sja1105_ptp_txtstamp_skb() argument
943 struct sja1105_private *priv = ds->priv; in sja1105_ptp_txtstamp_skb()
953 rc = sja1105_ptpegr_ts_poll(ds, port, &ts); in sja1105_ptp_txtstamp_skb()
955 dev_err(ds->dev, "timed out polling for tstamp\n"); in sja1105_ptp_txtstamp_skb()
962 dev_err(ds->dev, "Failed to read PTP clock: %d\n", rc); in sja1105_ptp_txtstamp_skb()
967 ts = sja1105_tstamp_reconstruct(ds, ticks, ts); in sja1105_ptp_txtstamp_skb()