Skip to content

Commit 9b5c9b4

Browse files
committed
Signed-off-by: JairGudino <ramonjair.gudino@nxp.com>
drivers: actuator: dac_mcux_gau: Add PM3 support PM3 support to the rw61x in the dac driver added
1 parent 16e180a commit 9b5c9b4

File tree

2 files changed

+8
-19
lines changed

2 files changed

+8
-19
lines changed

drivers/dac/dac_mcux_gau.c

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
/*
2-
* Copyright 2023 NXP
2+
* Copyright 2023, 2025 NXP
33
*
44
* SPDX-License-Identifier: Apache-2.0
55
*/
66

77
#define DT_DRV_COMPAT nxp_gau_dac
88

99
#include <zephyr/drivers/dac.h>
10-
1110
#include <fsl_dac.h>
1211
#include "fsl_clock.h"
1312
#define LOG_LEVEL CONFIG_DAC_LOG_LEVEL
@@ -51,10 +50,8 @@ static int nxp_gau_dac_channel_setup(const struct device *dev,
5150
dac_channel_config_t dac_channel_config = {0};
5251
bool use_internal = true;
5352

54-
pm_policy_state_lock_get(PM_STATE_STANDBY, PM_ALL_SUBSTATES); //Lock the PM MODE 3
55-
pm_policy_state_lock_get(PM_STATE_SUSPEND_TO_IDLE, PM_ALL_SUBSTATES); //Lock the PM MODE 2
56-
pm_policy_state_lock_get(PM_STATE_RUNTIME_IDLE, PM_ALL_SUBSTATES); //Lock the PM MODE 1
57-
53+
pm_policy_device_power_lock_get(dev);/*Lock the PM states*/
54+
5855
if (channel_cfg->resolution != 10) {
5956
LOG_ERR("DAC only support 10 bit resolution");
6057
return -EINVAL;
@@ -143,29 +140,20 @@ static int nxp_gau_dac_init_common(const struct device *dev)
143140
int nxp_gau_deinit(const struct device *dev){
144141
const struct nxp_gau_dac_config *config = dev->config;
145142
DAC_Deinit(config->base);
146-
147-
pm_policy_state_lock_put(PM_STATE_STANDBY, PM_ALL_SUBSTATES); //Lock the PM MODE 3
148-
pm_policy_state_lock_put(PM_STATE_SUSPEND_TO_IDLE, PM_ALL_SUBSTATES); //Lock the PM MODE 2
149-
pm_policy_state_lock_put(PM_STATE_RUNTIME_IDLE, PM_ALL_SUBSTATES); //Lock the PM MODE 1
143+
144+
pm_policy_device_power_lock_put(dev); /*Free the PM states*/
150145
return 0;
151146
}
152147

153148
static int dac_mcux_pm_action(const struct device *dev, enum pm_device_action action)
154-
{ static const struct dac_channel_cfg dac_ch_cfg_pm = {
155-
.channel_id = DAC_CHANNEL_ID_RESTORE,
156-
.resolution = DAC_RESOLUTION_RESTORE,
157-
.buffered = true
158-
};
159-
149+
{
160150
switch (action) {
161151
case PM_DEVICE_ACTION_RESUME:
162-
break;
163152
case PM_DEVICE_ACTION_SUSPEND:
164-
break;
165153
case PM_DEVICE_ACTION_TURN_OFF:
166154
break;
167155
case PM_DEVICE_ACTION_TURN_ON:
168-
nxp_gau_dac_init_common(dev);
156+
nxp_gau_dac_init_common(dev);
169157
break;
170158
default:
171159
return -ENOTSUP;

dts/arm/nxp/nxp_rw6xx_common.dtsi

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -565,6 +565,7 @@
565565
interrupts = <108 0>;
566566
status = "disabled";
567567
#io-channel-cells = <0>;
568+
zephyr,disabling-power-states = <&suspend &standby>;
568569
power-domains = <&power_mode3_domain>;
569570
};
570571
};

0 commit comments

Comments
 (0)