Pratik Patel | d944cc7 | 2013-02-08 11:52:12 -0800 | [diff] [blame] | 1 | /* Copyright (c) 2013, 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 | struct coresight_cti_data { |
| 17 | int nr_ctis; |
| 18 | const char **names; |
| 19 | }; |
| 20 | |
| 21 | struct coresight_cti { |
| 22 | const char *name; |
| 23 | struct list_head link; |
| 24 | }; |
| 25 | |
| 26 | #ifdef CONFIG_CORESIGHT_CTI |
| 27 | extern struct coresight_cti *coresight_cti_get(const char *name); |
| 28 | extern void coresight_cti_put(struct coresight_cti *cti); |
| 29 | extern int coresight_cti_map_trigin( |
| 30 | struct coresight_cti *cti, int trig, int ch); |
| 31 | extern int coresight_cti_map_trigout( |
| 32 | struct coresight_cti *cti, int trig, int ch); |
| 33 | extern void coresight_cti_unmap_trigin( |
| 34 | struct coresight_cti *cti, int trig, int ch); |
| 35 | extern void coresight_cti_unmap_trigout( |
| 36 | struct coresight_cti *cti, int trig, int ch); |
| 37 | #else |
| 38 | static inline struct coresight_cti *coresight_cti_get(const char *name) |
| 39 | { |
| 40 | return NULL; |
| 41 | } |
| 42 | static inline void coresight_cti_put(struct coresight_cti *cti) {} |
| 43 | static inline int coresight_cti_map_trigin( |
| 44 | struct coresight_cti *cti, int trig, int ch) |
| 45 | { |
| 46 | return -ENOSYS; |
| 47 | } |
| 48 | static inline int coresight_cti_map_trigout( |
| 49 | struct coresight_cti *cti, int trig, int ch) |
| 50 | { |
| 51 | return -ENOSYS; |
| 52 | } |
| 53 | static inline void coresight_cti_unmap_trigin( |
| 54 | struct coresight_cti *cti, int trig, int ch) {} |
| 55 | static inline void coresight_cti_unmap_trigout( |
| 56 | struct coresight_cti *cti, int trig, int ch) {} |
| 57 | #endif |
| 58 | |
| 59 | #endif |