Linux Audio

Check our new training course

Linux kernel drivers training

Mar 31-Apr 9, 2025, special US time zones
Register
Loading...
v6.13.7
 1/* SPDX-License-Identifier: GPL-2.0+ */
 2/* TI K3 AM65 CPTS driver interface
 3 *
 4 * Copyright (C) 2020 Texas Instruments Incorporated - http://www.ti.com
 5 */
 6
 7#ifndef K3_CPTS_H_
 8#define K3_CPTS_H_
 9
10#include <linux/device.h>
11#include <linux/of.h>
12
13struct am65_cpts;
14
15struct am65_cpts_estf_cfg {
16	u64 ns_period;
17	u64 ns_start;
18};
19
20#if IS_ENABLED(CONFIG_TI_K3_AM65_CPTS)
21void am65_cpts_release(struct am65_cpts *cpts);
22struct am65_cpts *am65_cpts_create(struct device *dev, void __iomem *regs,
23				   struct device_node *node);
24int am65_cpts_phc_index(struct am65_cpts *cpts);
25void am65_cpts_rx_timestamp(struct am65_cpts *cpts, struct sk_buff *skb);
26void am65_cpts_tx_timestamp(struct am65_cpts *cpts, struct sk_buff *skb);
27void am65_cpts_prep_tx_timestamp(struct am65_cpts *cpts, struct sk_buff *skb);
 
28u64 am65_cpts_ns_gettime(struct am65_cpts *cpts);
29int am65_cpts_estf_enable(struct am65_cpts *cpts, int idx,
30			  struct am65_cpts_estf_cfg *cfg);
31void am65_cpts_estf_disable(struct am65_cpts *cpts, int idx);
32void am65_cpts_suspend(struct am65_cpts *cpts);
33void am65_cpts_resume(struct am65_cpts *cpts);
34#else
35static inline void am65_cpts_release(struct am65_cpts *cpts)
36{
37}
38
39static inline struct am65_cpts *am65_cpts_create(struct device *dev,
40						 void __iomem *regs,
41						 struct device_node *node)
42{
43	return ERR_PTR(-EOPNOTSUPP);
44}
45
46static inline int am65_cpts_phc_index(struct am65_cpts *cpts)
47{
48	return -1;
49}
50
51static inline void am65_cpts_rx_timestamp(struct am65_cpts *cpts,
52					  struct sk_buff *skb)
53{
54}
55
56static inline void am65_cpts_tx_timestamp(struct am65_cpts *cpts,
57					  struct sk_buff *skb)
58{
59}
60
61static inline void am65_cpts_prep_tx_timestamp(struct am65_cpts *cpts,
62					       struct sk_buff *skb)
 
 
 
 
63{
64}
65
66static inline s64 am65_cpts_ns_gettime(struct am65_cpts *cpts)
67{
68	return 0;
69}
70
71static inline int am65_cpts_estf_enable(struct am65_cpts *cpts, int idx,
72					struct am65_cpts_estf_cfg *cfg)
73{
74	return 0;
75}
76
77static inline void am65_cpts_estf_disable(struct am65_cpts *cpts, int idx)
78{
79}
80
81static inline void am65_cpts_suspend(struct am65_cpts *cpts)
82{
83}
84
85static inline void am65_cpts_resume(struct am65_cpts *cpts)
86{
87}
88#endif
89
90#endif /* K3_CPTS_H_ */
v6.2
 1/* SPDX-License-Identifier: GPL-2.0+ */
 2/* TI K3 AM65 CPTS driver interface
 3 *
 4 * Copyright (C) 2020 Texas Instruments Incorporated - http://www.ti.com
 5 */
 6
 7#ifndef K3_CPTS_H_
 8#define K3_CPTS_H_
 9
10#include <linux/device.h>
11#include <linux/of.h>
12
13struct am65_cpts;
14
15struct am65_cpts_estf_cfg {
16	u64 ns_period;
17	u64 ns_start;
18};
19
20#if IS_ENABLED(CONFIG_TI_K3_AM65_CPTS)
 
21struct am65_cpts *am65_cpts_create(struct device *dev, void __iomem *regs,
22				   struct device_node *node);
23int am65_cpts_phc_index(struct am65_cpts *cpts);
 
24void am65_cpts_tx_timestamp(struct am65_cpts *cpts, struct sk_buff *skb);
25void am65_cpts_prep_tx_timestamp(struct am65_cpts *cpts, struct sk_buff *skb);
26void am65_cpts_rx_enable(struct am65_cpts *cpts, bool en);
27u64 am65_cpts_ns_gettime(struct am65_cpts *cpts);
28int am65_cpts_estf_enable(struct am65_cpts *cpts, int idx,
29			  struct am65_cpts_estf_cfg *cfg);
30void am65_cpts_estf_disable(struct am65_cpts *cpts, int idx);
31void am65_cpts_suspend(struct am65_cpts *cpts);
32void am65_cpts_resume(struct am65_cpts *cpts);
33#else
 
 
 
 
34static inline struct am65_cpts *am65_cpts_create(struct device *dev,
35						 void __iomem *regs,
36						 struct device_node *node)
37{
38	return ERR_PTR(-EOPNOTSUPP);
39}
40
41static inline int am65_cpts_phc_index(struct am65_cpts *cpts)
42{
43	return -1;
44}
45
 
 
 
 
 
46static inline void am65_cpts_tx_timestamp(struct am65_cpts *cpts,
47					  struct sk_buff *skb)
48{
49}
50
51static inline void am65_cpts_prep_tx_timestamp(struct am65_cpts *cpts,
52					       struct sk_buff *skb)
53{
54}
55
56static inline void am65_cpts_rx_enable(struct am65_cpts *cpts, bool en)
57{
58}
59
60static inline s64 am65_cpts_ns_gettime(struct am65_cpts *cpts)
61{
62	return 0;
63}
64
65static inline int am65_cpts_estf_enable(struct am65_cpts *cpts, int idx,
66					struct am65_cpts_estf_cfg *cfg)
67{
68	return 0;
69}
70
71static inline void am65_cpts_estf_disable(struct am65_cpts *cpts, int idx)
72{
73}
74
75static inline void am65_cpts_suspend(struct am65_cpts *cpts)
76{
77}
78
79static inline void am65_cpts_resume(struct am65_cpts *cpts)
80{
81}
82#endif
83
84#endif /* K3_CPTS_H_ */