diff mbox series

[v4,36/38] platform/x86: intel_telemetry: Add telemetry_get_pltdata()

Message ID 20200121160114.60007-37-mika.westerberg@linux.intel.com (mailing list archive)
State Changes Requested, archived
Headers show
Series platform/x86: Rework intel_scu_ipc and intel_pmc_ipc drivers | expand

Commit Message

Mika Westerberg Jan. 21, 2020, 4:01 p.m. UTC
Add new function that allows telemetry modules to get pointer to the
platform specific configuration. This is needed to allow the telemetry
debugfs module to fetch PMC IPC instance in the subsequent patch.

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
---
 arch/x86/include/asm/intel_telemetry.h      |  1 +
 drivers/platform/x86/intel_telemetry_core.c | 12 ++++++++++++
 2 files changed, 13 insertions(+)

Comments

Andy Shevchenko Jan. 21, 2020, 6 p.m. UTC | #1
On Tue, Jan 21, 2020 at 07:01:12PM +0300, Mika Westerberg wrote:
> Add new function that allows telemetry modules to get pointer to the
> platform specific configuration. This is needed to allow the telemetry
> debugfs module to fetch PMC IPC instance in the subsequent patch.

One comment below.
After addressing,
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

> 
> Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
> ---
>  arch/x86/include/asm/intel_telemetry.h      |  1 +
>  drivers/platform/x86/intel_telemetry_core.c | 12 ++++++++++++
>  2 files changed, 13 insertions(+)
> 
> diff --git a/arch/x86/include/asm/intel_telemetry.h b/arch/x86/include/asm/intel_telemetry.h
> index e19deb776003..1335565c43b5 100644
> --- a/arch/x86/include/asm/intel_telemetry.h
> +++ b/arch/x86/include/asm/intel_telemetry.h
> @@ -99,6 +99,7 @@ int telemetry_set_pltdata(const struct telemetry_core_ops *ops,
>  int telemetry_clear_pltdata(void);
>  
>  int telemetry_pltconfig_valid(void);
> +struct telemetry_plt_config *telemetry_get_pltdata(void);
>  
>  int telemetry_get_evtname(enum telemetry_unit telem_unit,
>  			  const char **name, int len);
> diff --git a/drivers/platform/x86/intel_telemetry_core.c b/drivers/platform/x86/intel_telemetry_core.c
> index d4040bb222b4..e11b79d1b3a7 100644
> --- a/drivers/platform/x86/intel_telemetry_core.c
> +++ b/drivers/platform/x86/intel_telemetry_core.c
> @@ -369,6 +369,18 @@ int telemetry_pltconfig_valid(void)
>  }
>  EXPORT_SYMBOL_GPL(telemetry_pltconfig_valid);
>  
> +/**
> + * telemetry_get_pltdata() - Return telemetry platform config
> + *
> + * May be used by other telemetry modules to get platform specific
> + * configuration.
> + */
> +struct telemetry_plt_config *telemetry_get_pltdata(void)
> +{
> +	return telm_core_conf.plt_config;
> +}
> +EXPORT_SYMBOL_GPL(telemetry_get_pltdata);

Effectively this may replace telemetry_pltconfig_valid().

> +
>  static inline int telemetry_get_pssevtname(enum telemetry_unit telem_unit,
>  					   const char **name, int len)
>  {
> -- 
> 2.24.1
>
diff mbox series

Patch

diff --git a/arch/x86/include/asm/intel_telemetry.h b/arch/x86/include/asm/intel_telemetry.h
index e19deb776003..1335565c43b5 100644
--- a/arch/x86/include/asm/intel_telemetry.h
+++ b/arch/x86/include/asm/intel_telemetry.h
@@ -99,6 +99,7 @@  int telemetry_set_pltdata(const struct telemetry_core_ops *ops,
 int telemetry_clear_pltdata(void);
 
 int telemetry_pltconfig_valid(void);
+struct telemetry_plt_config *telemetry_get_pltdata(void);
 
 int telemetry_get_evtname(enum telemetry_unit telem_unit,
 			  const char **name, int len);
diff --git a/drivers/platform/x86/intel_telemetry_core.c b/drivers/platform/x86/intel_telemetry_core.c
index d4040bb222b4..e11b79d1b3a7 100644
--- a/drivers/platform/x86/intel_telemetry_core.c
+++ b/drivers/platform/x86/intel_telemetry_core.c
@@ -369,6 +369,18 @@  int telemetry_pltconfig_valid(void)
 }
 EXPORT_SYMBOL_GPL(telemetry_pltconfig_valid);
 
+/**
+ * telemetry_get_pltdata() - Return telemetry platform config
+ *
+ * May be used by other telemetry modules to get platform specific
+ * configuration.
+ */
+struct telemetry_plt_config *telemetry_get_pltdata(void)
+{
+	return telm_core_conf.plt_config;
+}
+EXPORT_SYMBOL_GPL(telemetry_get_pltdata);
+
 static inline int telemetry_get_pssevtname(enum telemetry_unit telem_unit,
 					   const char **name, int len)
 {