diff mbox

[1/6] ARM: tegra: fuse: add functions to read speedo ID and process ID

Message ID 20131219123639.3226.75285.stgit@tamien (mailing list archive)
State New, archived
Headers show

Commit Message

Paul Walmsley Dec. 19, 2013, 12:36 p.m. UTC
From: Danny Huang <dahuang@nvidia.com>

Add functions to read the speedo and process id of both the CPU and the SoC.
There might be some drivers need the information as well.

Signed-off-by: Danny Huang <dahuang@nvidia.com>
[pwalmsley@nvidia.com: cleaned up the patch description; removed functions
 not used by the DFLL code for now]
Signed-off-by: Paul Walmsley <pwalmsley@nvidia.com>
---
 arch/arm/mach-tegra/fuse.c |   15 +++++++++++++++
 include/linux/tegra-soc.h  |    4 +++-
 2 files changed, 18 insertions(+), 1 deletion(-)

Comments

Stephen Warren Dec. 19, 2013, 11:09 p.m. UTC | #1
On 12/19/2013 05:36 AM, Paul Walmsley wrote:
> From: Danny Huang <dahuang@nvidia.com>
> 
> Add functions to read the speedo and process id of both the CPU and the SoC.
> There might be some drivers need the information as well.

> diff --git a/arch/arm/mach-tegra/fuse.c b/arch/arm/mach-tegra/fuse.c

> +int tegra_get_cpu_process_id(void)
> +{
> +	return tegra_cpu_process_id;
> +}
> +EXPORT_SYMBOL(tegra_get_cpu_process_id);
> +
> +int tegra_get_cpu_speedo_id(void)
> +{
> +	if (tegra_chip_id == TEGRA20)
> +		return -EINVAL;
> +
> +	return tegra_cpu_speedo_id;
> +}

Olof specifically went through the code and removed such functions in
the past. He argued that consumers of this data should just read those
tegra_cpu_process_id/... variables directly instead.
diff mbox

Patch

diff --git a/arch/arm/mach-tegra/fuse.c b/arch/arm/mach-tegra/fuse.c
index c9ac23b385be..e3ca8abe858f 100644
--- a/arch/arm/mach-tegra/fuse.c
+++ b/arch/arm/mach-tegra/fuse.c
@@ -250,3 +250,18 @@  void __init tegra_init_fuse(void)
 		tegra_sku_id, tegra_cpu_process_id,
 		tegra_core_process_id);
 }
+
+int tegra_get_cpu_process_id(void)
+{
+	return tegra_cpu_process_id;
+}
+EXPORT_SYMBOL(tegra_get_cpu_process_id);
+
+int tegra_get_cpu_speedo_id(void)
+{
+	if (tegra_chip_id == TEGRA20)
+		return -EINVAL;
+
+	return tegra_cpu_speedo_id;
+}
+EXPORT_SYMBOL(tegra_get_cpu_speedo_id);
diff --git a/include/linux/tegra-soc.h b/include/linux/tegra-soc.h
index 95f611d78f3a..ec856fdf2ce7 100644
--- a/include/linux/tegra-soc.h
+++ b/include/linux/tegra-soc.h
@@ -1,5 +1,5 @@ 
 /*
- * Copyright (c) 2012, NVIDIA CORPORATION.  All rights reserved.
+ * Copyright (c) 2012-2013 NVIDIA CORPORATION.  All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
@@ -18,5 +18,7 @@ 
 #define __LINUX_TEGRA_SOC_H_
 
 u32 tegra_read_chipid(void);
+int tegra_get_cpu_process_id(void);
+int tegra_get_cpu_speedo_id(void);
 
 #endif /* __LINUX_TEGRA_SOC_H_ */