summaryrefslogtreecommitdiff
path: root/arch/arm/mach-tegra/tegra3_throttle.c
diff options
context:
space:
mode:
authorDiwakar Tundlam <dtundlam@nvidia.com>2014-01-23 17:51:37 -0800
committerDiwakar Tundlam <dtundlam@nvidia.com>2014-02-26 16:34:30 -0800
commita77dac4ed2a3dd23baa963f73df52c5df809ac5e (patch)
treef0c38ab1812a62c12ae181581dd108accef2872c /arch/arm/mach-tegra/tegra3_throttle.c
parent07c0ecf40e839bf1deaf83e25d005ad1bb646346 (diff)
arm: tegra13: thermal: enable sensor and throttle
For T132 based 'bowmore' and 'norrin' platforms: Modified board and dts file modified to detect I2C thermal sensor. Enable balanced thermal throttling using old T12x tables. Bug 1408640 Change-Id: Ic0ff94f048b7a27fe98ce02a4a9775e4ebd1577e Signed-off-by: Diwakar Tundlam <dtundlam@nvidia.com>
Diffstat (limited to 'arch/arm/mach-tegra/tegra3_throttle.c')
-rw-r--r--arch/arm/mach-tegra/tegra3_throttle.c36
1 files changed, 20 insertions, 16 deletions
diff --git a/arch/arm/mach-tegra/tegra3_throttle.c b/arch/arm/mach-tegra/tegra3_throttle.c
index 879c52c310c0..b9a81f3e45cd 100644
--- a/arch/arm/mach-tegra/tegra3_throttle.c
+++ b/arch/arm/mach-tegra/tegra3_throttle.c
@@ -1,20 +1,19 @@
/*
* arch/arm/mach-tegra/tegra3_throttle.c
*
- * Copyright (c) 2011-2013, NVIDIA CORPORATION. All rights reserved.
+ * Copyright (c) 2011-2014, NVIDIA CORPORATION. All rights reserved.
*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
+ * 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 that it will be useful, but WITHOUT
+ * 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.
*
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <linux/kernel.h>
@@ -326,22 +325,23 @@ struct thermal_cooling_device *balanced_throttle_register(
list_add(&bthrot->node, &bthrot_list);
mutex_unlock(&bthrot_list_lock);
+#ifdef CONFIG_DEBUG_FS
+ sprintf(name, "throttle_table%d", num_throt);
+ if (!throttle_debugfs_root || IS_ERR_OR_NULL(
+ debugfs_create_file(name, 0644, throttle_debugfs_root,
+ bthrot, &table_fops)))
+ return -EINVAL;
+#endif
+
bthrot->cdev = thermal_cooling_device_register(
type,
bthrot,
&tegra_throttle_cooling_ops);
-
if (IS_ERR(bthrot->cdev)) {
bthrot->cdev = NULL;
return ERR_PTR(-ENODEV);
}
-#ifdef CONFIG_DEBUG_FS
- sprintf(name, "throttle_table%d", num_throt);
- debugfs_create_file(name,0644, throttle_debugfs_root,
- bthrot, &table_fops);
-#endif
-
return bthrot->cdev;
}
@@ -360,8 +360,12 @@ int __init tegra_throttle_init(struct mutex *cpu_lock)
cpu_freq_table[table_data->throttle_lowest_index].frequency;
cpu_throttle_lock = cpu_lock;
+
#ifdef CONFIG_DEBUG_FS
- throttle_debugfs_root = debugfs_create_dir("tegra_throttle", 0);
+ throttle_debugfs_root = debugfs_create_dir("tegra_throttle", NULL);
+ if (IS_ERR_OR_NULL(throttle_debugfs_root))
+ pr_err("%s: debugfs_create_dir 'tegra_throttle' FAILED.\n",
+ __func__);
#endif
for (i = 0; i < ARRAY_SIZE(cap_freqs_table); i++) {