File: am65-cpts.h

package info (click to toggle)
linux 6.1.4-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,532,052 kB
  • sloc: ansic: 23,400,063; asm: 266,720; sh: 108,896; makefile: 49,712; python: 36,925; perl: 36,810; cpp: 6,044; yacc: 4,904; lex: 2,722; awk: 1,440; ruby: 25; sed: 5
file content (74 lines) | stat: -rw-r--r-- 1,795 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
/* SPDX-License-Identifier: GPL-2.0+ */
/* TI K3 AM65 CPTS driver interface
 *
 * Copyright (C) 2020 Texas Instruments Incorporated - http://www.ti.com
 */

#ifndef K3_CPTS_H_
#define K3_CPTS_H_

#include <linux/device.h>
#include <linux/of.h>

struct am65_cpts;

struct am65_cpts_estf_cfg {
	u64 ns_period;
	u64 ns_start;
};

#if IS_ENABLED(CONFIG_TI_K3_AM65_CPTS)
struct am65_cpts *am65_cpts_create(struct device *dev, void __iomem *regs,
				   struct device_node *node);
int am65_cpts_phc_index(struct am65_cpts *cpts);
void am65_cpts_tx_timestamp(struct am65_cpts *cpts, struct sk_buff *skb);
void am65_cpts_prep_tx_timestamp(struct am65_cpts *cpts, struct sk_buff *skb);
void am65_cpts_rx_enable(struct am65_cpts *cpts, bool en);
u64 am65_cpts_ns_gettime(struct am65_cpts *cpts);
int am65_cpts_estf_enable(struct am65_cpts *cpts, int idx,
			  struct am65_cpts_estf_cfg *cfg);
void am65_cpts_estf_disable(struct am65_cpts *cpts, int idx);
#else
static inline struct am65_cpts *am65_cpts_create(struct device *dev,
						 void __iomem *regs,
						 struct device_node *node)
{
	return ERR_PTR(-EOPNOTSUPP);
}

static inline int am65_cpts_phc_index(struct am65_cpts *cpts)
{
	return -1;
}

static inline void am65_cpts_tx_timestamp(struct am65_cpts *cpts,
					  struct sk_buff *skb)
{
}

static inline void am65_cpts_prep_tx_timestamp(struct am65_cpts *cpts,
					       struct sk_buff *skb)
{
}

static inline void am65_cpts_rx_enable(struct am65_cpts *cpts, bool en)
{
}

static inline s64 am65_cpts_ns_gettime(struct am65_cpts *cpts)
{
	return 0;
}

static inline int am65_cpts_estf_enable(struct am65_cpts *cpts, int idx,
					struct am65_cpts_estf_cfg *cfg)
{
	return 0;
}

static inline void am65_cpts_estf_disable(struct am65_cpts *cpts, int idx)
{
}
#endif

#endif /* K3_CPTS_H_ */