Merge tag 'trace-printf-v6.13' of git://git.kernel.org/pub/scm/linux/kernel/git/trace...
[drm/drm-misc.git] / drivers / net / ethernet / ti / am65-cpts.h
blob6099d772799da8d6ef650d5904f43db61694a992
1 /* SPDX-License-Identifier: GPL-2.0+ */
2 /* TI K3 AM65 CPTS driver interface
4 * Copyright (C) 2020 Texas Instruments Incorporated - http://www.ti.com
5 */
7 #ifndef K3_CPTS_H_
8 #define K3_CPTS_H_
10 #include <linux/device.h>
11 #include <linux/of.h>
13 struct am65_cpts;
15 struct am65_cpts_estf_cfg {
16 u64 ns_period;
17 u64 ns_start;
20 #if IS_ENABLED(CONFIG_TI_K3_AM65_CPTS)
21 void am65_cpts_release(struct am65_cpts *cpts);
22 struct am65_cpts *am65_cpts_create(struct device *dev, void __iomem *regs,
23 struct device_node *node);
24 int am65_cpts_phc_index(struct am65_cpts *cpts);
25 void am65_cpts_rx_timestamp(struct am65_cpts *cpts, struct sk_buff *skb);
26 void am65_cpts_tx_timestamp(struct am65_cpts *cpts, struct sk_buff *skb);
27 void am65_cpts_prep_tx_timestamp(struct am65_cpts *cpts, struct sk_buff *skb);
28 u64 am65_cpts_ns_gettime(struct am65_cpts *cpts);
29 int am65_cpts_estf_enable(struct am65_cpts *cpts, int idx,
30 struct am65_cpts_estf_cfg *cfg);
31 void am65_cpts_estf_disable(struct am65_cpts *cpts, int idx);
32 void am65_cpts_suspend(struct am65_cpts *cpts);
33 void am65_cpts_resume(struct am65_cpts *cpts);
34 #else
35 static inline void am65_cpts_release(struct am65_cpts *cpts)
39 static inline struct am65_cpts *am65_cpts_create(struct device *dev,
40 void __iomem *regs,
41 struct device_node *node)
43 return ERR_PTR(-EOPNOTSUPP);
46 static inline int am65_cpts_phc_index(struct am65_cpts *cpts)
48 return -1;
51 static inline void am65_cpts_rx_timestamp(struct am65_cpts *cpts,
52 struct sk_buff *skb)
56 static inline void am65_cpts_tx_timestamp(struct am65_cpts *cpts,
57 struct sk_buff *skb)
61 static inline void am65_cpts_prep_tx_timestamp(struct am65_cpts *cpts,
62 struct sk_buff *skb)
66 static inline s64 am65_cpts_ns_gettime(struct am65_cpts *cpts)
68 return 0;
71 static inline int am65_cpts_estf_enable(struct am65_cpts *cpts, int idx,
72 struct am65_cpts_estf_cfg *cfg)
74 return 0;
77 static inline void am65_cpts_estf_disable(struct am65_cpts *cpts, int idx)
81 static inline void am65_cpts_suspend(struct am65_cpts *cpts)
85 static inline void am65_cpts_resume(struct am65_cpts *cpts)
88 #endif
90 #endif /* K3_CPTS_H_ */