blob: 10ef2aff77dbc9bec7c1785960f72e143f6f0ee9 [file] [log] [blame]
Satyajit Desai3d577e82016-10-27 14:07:02 -07001/* Copyright (c) 2013-2014, 2016 The Linux Foundation. All rights reserved.
2 *
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.
6 *
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.
11 */
12
13#ifndef _LINUX_CORESIGHT_CTI_H
14#define _LINUX_CORESIGHT_CTI_H
15
16#include <linux/list.h>
17
18struct coresight_cti_data {
19 int nr_ctis;
20 const char **names;
21};
22
23struct coresight_cti {
24 const char *name;
25 struct list_head link;
26};
27
28#ifdef CONFIG_CORESIGHT_CTI
29extern struct coresight_cti *coresight_cti_get(const char *name);
30extern void coresight_cti_put(struct coresight_cti *cti);
31extern int coresight_cti_map_trigin(
32 struct coresight_cti *cti, int trig, int ch);
33extern int coresight_cti_map_trigout(
34 struct coresight_cti *cti, int trig, int ch);
35extern void coresight_cti_unmap_trigin(
36 struct coresight_cti *cti, int trig, int ch);
37extern void coresight_cti_unmap_trigout(
38 struct coresight_cti *cti, int trig, int ch);
39extern void coresight_cti_reset(struct coresight_cti *cti);
40extern int coresight_cti_set_trig(struct coresight_cti *cti, int ch);
41extern void coresight_cti_clear_trig(struct coresight_cti *cti, int ch);
42extern int coresight_cti_pulse_trig(struct coresight_cti *cti, int ch);
43extern int coresight_cti_enable_gate(struct coresight_cti *cti, int ch);
44extern void coresight_cti_disable_gate(struct coresight_cti *cti, int ch);
45extern void coresight_cti_ctx_save(void);
46extern void coresight_cti_ctx_restore(void);
47extern int coresight_cti_ack_trig(struct coresight_cti *cti, int trig);
48#else
49static inline struct coresight_cti *coresight_cti_get(const char *name)
50{
51 return NULL;
52}
53static inline void coresight_cti_put(struct coresight_cti *cti) {}
54static inline int coresight_cti_map_trigin(
55 struct coresight_cti *cti, int trig, int ch)
56{
57 return -ENODEV;
58}
59static inline int coresight_cti_map_trigout(
60 struct coresight_cti *cti, int trig, int ch)
61{
62 return -ENODEV;
63}
64static inline void coresight_cti_unmap_trigin(
65 struct coresight_cti *cti, int trig, int ch) {}
66static inline void coresight_cti_unmap_trigout(
67 struct coresight_cti *cti, int trig, int ch) {}
68static inline void coresight_cti_reset(struct coresight_cti *cti) {}
69static inline int coresight_cti_set_trig(struct coresight_cti *cti, int ch)
70{
71 return -ENODEV;
72}
73static inline void coresight_cti_clear_trig(struct coresight_cti *cti, int ch)
74{}
75static inline int coresight_cti_pulse_trig(struct coresight_cti *cti, int ch)
76{
77 return -ENODEV;
78}
79static inline int coresight_cti_enable_gate(struct coresight_cti *cti, int ch)
80{
81 return -ENODEV;
82}
83static inline void coresight_cti_disable_gate(struct coresight_cti *cti, int ch)
84{}
85static inline void coresight_cti_ctx_save(void){}
86static inline void coresight_cti_ctx_restore(void){}
87static inline int coresight_cti_ack_trig(struct coresight_cti *cti, int trig)
88{
89 return -ENODEV;
90}
91#endif
92
93#endif