Lines Matching full:ptp
3 * PTP 1588 clock support - character device implementation.
48 int ptp_set_pinfunc(struct ptp_clock *ptp, unsigned int pin, in ptp_set_pinfunc() argument
51 struct ptp_clock_info *info = ptp->info; in ptp_set_pinfunc()
111 struct ptp_clock *ptp = container_of(pc, struct ptp_clock, clock); in ptp_ioctl() local
115 struct ptp_clock_info *ops = ptp->info; in ptp_ioctl()
132 caps.max_adj = ptp->info->max_adj; in ptp_ioctl()
133 caps.n_alarm = ptp->info->n_alarm; in ptp_ioctl()
134 caps.n_ext_ts = ptp->info->n_ext_ts; in ptp_ioctl()
135 caps.n_per_out = ptp->info->n_per_out; in ptp_ioctl()
136 caps.pps = ptp->info->pps; in ptp_ioctl()
137 caps.n_pins = ptp->info->n_pins; in ptp_ioctl()
138 caps.cross_timestamping = ptp->info->getcrosststamp != NULL; in ptp_ioctl()
139 caps.adjust_phase = ptp->info->adjphase != NULL; in ptp_ioctl()
179 if (mutex_lock_interruptible(&ptp->pincfg_mux)) in ptp_ioctl()
182 mutex_unlock(&ptp->pincfg_mux); in ptp_ioctl()
247 if (mutex_lock_interruptible(&ptp->pincfg_mux)) in ptp_ioctl()
250 mutex_unlock(&ptp->pincfg_mux); in ptp_ioctl()
261 if (mutex_lock_interruptible(&ptp->pincfg_mux)) in ptp_ioctl()
264 mutex_unlock(&ptp->pincfg_mux); in ptp_ioctl()
269 if (!ptp->info->getcrosststamp) { in ptp_ioctl()
273 err = ptp->info->getcrosststamp(ptp->info, &xtstamp); in ptp_ioctl()
294 if (!ptp->info->gettimex64) { in ptp_ioctl()
310 err = ptp->info->gettimex64(ptp->info, &ts, &sts); in ptp_ioctl()
383 if (mutex_lock_interruptible(&ptp->pincfg_mux)) in ptp_ioctl()
386 mutex_unlock(&ptp->pincfg_mux); in ptp_ioctl()
415 if (mutex_lock_interruptible(&ptp->pincfg_mux)) in ptp_ioctl()
417 err = ptp_set_pinfunc(ptp, pin_index, pd.func, pd.chan); in ptp_ioctl()
418 mutex_unlock(&ptp->pincfg_mux); in ptp_ioctl()
434 struct ptp_clock *ptp = container_of(pc, struct ptp_clock, clock); in ptp_poll() local
436 poll_wait(fp, &ptp->tsev_wq, wait); in ptp_poll()
438 return queue_cnt(&ptp->tsevq) ? EPOLLIN : 0; in ptp_poll()
446 struct ptp_clock *ptp = container_of(pc, struct ptp_clock, clock); in ptp_read() local
447 struct timestamp_event_queue *queue = &ptp->tsevq; in ptp_read()
461 if (mutex_lock_interruptible(&ptp->tsevq_mux)) in ptp_read()
464 if (wait_event_interruptible(ptp->tsev_wq, in ptp_read()
465 ptp->defunct || queue_cnt(queue))) { in ptp_read()
466 mutex_unlock(&ptp->tsevq_mux); in ptp_read()
470 if (ptp->defunct) { in ptp_read()
471 mutex_unlock(&ptp->tsevq_mux); in ptp_read()
477 mutex_unlock(&ptp->tsevq_mux); in ptp_read()
497 mutex_unlock(&ptp->tsevq_mux); in ptp_read()