pm-trace.h 940 Bytes
Newer Older
1
/* SPDX-License-Identifier: GPL-2.0 */
2 3
#ifndef PM_TRACE_H
#define PM_TRACE_H
4

5
#include <linux/types.h>
6
#ifdef CONFIG_PM_TRACE
7
#include <asm/pm-trace.h>
8

9
extern int pm_trace_enabled;
10 11 12 13 14 15
extern bool pm_trace_rtc_abused;

static inline bool pm_trace_rtc_valid(void)
{
	return !pm_trace_rtc_abused;
}
16

17 18 19 20 21
static inline int pm_trace_is_enabled(void)
{
       return pm_trace_enabled;
}

22 23
struct device;
extern void set_trace_device(struct device *);
24
extern void generate_pm_trace(const void *tracedata, unsigned int user);
25
extern int show_trace_dev_match(char *buf, size_t size);
26

Nigel Cunningham's avatar
Nigel Cunningham committed
27 28 29 30
#define TRACE_DEVICE(dev) do { \
	if (pm_trace_enabled) \
		set_trace_device(dev); \
	} while(0)
31 32 33

#else

34
static inline bool pm_trace_rtc_valid(void) { return true; }
35 36
static inline int pm_trace_is_enabled(void) { return 0; }

37 38
#define TRACE_DEVICE(dev) do { } while (0)
#define TRACE_RESUME(dev) do { } while (0)
39
#define TRACE_SUSPEND(dev) do { } while (0)
40 41 42 43

#endif

#endif