From 9028ad5d713baaf7c44c699e515e40eb6ccdf475 Mon Sep 17 00:00:00 2001 From: Tomasz Leman Date: Tue, 18 Apr 2023 10:46:32 +0200 Subject: [PATCH] drivers: gpdma: pm runtime works only on ace CAVS platforms are not fully integrated with zephyr. Some of the registers are still programed from SOF side. This feature can be enabled for those platforms later when integration is fully done. Signed-off-by: Tomasz Leman --- drivers/dma/dma_intel_adsp_gpdma.c | 8 ++++---- dts/xtensa/intel/intel_adsp_ace15_mtpm.dtsi | 3 +++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/dma/dma_intel_adsp_gpdma.c b/drivers/dma/dma_intel_adsp_gpdma.c index aac8e221a2ee0b..be24c302a6461f 100644 --- a/drivers/dma/dma_intel_adsp_gpdma.c +++ b/drivers/dma/dma_intel_adsp_gpdma.c @@ -162,7 +162,7 @@ static int intel_adsp_gpdma_config(const struct device *dev, uint32_t channel, static int intel_adsp_gpdma_start(const struct device *dev, uint32_t channel) { int ret = 0; -#if CONFIG_PM_DEVICE +#if CONFIG_PM_DEVICE && CONFIG_SOC_SERIES_INTEL_ACE bool first_use = false; enum pm_device_state state; @@ -187,7 +187,7 @@ static int intel_adsp_gpdma_start(const struct device *dev, uint32_t channel) intel_adsp_gpdma_llp_disable(dev, channel); } -#if CONFIG_PM_DEVICE +#if CONFIG_PM_DEVICE && CONFIG_SOC_SERIES_INTEL_ACE /* Device usage is counted by the calls of dw_dma_start and dw_dma_stop. For the first use, * we need to make sure that the pm_device_runtime_get and pm_device_runtime_put functions * calls are balanced. @@ -433,14 +433,14 @@ int intel_adsp_gpdma_init(const struct device *dev) dev_data->dma_ctx.magic = DMA_MAGIC; dev_data->dma_ctx.dma_channels = DW_MAX_CHAN; dev_data->dma_ctx.atomic = dev_data->channels_atomic; -#if CONFIG_PM_DEVICE +#if CONFIG_PM_DEVICE && CONFIG_SOC_SERIES_INTEL_ACE if (pm_device_on_power_domain(dev)) { pm_device_init_off(dev); } else { pm_device_init_suspended(dev); } - return pm_device_runtime_enable(dev); + return 0; #else return intel_adsp_gpdma_power_on(dev); #endif diff --git a/dts/xtensa/intel/intel_adsp_ace15_mtpm.dtsi b/dts/xtensa/intel/intel_adsp_ace15_mtpm.dtsi index 671b4e99d26efa..a786f493296b8c 100644 --- a/dts/xtensa/intel/intel_adsp_ace15_mtpm.dtsi +++ b/dts/xtensa/intel/intel_adsp_ace15_mtpm.dtsi @@ -562,6 +562,7 @@ dma-copy-alignment = <4>; status = "okay"; power-domain = <&hub_ulp_domain>; + zephyr,pm-device-runtime-auto; }; lpgpdma1: dma@7d000 { @@ -575,6 +576,7 @@ dma-copy-alignment = <4>; status = "okay"; power-domain = <&io0_domain>; + zephyr,pm-device-runtime-auto; }; lpgpdma2: dma@7e000 { @@ -588,6 +590,7 @@ dma-copy-alignment = <4>; power-domain = <&io0_domain>; status = "okay"; + zephyr,pm-device-runtime-auto; }; sha: adsp-sha@17df00 {