^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /* SPDX-License-Identifier: GPL-2.0-or-later */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) * PPS kernel consumer API header
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) * Copyright (C) 2009-2010 Alexander Gordeev <lasaine@lvk.cs.msu.su>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) #ifndef LINUX_PPS_KC_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) #define LINUX_PPS_KC_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) #include <linux/errno.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) #include <linux/pps_kernel.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) #ifdef CONFIG_NTP_PPS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) extern int pps_kc_bind(struct pps_device *pps,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) struct pps_bind_args *bind_args);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) extern void pps_kc_remove(struct pps_device *pps);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) extern void pps_kc_event(struct pps_device *pps,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) struct pps_event_time *ts, int event);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) #else /* CONFIG_NTP_PPS */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) static inline int pps_kc_bind(struct pps_device *pps,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) struct pps_bind_args *bind_args) { return -EOPNOTSUPP; }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) static inline void pps_kc_remove(struct pps_device *pps) {}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) static inline void pps_kc_event(struct pps_device *pps,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) struct pps_event_time *ts, int event) {}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) #endif /* CONFIG_NTP_PPS */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) #endif /* LINUX_PPS_KC_H */