summaryrefslogtreecommitdiff
path: root/drivers/misc/tegra-profiler/tegra.h
blob: 013c5abd644fba43a61b2911cc65e2c29a817682 (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
/*
 * drivers/misc/tegra-profiler/tegra.h
 *
 * Copyright (c) 2013, NVIDIA CORPORATION.  All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms and conditions of the GNU General Public License,
 * version 2, as published by the Free Software Foundation.
 *
 * This program is distributed in the hope it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
 * more details.
 *
 */

#ifndef __QUADD_TEGRA_H
#define __QUADD_TEGRA_H

#include <linux/smp.h>

#ifdef CONFIG_TEGRA_CLUSTER_CONTROL
#include <linux/io.h>
#include <../../mach-tegra/pm.h>
#endif

static inline int quadd_get_processor_id(void)
{
	int cpu_id = smp_processor_id();

#ifdef CONFIG_TEGRA_CLUSTER_CONTROL
	if (is_lp_cluster())
		cpu_id |= QM_TEGRA_POWER_CLUSTER_LP;
#endif

	return cpu_id;
}

static inline int quadd_is_cpu_with_lp_cluster(void)
{
#ifdef CONFIG_TEGRA_CLUSTER_CONTROL
	return 1;
#else
	return 0;
#endif
}

#endif  /* __QUADD_TEGRA_H */