GNU Linux-libre 4.14.328-gnu1
[releases.git] / arch / metag / include / asm / da.h
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3  * Meta DA JTAG debugger control.
4  *
5  * Copyright 2012 Imagination Technologies Ltd.
6  */
7
8 #ifndef _METAG_DA_H_
9 #define _METAG_DA_H_
10
11 #ifdef CONFIG_METAG_DA
12
13 #include <linux/init.h>
14 #include <linux/types.h>
15
16 extern bool _metag_da_present;
17
18 /**
19  * metag_da_enabled() - Find whether a DA is currently enabled.
20  *
21  * Returns:     true if a DA was detected, false if not.
22  */
23 static inline bool metag_da_enabled(void)
24 {
25         return _metag_da_present;
26 }
27
28 /**
29  * metag_da_probe() - Try and detect a connected DA.
30  *
31  * This is used at start up to detect whether a DA is active.
32  *
33  * Returns:     0 on detection, -err otherwise.
34  */
35 int __init metag_da_probe(void);
36
37 #else /* !CONFIG_METAG_DA */
38
39 #define metag_da_enabled() false
40 #define metag_da_probe() do {} while (0)
41
42 #endif
43
44 #endif /* _METAG_DA_H_ */