1 /* Copyright (c) 2013-2014, The Linux Foundation. All rights reserved.
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License version 2 and
5 * only version 2 as published by the Free Software Foundation.
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
13 #ifndef _LINUX_CORESIGHT_CTI_H
14 #define _LINUX_CORESIGHT_CTI_H
16 #include <linux/list.h>
18 struct coresight_cti_data {
23 struct coresight_cti {
25 struct list_head link;
28 #ifdef CONFIG_CORESIGHT_CTI
29 extern struct coresight_cti *coresight_cti_get(const char *name);
30 extern void coresight_cti_put(struct coresight_cti *cti);
31 extern int coresight_cti_map_trigin(
32 struct coresight_cti *cti, int trig, int ch);
33 extern int coresight_cti_map_trigout(
34 struct coresight_cti *cti, int trig, int ch);
35 extern void coresight_cti_unmap_trigin(
36 struct coresight_cti *cti, int trig, int ch);
37 extern void coresight_cti_unmap_trigout(
38 struct coresight_cti *cti, int trig, int ch);
39 extern void coresight_cti_reset(struct coresight_cti *cti);
40 extern int coresight_cti_set_trig(struct coresight_cti *cti, int ch);
41 extern void coresight_cti_clear_trig(struct coresight_cti *cti, int ch);
42 extern int coresight_cti_pulse_trig(struct coresight_cti *cti, int ch);
43 extern int coresight_cti_enable_gate(struct coresight_cti *cti, int ch);
44 extern void coresight_cti_disable_gate(struct coresight_cti *cti, int ch);
45 extern void coresight_cti_ctx_save(void);
46 extern void coresight_cti_ctx_restore(void);
47 extern int coresight_cti_ack_trig(struct coresight_cti *cti, int trig);
49 static inline struct coresight_cti *coresight_cti_get(const char *name)
53 static inline void coresight_cti_put(struct coresight_cti *cti) {}
54 static inline int coresight_cti_map_trigin(
55 struct coresight_cti *cti, int trig, int ch)
59 static inline int coresight_cti_map_trigout(
60 struct coresight_cti *cti, int trig, int ch)
64 static inline void coresight_cti_unmap_trigin(
65 struct coresight_cti *cti, int trig, int ch) {}
66 static inline void coresight_cti_unmap_trigout(
67 struct coresight_cti *cti, int trig, int ch) {}
68 static inline void coresight_cti_reset(struct coresight_cti *cti) {}
69 static inline int coresight_cti_set_trig(struct coresight_cti *cti, int ch)
73 static inline void coresight_cti_clear_trig(struct coresight_cti *cti, int ch)
75 static inline int coresight_cti_pulse_trig(struct coresight_cti *cti, int ch)
79 static inline int coresight_cti_enable_gate(struct coresight_cti *cti, int ch)
83 static inline void coresight_cti_disable_gate(struct coresight_cti *cti, int ch)
85 static inline void coresight_cti_ctx_save(void){}
86 static inline void coresight_cti_ctx_restore(void){}
87 static inline int coresight_cti_ack_trig(struct coresight_cti *cti, int trig)