#ifndef CAVIUM_PTP_H
#define CAVIUM_PTP_H
#include <linux/ptp_clock_kernel.h>
#include <linux/timecounter.h>
struct cavium_ptp { … };
#if IS_REACHABLE(CONFIG_CAVIUM_PTP)
struct cavium_ptp *cavium_ptp_get(void);
void cavium_ptp_put(struct cavium_ptp *ptp);
static inline u64 cavium_ptp_tstamp2time(struct cavium_ptp *ptp, u64 tstamp)
{ … }
static inline int cavium_ptp_clock_index(struct cavium_ptp *clock)
{ … }
#else
static inline struct cavium_ptp *cavium_ptp_get(void)
{
return ERR_PTR(-ENODEV);
}
static inline void cavium_ptp_put(struct cavium_ptp *ptp) {}
static inline u64 cavium_ptp_tstamp2time(struct cavium_ptp *ptp, u64 tstamp)
{
return 0;
}
static inline int cavium_ptp_clock_index(struct cavium_ptp *clock)
{
return -1;
}
#endif
#endif