power_domain: intel_adsp: Use register definitions

Make it a little bit easier to read using already existent
definitions for the registers used here.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
This commit is contained in:
Flavio Ceolin 2024-03-19 21:40:52 +00:00 committed by Maureen Helm
commit 693b65583c

View file

@ -8,6 +8,7 @@
#include <zephyr/pm/device.h> #include <zephyr/pm/device.h>
#include <zephyr/pm/device_runtime.h> #include <zephyr/pm/device_runtime.h>
#include <adsp_shim.h> #include <adsp_shim.h>
#include <adsp_power.h>
#if CONFIG_SOC_INTEL_ACE15_MTPM #if CONFIG_SOC_INTEL_ACE15_MTPM
#include <adsp_power.h> #include <adsp_power.h>
@ -27,10 +28,10 @@ static int pd_intel_adsp_set_power_enable(struct pg_bits *bits, bool power_enabl
uint16_t SPA_bit_mask = BIT(bits->SPA_bit); uint16_t SPA_bit_mask = BIT(bits->SPA_bit);
if (power_enable) { if (power_enable) {
sys_write16(sys_read16((mem_addr_t)&ACE_DfPMCCU.dfpwrctl) | SPA_bit_mask, sys_write16(sys_read16((mem_addr_t)ACE_PWRCTL) | SPA_bit_mask,
(mem_addr_t)&ACE_DfPMCCU.dfpwrctl); (mem_addr_t)ACE_PWRCTL);
if (!WAIT_FOR(sys_read16((mem_addr_t)&ACE_DfPMCCU.dfpwrsts) & BIT(bits->CPA_bit), if (!WAIT_FOR(sys_read16((mem_addr_t)ACE_PWRSTS) & BIT(bits->CPA_bit),
10000, k_busy_wait(1))) { 10000, k_busy_wait(1))) {
return -EIO; return -EIO;
} }
@ -46,8 +47,8 @@ static int pd_intel_adsp_set_power_enable(struct pg_bits *bits, bool power_enabl
return -EINVAL; return -EINVAL;
} }
#endif #endif
sys_write16(sys_read16((mem_addr_t)&ACE_DfPMCCU.dfpwrctl) & ~(SPA_bit_mask), sys_write16(sys_read16((mem_addr_t)ACE_PWRCTL) & ~(SPA_bit_mask),
(mem_addr_t)&ACE_DfPMCCU.dfpwrctl); (mem_addr_t)ACE_PWRCTL);
} }
return 0; return 0;