Skip to content

Commit 618e83e

Browse files
tmlemankartben
authored andcommitted
dai: intel: dmic: Refactor power management initialization
This patch refactors the power management initialization for the DMIC driver across ACE15, ACE20, and ACE30 generations to align with the recommended practices outlined in the documentation. The changes include: 1. Replacing the conditional initialization of power management state with a call to `pm_device_driver_init` in the `dai_dmic_initialize_device` function. 2. Adding the `zephyr,pm-device-runtime-auto` property to the DMIC nodes in the device tree files for ACE15, ACE20, and ACE30. These changes ensure that the DMIC driver is initialized with the appropriate power management state and that runtime power management is automatically enabled based on the device tree configuration. The functionality of the power management state remains unchanged, ensuring consistent behavior. Signed-off-by: Tomasz Leman <[email protected]>
1 parent fa4a9db commit 618e83e

File tree

5 files changed

+9
-6
lines changed

5 files changed

+9
-6
lines changed

drivers/dai/intel/dmic/dmic.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -895,13 +895,8 @@ static int dai_dmic_initialize_device(const struct device *dev)
895895
dai_dmic_irq_handler,
896896
DEVICE_DT_INST_GET(0),
897897
0);
898-
if (pm_device_on_power_domain(dev)) {
899-
pm_device_init_off(dev);
900-
} else {
901-
pm_device_init_suspended(dev);
902-
}
903898

904-
return pm_device_runtime_enable(dev);
899+
return pm_device_driver_init(dev, dmic_pm_action);
905900
};
906901

907902

dts/xtensa/intel/intel_adsp_ace15_mtpm.dtsi

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@
156156
interrupts = <0x08 0 0>;
157157
interrupt-parent = <&ace_intc>;
158158
power-domains = <&hub_ulp_domain>;
159+
zephyr,pm-device-runtime-auto;
159160
};
160161

161162
dmic1: dmic1@10000 {
@@ -166,6 +167,7 @@
166167
interrupts = <0x09 0 0>;
167168
interrupt-parent = <&ace_intc>;
168169
power-domains = <&hub_ulp_domain>;
170+
zephyr,pm-device-runtime-auto;
169171
};
170172

171173
/*

dts/xtensa/intel/intel_adsp_ace20_lnl.dtsi

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@
180180
fifo = <0x0008>;
181181
interrupts = <0x08 0 0>;
182182
interrupt-parent = <&ace_intc>;
183+
zephyr,pm-device-runtime-auto;
183184
};
184185

185186
dmic1: dai-dmic1@10100 {
@@ -189,6 +190,7 @@
189190
fifo = <0x0108>;
190191
interrupts = <0x08 0 0>;
191192
interrupt-parent = <&ace_intc>;
193+
zephyr,pm-device-runtime-auto;
192194
};
193195

194196
dmicvss: dmicvss@16000 {

dts/xtensa/intel/intel_adsp_ace30.dtsi

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@
170170
interrupts = <0x08 0 0>;
171171
interrupt-parent = <&ace_intc>;
172172
power-domains = <&hub_ulp_domain>;
173+
zephyr,pm-device-runtime-auto;
173174
};
174175

175176
dmic1: dai-dmic1@10100 {
@@ -180,6 +181,7 @@
180181
interrupts = <0x08 0 0>;
181182
interrupt-parent = <&ace_intc>;
182183
power-domains = <&hub_ulp_domain>;
184+
zephyr,pm-device-runtime-auto;
183185
};
184186

185187
dmicvss: dmicvss@16000 {

dts/xtensa/intel/intel_adsp_ace30_ptl.dtsi

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@
175175
interrupts = <0x08 0 0>;
176176
interrupt-parent = <&ace_intc>;
177177
power-domains = <&hub_ulp_domain>;
178+
zephyr,pm-device-runtime-auto;
178179
};
179180

180181
dmic1: dai-dmic1@10100 {
@@ -185,6 +186,7 @@
185186
interrupts = <0x08 0 0>;
186187
interrupt-parent = <&ace_intc>;
187188
power-domains = <&hub_ulp_domain>;
189+
zephyr,pm-device-runtime-auto;
188190
};
189191

190192
dmicvss: dmicvss@16000 {

0 commit comments

Comments
 (0)