Lines Matching full:ptp
3 * PTP 1588 clock support - character device implementation.
49 int ptp_set_pinfunc(struct ptp_clock *ptp, unsigned int pin, in ptp_set_pinfunc() argument
52 struct ptp_clock_info *info = ptp->info; in ptp_set_pinfunc()
108 struct ptp_clock *ptp = in ptp_open() local
124 spin_lock_irqsave(&ptp->tsevqs_lock, flags); in ptp_open()
125 list_add_tail(&queue->qlist, &ptp->tsevqs); in ptp_open()
126 spin_unlock_irqrestore(&ptp->tsevqs_lock, flags); in ptp_open()
132 debugfs_create_dir(debugfsname, ptp->debugfs_root); in ptp_open()
146 struct ptp_clock *ptp = in ptp_release() local
151 spin_lock_irqsave(&ptp->tsevqs_lock, flags); in ptp_release()
153 spin_unlock_irqrestore(&ptp->tsevqs_lock, flags); in ptp_release()
162 struct ptp_clock *ptp = in ptp_ioctl() local
167 struct ptp_clock_info *ops = ptp->info; in ptp_ioctl()
187 caps.max_adj = ptp->info->max_adj; in ptp_ioctl()
188 caps.n_alarm = ptp->info->n_alarm; in ptp_ioctl()
189 caps.n_ext_ts = ptp->info->n_ext_ts; in ptp_ioctl()
190 caps.n_per_out = ptp->info->n_per_out; in ptp_ioctl()
191 caps.pps = ptp->info->pps; in ptp_ioctl()
192 caps.n_pins = ptp->info->n_pins; in ptp_ioctl()
193 caps.cross_timestamping = ptp->info->getcrosststamp != NULL; in ptp_ioctl()
194 caps.adjust_phase = ptp->info->adjphase != NULL && in ptp_ioctl()
195 ptp->info->getmaxphase != NULL; in ptp_ioctl()
197 caps.max_phase_adj = ptp->info->getmaxphase(ptp->info); in ptp_ioctl()
237 if (mutex_lock_interruptible(&ptp->pincfg_mux)) in ptp_ioctl()
240 mutex_unlock(&ptp->pincfg_mux); in ptp_ioctl()
305 if (mutex_lock_interruptible(&ptp->pincfg_mux)) in ptp_ioctl()
308 mutex_unlock(&ptp->pincfg_mux); in ptp_ioctl()
319 if (mutex_lock_interruptible(&ptp->pincfg_mux)) in ptp_ioctl()
322 mutex_unlock(&ptp->pincfg_mux); in ptp_ioctl()
327 if (!ptp->info->getcrosststamp) { in ptp_ioctl()
331 err = ptp->info->getcrosststamp(ptp->info, &xtstamp); in ptp_ioctl()
352 if (!ptp->info->gettimex64) { in ptp_ioctl()
372 err = ptp->info->gettimex64(ptp->info, &ts, &sts); in ptp_ioctl()
445 if (mutex_lock_interruptible(&ptp->pincfg_mux)) in ptp_ioctl()
448 mutex_unlock(&ptp->pincfg_mux); in ptp_ioctl()
477 if (mutex_lock_interruptible(&ptp->pincfg_mux)) in ptp_ioctl()
479 err = ptp_set_pinfunc(ptp, pin_index, pd.func, pd.chan); in ptp_ioctl()
480 mutex_unlock(&ptp->pincfg_mux); in ptp_ioctl()
513 struct ptp_clock *ptp = in ptp_poll() local
521 poll_wait(fp, &ptp->tsev_wq, wait); in ptp_poll()
531 struct ptp_clock *ptp = in ptp_read() local
555 if (wait_event_interruptible(ptp->tsev_wq, in ptp_read()
556 ptp->defunct || queue_cnt(queue))) { in ptp_read()
560 if (ptp->defunct) { in ptp_read()