Lines Matching refs:dt
80 static int fine_adjust_tod_clock(struct dfl_tod *dt, u32 adjust_period, in fine_adjust_tod_clock() argument
83 void __iomem *base = dt->tod_ctrl; in fine_adjust_tod_clock()
98 static int coarse_adjust_tod_clock(struct dfl_tod *dt, s64 delta) in coarse_adjust_tod_clock() argument
101 void __iomem *base = dt->tod_ctrl; in coarse_adjust_tod_clock()
128 struct dfl_tod *dt = container_of(ptp, struct dfl_tod, ptp_clock_ops); in dfl_tod_adjust_fine() local
130 void __iomem *base = dt->tod_ctrl; in dfl_tod_adjust_fine()
160 spin_lock_irqsave(&dt->tod_lock, flags); in dfl_tod_adjust_fine()
166 spin_unlock_irqrestore(&dt->tod_lock, flags); in dfl_tod_adjust_fine()
173 struct dfl_tod *dt = container_of(ptp, struct dfl_tod, ptp_clock_ops); in dfl_tod_adjust_time() local
175 void __iomem *base = dt->tod_ctrl; in dfl_tod_adjust_time()
185 spin_lock_irqsave(&dt->tod_lock, flags); in dfl_tod_adjust_time()
210 ret = coarse_adjust_tod_clock(dt, delta); in dfl_tod_adjust_time()
214 ret = fine_adjust_tod_clock(dt, adj_period, count); in dfl_tod_adjust_time()
218 ret = fine_adjust_tod_clock(dt, rem_period, 1); in dfl_tod_adjust_time()
221 spin_unlock_irqrestore(&dt->tod_lock, flags); in dfl_tod_adjust_time()
229 struct dfl_tod *dt = container_of(ptp, struct dfl_tod, ptp_clock_ops); in dfl_tod_get_timex() local
231 void __iomem *base = dt->tod_ctrl; in dfl_tod_get_timex()
235 spin_lock_irqsave(&dt->tod_lock, flags); in dfl_tod_get_timex()
241 spin_unlock_irqrestore(&dt->tod_lock, flags); in dfl_tod_get_timex()
254 struct dfl_tod *dt = container_of(ptp, struct dfl_tod, ptp_clock_ops); in dfl_tod_set_time() local
258 void __iomem *base = dt->tod_ctrl; in dfl_tod_set_time()
261 spin_lock_irqsave(&dt->tod_lock, flags); in dfl_tod_set_time()
265 spin_unlock_irqrestore(&dt->tod_lock, flags); in dfl_tod_set_time()
283 struct dfl_tod *dt; in dfl_tod_probe() local
285 dt = devm_kzalloc(dev, sizeof(*dt), GFP_KERNEL); in dfl_tod_probe()
286 if (!dt) in dfl_tod_probe()
289 dt->tod_ctrl = devm_ioremap_resource(dev, &ddev->mmio_res); in dfl_tod_probe()
290 if (IS_ERR(dt->tod_ctrl)) in dfl_tod_probe()
291 return PTR_ERR(dt->tod_ctrl); in dfl_tod_probe()
293 dt->dev = dev; in dfl_tod_probe()
294 spin_lock_init(&dt->tod_lock); in dfl_tod_probe()
295 dev_set_drvdata(dev, dt); in dfl_tod_probe()
297 dt->ptp_clock_ops = dfl_tod_clock_ops; in dfl_tod_probe()
299 dt->ptp_clock = ptp_clock_register(&dt->ptp_clock_ops, dev); in dfl_tod_probe()
300 if (IS_ERR(dt->ptp_clock)) in dfl_tod_probe()
301 return dev_err_probe(dt->dev, PTR_ERR(dt->ptp_clock), in dfl_tod_probe()
309 struct dfl_tod *dt = dev_get_drvdata(&ddev->dev); in dfl_tod_remove() local
311 ptp_clock_unregister(dt->ptp_clock); in dfl_tod_remove()