aboutsummaryrefslogtreecommitdiff
path: root/arch/arm/mach-ux500/pm/cpuidle_dbg.h
blob: 406106038ada601d7d62f89481a26c438d01527e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
/*
 * Copyright (C) ST-Ericsson SA 2010-2011
 *
 * License Terms: GNU General Public License v2
 * Author: Rickard Andersson <rickard.andersson@stericsson.com> for ST-Ericsson
 *	   Jonas Aaberg <jonas.aberg@stericsson.com> for ST-Ericsson
 */

#ifndef CPUIDLE_DBG_H
#define CPUIDLE_DBG_H

#include "cpuidle.h"

#ifdef CONFIG_U8500_CPUIDLE_DEBUG
void ux500_ci_dbg_init(void);
void ux500_ci_dbg_remove(void);

void ux500_ci_dbg_log(int ctarget, ktime_t enter_time);
void ux500_ci_dbg_wake_latency(int ctarget, int sleep_time);
void ux500_ci_dbg_exit_latency(int ctarget, ktime_t now, ktime_t exit,
			       ktime_t enter, bool timed_out);

void ux500_ci_dbg_register_reason(int idx, bool power_state_req,
				  u32 sleep_time, u32 max_depth);

bool ux500_ci_dbg_force_ape_on(void);
int ux500_ci_dbg_deepest_state(void);

void ux500_ci_dbg_console(void);
void ux500_ci_dbg_console_check_uart(void);
void ux500_ci_dbg_console_handle_ape_resume(void);
void ux500_ci_dbg_console_handle_ape_suspend(void);

#else

static inline void ux500_ci_dbg_init(void) { }
static inline void ux500_ci_dbg_remove(void) { }

static inline void ux500_ci_dbg_log(int ctarget,
				    ktime_t enter_time) { }

static inline void ux500_ci_dbg_exit_latency(int ctarget,
					     ktime_t now, ktime_t exit,
					     ktime_t enter, bool timed_out) { }
static inline void ux500_ci_dbg_wake_latency(int ctarget, int sleep_time) { }


static inline void ux500_ci_dbg_register_reason(int idx, bool power_state_req,
						u32 sleep_time, u32 max_depth) { }

static inline bool ux500_ci_dbg_force_ape_on(void)
{
	return false;
}

static inline int ux500_ci_dbg_deepest_state(void)
{
	/* This means no lower sleep state than ApIdle */
	return CONFIG_U8500_CPUIDLE_DEEPEST_STATE;
}

static inline void ux500_ci_dbg_console(void) { }
static inline void ux500_ci_dbg_console_check_uart(void) { }
static inline void ux500_ci_dbg_console_handle_ape_resume(void) { }
static inline void ux500_ci_dbg_console_handle_ape_suspend(void) { }

#endif
#endif