diff options
author | Xiao Bo Zhao <xiaoboz@nvidia.com> | 2012-07-19 19:56:28 -0700 |
---|---|---|
committer | Simone Willett <swillett@nvidia.com> | 2012-07-30 20:46:40 -0700 |
commit | 63e2ffbb48e8ad9639e3f01442802a326114b530 (patch) | |
tree | 11501323f05dc3ed4865bf198dfb977f33faf66c /arch/arm/mach-tegra/tegra3_speedo.c | |
parent | 4582bcef392ae029336673f5685a18fc67ac041a (diff) |
ARM: tegra: Added sysfs knob that checks app profile support
Currently app profile is only supported for AP37
hence added sysfs knob that uses cpu_speedo_id in
order to check app profile support
Bug 1003531
Change-Id: I12b9bc1700b3c925a1f1d51bb00584e7e5d6f0a3
Signed-off-by: Xiao Bo Zhao <xiaoboz@nvidia.com>
Reviewed-on: http://git-master/r/117852
Reviewed-by: Aleksandr Frid <afrid@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-by: Diwakar Tundlam <dtundlam@nvidia.com>
Diffstat (limited to 'arch/arm/mach-tegra/tegra3_speedo.c')
-rw-r--r-- | arch/arm/mach-tegra/tegra3_speedo.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/arch/arm/mach-tegra/tegra3_speedo.c b/arch/arm/mach-tegra/tegra3_speedo.c index 78afb2804088..2889f656f47a 100644 --- a/arch/arm/mach-tegra/tegra3_speedo.c +++ b/arch/arm/mach-tegra/tegra3_speedo.c @@ -1,7 +1,7 @@ /* * arch/arm/mach-tegra/tegra3_speedo.c * - * Copyright (c) 2011, NVIDIA Corporation. + * Copyright (c) 2011-2012, 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 @@ -23,6 +23,8 @@ #include <linux/err.h> #include <mach/iomap.h> #include <mach/tegra_fuse.h> +#include <linux/module.h> +#include <linux/moduleparam.h> #include "fuse.h" @@ -128,6 +130,11 @@ static int core_process_id; static int cpu_speedo_id; static int soc_speedo_id; static int package_id; +/* + * Only AP37 supports App Profile + * This informs user space of support without exposing cpu id's + */ +static int enable_app_profiles; static void fuse_speedo_calib(u32 *speedo_g, u32 *speedo_lp) { @@ -267,6 +274,7 @@ static void rev_sku_to_speedo_ids(int rev, int sku) cpu_speedo_id = 12; soc_speedo_id = 2; threshold_index = 9; + enable_app_profiles = 1; break; default: pr_err("Tegra3 Rev-A02: Reserved pkg: %d\n", @@ -560,3 +568,15 @@ int tegra_core_speedo_mv(void) BUG(); } } + +static int get_enable_app_profiles(char *val, const struct kernel_param *kp) +{ + return param_get_uint(val, kp); +} + +static struct kernel_param_ops tegra_profiles_ops = { + .get = get_enable_app_profiles, +}; + +module_param_cb(tegra_enable_app_profiles, + &tegra_profiles_ops, &enable_app_profiles, 0444); |