aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-tegra/powergate.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-tegra/powergate.c')
-rw-r--r--arch/arm/mach-tegra/powergate.c43
1 files changed, 36 insertions, 7 deletions
diff --git a/arch/arm/mach-tegra/powergate.c b/arch/arm/mach-tegra/powergate.c
index 15d506501ccc..de0662de28a0 100644
--- a/arch/arm/mach-tegra/powergate.c
+++ b/arch/arm/mach-tegra/powergate.c
@@ -199,7 +199,9 @@ int __init tegra_powergate_init(void)
199 199
200#ifdef CONFIG_DEBUG_FS 200#ifdef CONFIG_DEBUG_FS
201 201
202static const char * const powergate_name[] = { 202static const char * const *powergate_name;
203
204static const char * const powergate_name_t20[] = {
203 [TEGRA_POWERGATE_CPU] = "cpu", 205 [TEGRA_POWERGATE_CPU] = "cpu",
204 [TEGRA_POWERGATE_3D] = "3d", 206 [TEGRA_POWERGATE_3D] = "3d",
205 [TEGRA_POWERGATE_VENC] = "venc", 207 [TEGRA_POWERGATE_VENC] = "venc",
@@ -209,6 +211,23 @@ static const char * const powergate_name[] = {
209 [TEGRA_POWERGATE_MPE] = "mpe", 211 [TEGRA_POWERGATE_MPE] = "mpe",
210}; 212};
211 213
214static const char * const powergate_name_t30[] = {
215 [TEGRA_POWERGATE_CPU] = "cpu0",
216 [TEGRA_POWERGATE_3D] = "3d0",
217 [TEGRA_POWERGATE_VENC] = "venc",
218 [TEGRA_POWERGATE_VDEC] = "vdec",
219 [TEGRA_POWERGATE_PCIE] = "pcie",
220 [TEGRA_POWERGATE_L2] = "l2",
221 [TEGRA_POWERGATE_MPE] = "mpe",
222 [TEGRA_POWERGATE_HEG] = "heg",
223 [TEGRA_POWERGATE_SATA] = "sata",
224 [TEGRA_POWERGATE_CPU1] = "cpu1",
225 [TEGRA_POWERGATE_CPU2] = "cpu2",
226 [TEGRA_POWERGATE_CPU3] = "cpu3",
227 [TEGRA_POWERGATE_CELP] = "celp",
228 [TEGRA_POWERGATE_3D1] = "3d1",
229};
230
212static int powergate_show(struct seq_file *s, void *data) 231static int powergate_show(struct seq_file *s, void *data)
213{ 232{
214 int i; 233 int i;
@@ -237,14 +256,24 @@ static const struct file_operations powergate_fops = {
237int __init tegra_powergate_debugfs_init(void) 256int __init tegra_powergate_debugfs_init(void)
238{ 257{
239 struct dentry *d; 258 struct dentry *d;
240 int err = -ENOMEM;
241 259
242 d = debugfs_create_file("powergate", S_IRUGO, NULL, NULL, 260 switch (tegra_chip_id) {
243 &powergate_fops); 261 case TEGRA20:
244 if (!d) 262 powergate_name = powergate_name_t20;
245 return -ENOMEM; 263 break;
264 case TEGRA30:
265 powergate_name = powergate_name_t30;
266 break;
267 }
268
269 if (powergate_name) {
270 d = debugfs_create_file("powergate", S_IRUGO, NULL, NULL,
271 &powergate_fops);
272 if (!d)
273 return -ENOMEM;
274 }
246 275
247 return err; 276 return 0;
248} 277}
249 278
250#endif 279#endif