162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-or-later */
262306a36Sopenharmony_ci/*
362306a36Sopenharmony_ci * PPS kernel consumer API header
462306a36Sopenharmony_ci *
562306a36Sopenharmony_ci * Copyright (C) 2009-2010   Alexander Gordeev <lasaine@lvk.cs.msu.su>
662306a36Sopenharmony_ci */
762306a36Sopenharmony_ci
862306a36Sopenharmony_ci#ifndef LINUX_PPS_KC_H
962306a36Sopenharmony_ci#define LINUX_PPS_KC_H
1062306a36Sopenharmony_ci
1162306a36Sopenharmony_ci#include <linux/errno.h>
1262306a36Sopenharmony_ci#include <linux/pps_kernel.h>
1362306a36Sopenharmony_ci
1462306a36Sopenharmony_ci#ifdef CONFIG_NTP_PPS
1562306a36Sopenharmony_ci
1662306a36Sopenharmony_ciextern int pps_kc_bind(struct pps_device *pps,
1762306a36Sopenharmony_ci		struct pps_bind_args *bind_args);
1862306a36Sopenharmony_ciextern void pps_kc_remove(struct pps_device *pps);
1962306a36Sopenharmony_ciextern void pps_kc_event(struct pps_device *pps,
2062306a36Sopenharmony_ci		struct pps_event_time *ts, int event);
2162306a36Sopenharmony_ci
2262306a36Sopenharmony_ci
2362306a36Sopenharmony_ci#else /* CONFIG_NTP_PPS */
2462306a36Sopenharmony_ci
2562306a36Sopenharmony_cistatic inline int pps_kc_bind(struct pps_device *pps,
2662306a36Sopenharmony_ci		struct pps_bind_args *bind_args) { return -EOPNOTSUPP; }
2762306a36Sopenharmony_cistatic inline void pps_kc_remove(struct pps_device *pps) {}
2862306a36Sopenharmony_cistatic inline void pps_kc_event(struct pps_device *pps,
2962306a36Sopenharmony_ci		struct pps_event_time *ts, int event) {}
3062306a36Sopenharmony_ci
3162306a36Sopenharmony_ci#endif /* CONFIG_NTP_PPS */
3262306a36Sopenharmony_ci
3362306a36Sopenharmony_ci#endif /* LINUX_PPS_KC_H */
34