Linux-libre 5.4.48-gnu
[librecmc/linux-libre.git] / arch / arm / mach-tegra / cpuidle.c
1 // SPDX-License-Identifier: GPL-2.0-or-later
2 /*
3  * arch/arm/mach-tegra/cpuidle.c
4  *
5  * CPU idle driver for Tegra CPUs
6  *
7  * Copyright (c) 2010-2012, NVIDIA Corporation.
8  * Copyright (c) 2011 Google, Inc.
9  * Author: Colin Cross <ccross@android.com>
10  *         Gary King <gking@nvidia.com>
11  *
12  * Rework for 3.3 by Peter De Schrijver <pdeschrijver@nvidia.com>
13  */
14
15 #include <linux/kernel.h>
16 #include <linux/module.h>
17
18 #include <soc/tegra/fuse.h>
19
20 #include "cpuidle.h"
21
22 void __init tegra_cpuidle_init(void)
23 {
24         switch (tegra_get_chip_id()) {
25         case TEGRA20:
26                 if (IS_ENABLED(CONFIG_ARCH_TEGRA_2x_SOC))
27                         tegra20_cpuidle_init();
28                 break;
29         case TEGRA30:
30                 if (IS_ENABLED(CONFIG_ARCH_TEGRA_3x_SOC))
31                         tegra30_cpuidle_init();
32                 break;
33         case TEGRA114:
34         case TEGRA124:
35                 if (IS_ENABLED(CONFIG_ARCH_TEGRA_114_SOC) ||
36                     IS_ENABLED(CONFIG_ARCH_TEGRA_124_SOC))
37                         tegra114_cpuidle_init();
38                 break;
39         }
40 }
41
42 void tegra_cpuidle_pcie_irqs_in_use(void)
43 {
44         switch (tegra_get_chip_id()) {
45         case TEGRA20:
46                 if (IS_ENABLED(CONFIG_ARCH_TEGRA_2x_SOC))
47                         tegra20_cpuidle_pcie_irqs_in_use();
48                 break;
49         }
50 }