Lines Matching +full:ts +full:- +full:attached

1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * pps_gen_parport.c -- kernel parallel port PPS signal generator
49 static int attached; variable
78 lim = NSEC_PER_SEC - send_delay - dev->port_write_time; in hrtimer_event()
94 port = dev->pardev->port; in hrtimer_event()
95 port->ops->write_control(port, SIGNAL); in hrtimer_event()
98 lim = NSEC_PER_SEC - dev->port_write_time; in hrtimer_event()
104 port->ops->write_control(port, NO_SIGNAL); in hrtimer_event()
112 dev->port_write_time = in hrtimer_event()
113 (dev->port_write_time + timespec64_to_ns(&dts)) >> 1; in hrtimer_event()
132 NSEC_PER_SEC - (send_delay + in hrtimer_event()
133 dev->port_write_time + SAFETY_INTERVAL + in hrtimer_event()
143 struct parport *port = dev->pardev->port; in calibrate_port()
153 port->ops->write_control(port, NO_SIGNAL); in calibrate_port()
161 dev->port_write_time = acc >> PORT_NTESTS_SHIFT; in calibrate_port()
162 pr_info("port write takes %ldns\n", dev->port_write_time); in calibrate_port()
167 struct timespec64 ts; in next_intr_time() local
169 ktime_get_real_ts64(&ts); in next_intr_time()
171 return ktime_set(ts.tv_sec + in next_intr_time()
172 ((ts.tv_nsec > 990 * NSEC_PER_MSEC) ? 1 : 0), in next_intr_time()
173 NSEC_PER_SEC - (send_delay + in next_intr_time()
174 dev->port_write_time + 3 * SAFETY_INTERVAL)); in next_intr_time()
186 if (attached) { in parport_attach()
197 pr_err("couldn't register with %s\n", port->name); in parport_attach()
202 pr_err("couldn't claim %s\n", port->name); in parport_attach()
206 pr_info("attached to %s\n", port->name); in parport_attach()
207 attached = 1; in parport_attach()
223 if (port->cad != device.pardev) in parport_detach()