arm: tegra: la: Add config option for latency allowance scaling
[linux-3.10.git] / arch / arm / mach-tegra / include / mach / latency_allowance.h
1 /*
2  * arch/arm/mach-tegra/include/mach/latency_allowance.h
3  *
4  * Copyright (C) 2011-2012, NVIDIA CORPORATION. All rights reserved.
5  *
6  * This software is licensed under the terms of the GNU General Public
7  * License version 2, as published by the Free Software Foundation, and
8  * may be copied, distributed, and modified under those terms.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  *
15  */
16
17 #ifndef _MACH_TEGRA_LATENCY_ALLOWANCE_H_
18 #define _MACH_TEGRA_LATENCY_ALLOWANCE_H_
19
20 enum tegra_la_id {
21         TEGRA_LA_AFIR = 0,                      /* T30 specific */
22         TEGRA_LA_AFIW,                          /* T30 specific */
23         TEGRA_LA_AVPC_ARM7R,
24         TEGRA_LA_AVPC_ARM7W,
25         TEGRA_LA_DISPLAY_0A,
26         TEGRA_LA_DISPLAY_0B,
27         TEGRA_LA_DISPLAY_0C,
28         TEGRA_LA_DISPLAY_1B,                    /* T30 specific */
29         TEGRA_LA_DISPLAY_HC,
30         TEGRA_LA_DISPLAY_0AB,
31         TEGRA_LA_DISPLAY_0BB,
32         TEGRA_LA_DISPLAY_0CB,
33         TEGRA_LA_DISPLAY_1BB,                   /* T30 specific */
34         TEGRA_LA_DISPLAY_HCB,
35         TEGRA_LA_EPPUP,
36         TEGRA_LA_EPPU,
37         TEGRA_LA_EPPV,
38         TEGRA_LA_EPPY,
39         TEGRA_LA_G2PR,
40         TEGRA_LA_G2SR,
41         TEGRA_LA_G2DR,
42         TEGRA_LA_G2DW,
43         TEGRA_LA_HOST1X_DMAR,
44         TEGRA_LA_HOST1XR,
45         TEGRA_LA_HOST1XW,
46         TEGRA_LA_HDAR,
47         TEGRA_LA_HDAW,
48         TEGRA_LA_ISPW,
49         TEGRA_LA_MPCORER,
50         TEGRA_LA_MPCOREW,
51         TEGRA_LA_MPCORE_LPR,
52         TEGRA_LA_MPCORE_LPW,
53         TEGRA_LA_MPE_UNIFBR,                    /* T30 specific */
54         TEGRA_LA_MPE_IPRED,                     /* T30 specific */
55         TEGRA_LA_MPE_AMEMRD,                    /* T30 specific */
56         TEGRA_LA_MPE_CSRD,                      /* T30 specific */
57         TEGRA_LA_MPE_UNIFBW,                    /* T30 specific */
58         TEGRA_LA_MPE_CSWR,                      /* T30 specific */
59         TEGRA_LA_FDCDRD,
60         TEGRA_LA_IDXSRD,
61         TEGRA_LA_TEXSRD,
62         TEGRA_LA_FDCDWR,
63         TEGRA_LA_FDCDRD2,
64         TEGRA_LA_IDXSRD2,                       /* T30 specific */
65         TEGRA_LA_TEXSRD2,                       /* T30 specific */
66         TEGRA_LA_FDCDWR2,
67         TEGRA_LA_PPCS_AHBDMAR,
68         TEGRA_LA_PPCS_AHBSLVR,
69         TEGRA_LA_PPCS_AHBDMAW,
70         TEGRA_LA_PPCS_AHBSLVW,
71         TEGRA_LA_PTCR,
72         TEGRA_LA_SATAR,                         /* T30 specific */
73         TEGRA_LA_SATAW,                         /* T30 specific */
74         TEGRA_LA_VDE_BSEVR,
75         TEGRA_LA_VDE_MBER,
76         TEGRA_LA_VDE_MCER,
77         TEGRA_LA_VDE_TPER,
78         TEGRA_LA_VDE_BSEVW,
79         TEGRA_LA_VDE_DBGW,
80         TEGRA_LA_VDE_MBEW,
81         TEGRA_LA_VDE_TPMW,
82         TEGRA_LA_VI_RUV,                        /* T30 specific */
83         TEGRA_LA_VI_WSB,
84         TEGRA_LA_VI_WU,
85         TEGRA_LA_VI_WV,
86         TEGRA_LA_VI_WY,
87
88         TEGRA_LA_MAX_ID
89 };
90
91 #if !defined(CONFIG_TEGRA_LATENCY_ALLOWANCE)
92 static inline int tegra_set_latency_allowance(enum tegra_la_id id,
93                                                 unsigned int bandwidth_in_mbps)
94 {
95         return 0;
96 }
97
98 static inline void tegra_latency_allowance_update_tick_length(
99                                                 unsigned int new_ns_per_tick)
100 {
101         return;
102 }
103 #else
104 int tegra_set_latency_allowance(enum tegra_la_id id,
105                                 unsigned int bandwidth_in_mbps);
106
107 void tegra_latency_allowance_update_tick_length(unsigned int new_ns_per_tick);
108 #endif
109
110 #if !defined(CONFIG_TEGRA_LATENCY_ALLOWANCE_SCALING)
111 static inline int tegra_enable_latency_scaling(enum tegra_la_id id,
112                                                 unsigned int threshold_low,
113                                                 unsigned int threshold_mid,
114                                                 unsigned int threshold_high)
115 {
116         return 0;
117 }
118
119 static inline void tegra_disable_latency_scaling(enum tegra_la_id id)
120 {
121 }
122 #else
123 int tegra_enable_latency_scaling(enum tegra_la_id id,
124                                     unsigned int threshold_low,
125                                     unsigned int threshold_mid,
126                                     unsigned int threshold_high);
127
128 void tegra_disable_latency_scaling(enum tegra_la_id id);
129 #endif
130
131 #endif /* _MACH_TEGRA_LATENCY_ALLOWANCE_H_ */