pm_runtime: cavs: make private data shared

Allocates cavs_pm_runtime_data as shared to make it usable
by multicore code.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
This commit is contained in:
Tomasz Lauda 2020-04-06 13:52:00 +02:00 committed by Janusz Jankowski
parent e2edd5be5b
commit a70326a8de
1 changed files with 7 additions and 2 deletions

View File

@ -81,16 +81,20 @@ static inline void cavs_pm_runtime_enable_dsp(bool enable)
irq_local_enable(flags);
trace_power("pm_runtime_enable_dsp dsp_d0_sref %d", pprd->dsp_d0_sref);
platform_shared_commit(pprd, sizeof(*pprd));
}
static inline bool cavs_pm_runtime_is_active_dsp(void)
{
struct pm_runtime_data *prd = pm_runtime_data_get();
struct cavs_pm_runtime_data *pprd = prd->platform_data;
int is_active = pprd->dsp_d0_sref > 0;
platform_shared_commit(prd, sizeof(*prd));
platform_shared_commit(pprd, sizeof(*pprd));
return pprd->dsp_d0_sref > 0;
return is_active;
}
#if CONFIG_CAVS_SSP
@ -368,7 +372,8 @@ void platform_pm_runtime_init(struct pm_runtime_data *prd)
{
struct cavs_pm_runtime_data *pprd;
pprd = rzalloc(SOF_MEM_ZONE_SYS, 0, SOF_MEM_CAPS_RAM, sizeof(*pprd));
pprd = rzalloc(SOF_MEM_ZONE_SYS, SOF_MEM_FLAG_SHARED, SOF_MEM_CAPS_RAM,
sizeof(*pprd));
prd->platform_data = pprd;
}