dai: intel: ssp: Refactor power management initialization

This patch refactors the power management initialization for the SSP
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 `ssp_init` function.
2. Adding the `zephyr,pm-device-runtime-auto` property to the SSP nodes
   in the device tree files for ACE15, ACE20, and ACE30.
3. Moving the power domain assignment for the SSP device in the device
   tree. The previous configuration resulted in the device not being under
   any power domain and being initialized as always ON.

These changes ensure that the SSP 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 <tomasz.m.leman@intel.com>
This commit is contained in:
Tomasz Leman 2024-11-19 14:52:13 +01:00 committed by Benjamin Cabé
commit fe2861b5cd
5 changed files with 109 additions and 20 deletions

View file

@ -2663,14 +2663,7 @@ static int dai_intel_ssp_init_device(const struct device *dev)
static int ssp_init(const struct device *dev)
{
dai_intel_ssp_init_device(dev);
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 pm_device_driver_init(dev, ssp_pm_action);
}
static int dai_ssp_dma_control_set(const struct device *dev,

View file

@ -292,12 +292,13 @@
dmas = <&lpgpdma0 2
&lpgpdma0 3>;
dma-names = "tx", "rx";
power-domains = <&io0_domain>;
ssp-index = <0>;
status = "okay";
ssp00: ssp@0 {
compatible = "intel,ssp-dai";
power-domains = <&io0_domain>;
zephyr,pm-device-runtime-auto;
status = "okay";
reg = <0x0>;
};
@ -314,12 +315,13 @@
dmas = <&lpgpdma0 4
&lpgpdma0 5>;
dma-names = "tx", "rx";
power-domains = <&io0_domain>;
ssp-index = <1>;
status = "okay";
ssp10: ssp@10 {
compatible = "intel,ssp-dai";
power-domains = <&io0_domain>;
zephyr,pm-device-runtime-auto;
status = "okay";
reg = <0x10>;
};
@ -336,12 +338,13 @@
dmas = <&lpgpdma0 6
&lpgpdma0 7>;
dma-names = "tx", "rx";
power-domains = <&io0_domain>;
ssp-index = <2>;
status = "okay";
ssp20: ssp@20 {
compatible = "intel,ssp-dai";
power-domains = <&io0_domain>;
zephyr,pm-device-runtime-auto;
status = "okay";
reg = <0x20>;
};

View file

@ -222,12 +222,13 @@
dmas = <&hda_link_out 1
&hda_link_in 1>;
dma-names = "tx", "rx";
power-domains = <&io0_domain>;
ssp-index = <0>;
status = "okay";
ssp00: ssp@0 {
compatible = "intel,ssp-dai";
power-domains = <&io0_domain>;
zephyr,pm-device-runtime-auto;
status = "okay";
reg = <0x0>;
};
@ -245,12 +246,13 @@
dmas = <&hda_link_out 2
&hda_link_in 2>;
dma-names = "tx", "rx";
power-domains = <&io0_domain>;
ssp-index = <1>;
status = "okay";
ssp10: ssp@10 {
compatible = "intel,ssp-dai";
power-domains = <&io0_domain>;
zephyr,pm-device-runtime-auto;
status = "okay";
reg = <0x10>;
};
@ -268,12 +270,13 @@
dmas = <&hda_link_out 3
&hda_link_in 3>;
dma-names = "tx", "rx";
power-domains = <&io0_domain>;
ssp-index = <2>;
status = "okay";
ssp20: ssp@20 {
compatible = "intel,ssp-dai";
power-domains = <&io0_domain>;
zephyr,pm-device-runtime-auto;
status = "okay";
reg = <0x20>;
};

View file

@ -214,53 +214,68 @@
&hda_link_in 1>;
dma-names = "tx", "rx";
ssp-index = <0>;
power-domains = <&io0_domain>;
status = "okay";
ssp00: ssp@0 {
compatible = "intel,ssp-dai";
power-domains = <&io0_domain>;
zephyr,pm-device-runtime-auto;
reg = <0x0>;
status = "okay";
};
ssp01: ssp@1 {
compatible = "intel,ssp-dai";
power-domains = <&io0_domain>;
zephyr,pm-device-runtime-auto;
reg = <0x1>;
status = "okay";
};
ssp02: ssp@2 {
compatible = "intel,ssp-dai";
power-domains = <&io0_domain>;
zephyr,pm-device-runtime-auto;
reg = <0x2>;
status = "okay";
};
ssp03: ssp@3 {
compatible = "intel,ssp-dai";
power-domains = <&io0_domain>;
zephyr,pm-device-runtime-auto;
reg = <0x3>;
status = "okay";
};
ssp04: ssp@4 {
compatible = "intel,ssp-dai";
power-domains = <&io0_domain>;
zephyr,pm-device-runtime-auto;
reg = <0x4>;
status = "okay";
};
ssp05: ssp@5 {
compatible = "intel,ssp-dai";
power-domains = <&io0_domain>;
zephyr,pm-device-runtime-auto;
reg = <0x5>;
status = "okay";
};
ssp06: ssp@6 {
compatible = "intel,ssp-dai";
power-domains = <&io0_domain>;
zephyr,pm-device-runtime-auto;
reg = <0x6>;
status = "okay";
};
ssp07: ssp@7 {
compatible = "intel,ssp-dai";
power-domains = <&io0_domain>;
zephyr,pm-device-runtime-auto;
reg = <0x7>;
status = "okay";
};
@ -279,53 +294,68 @@
&hda_link_in 2>;
dma-names = "tx", "rx";
ssp-index = <1>;
power-domains = <&io0_domain>;
status = "okay";
ssp10: ssp@10 {
compatible = "intel,ssp-dai";
power-domains = <&io0_domain>;
zephyr,pm-device-runtime-auto;
reg = <0x10>;
status = "okay";
};
ssp11: ssp@11 {
compatible = "intel,ssp-dai";
power-domains = <&io0_domain>;
zephyr,pm-device-runtime-auto;
reg = <0x11>;
status = "okay";
};
ssp12: ssp@12 {
compatible = "intel,ssp-dai";
power-domains = <&io0_domain>;
zephyr,pm-device-runtime-auto;
reg = <0x12>;
status = "okay";
};
ssp13: ssp@13 {
compatible = "intel,ssp-dai";
power-domains = <&io0_domain>;
zephyr,pm-device-runtime-auto;
reg = <0x13>;
status = "okay";
};
ssp14: ssp@14 {
compatible = "intel,ssp-dai";
power-domains = <&io0_domain>;
zephyr,pm-device-runtime-auto;
reg = <0x14>;
status = "okay";
};
ssp15: ssp@15 {
compatible = "intel,ssp-dai";
power-domains = <&io0_domain>;
zephyr,pm-device-runtime-auto;
reg = <0x15>;
status = "okay";
};
ssp16: ssp@16 {
compatible = "intel,ssp-dai";
power-domains = <&io0_domain>;
zephyr,pm-device-runtime-auto;
reg = <0x16>;
status = "okay";
};
ssp17: ssp@17 {
compatible = "intel,ssp-dai";
power-domains = <&io0_domain>;
zephyr,pm-device-runtime-auto;
reg = <0x17>;
status = "okay";
};
@ -344,53 +374,68 @@
&hda_link_in 3>;
dma-names = "tx", "rx";
ssp-index = <2>;
power-domains = <&io0_domain>;
status = "okay";
ssp20: ssp@20 {
compatible = "intel,ssp-dai";
power-domains = <&io0_domain>;
zephyr,pm-device-runtime-auto;
reg = <0x20>;
status = "okay";
};
ssp21: ssp@21 {
compatible = "intel,ssp-dai";
power-domains = <&io0_domain>;
zephyr,pm-device-runtime-auto;
reg = <0x21>;
status = "okay";
};
ssp22: ssp@22 {
compatible = "intel,ssp-dai";
power-domains = <&io0_domain>;
zephyr,pm-device-runtime-auto;
reg = <0x22>;
status = "okay";
};
ssp23: ssp@23 {
compatible = "intel,ssp-dai";
power-domains = <&io0_domain>;
zephyr,pm-device-runtime-auto;
reg = <0x23>;
status = "okay";
};
ssp24: ssp@24 {
compatible = "intel,ssp-dai";
power-domains = <&io0_domain>;
zephyr,pm-device-runtime-auto;
reg = <0x24>;
status = "okay";
};
ssp25: ssp@25 {
compatible = "intel,ssp-dai";
power-domains = <&io0_domain>;
zephyr,pm-device-runtime-auto;
reg = <0x25>;
status = "okay";
};
ssp26: ssp@26 {
compatible = "intel,ssp-dai";
power-domains = <&io0_domain>;
zephyr,pm-device-runtime-auto;
reg = <0x26>;
status = "okay";
};
ssp27: ssp@27 {
compatible = "intel,ssp-dai";
power-domains = <&io0_domain>;
zephyr,pm-device-runtime-auto;
reg = <0x27>;
status = "okay";
};

View file

@ -219,53 +219,68 @@
&hda_link_in 1>;
dma-names = "tx", "rx";
ssp-index = <0>;
power-domains = <&io0_domain>;
status = "okay";
ssp00: ssp@0 {
compatible = "intel,ssp-dai";
power-domains = <&io0_domain>;
zephyr,pm-device-runtime-auto;
reg = <0x0>;
status = "okay";
};
ssp01: ssp@1 {
compatible = "intel,ssp-dai";
power-domains = <&io0_domain>;
zephyr,pm-device-runtime-auto;
reg = <0x1>;
status = "okay";
};
ssp02: ssp@2 {
compatible = "intel,ssp-dai";
power-domains = <&io0_domain>;
zephyr,pm-device-runtime-auto;
reg = <0x2>;
status = "okay";
};
ssp03: ssp@3 {
compatible = "intel,ssp-dai";
power-domains = <&io0_domain>;
zephyr,pm-device-runtime-auto;
reg = <0x3>;
status = "okay";
};
ssp04: ssp@4 {
compatible = "intel,ssp-dai";
power-domains = <&io0_domain>;
zephyr,pm-device-runtime-auto;
reg = <0x4>;
status = "okay";
};
ssp05: ssp@5 {
compatible = "intel,ssp-dai";
power-domains = <&io0_domain>;
zephyr,pm-device-runtime-auto;
reg = <0x5>;
status = "okay";
};
ssp06: ssp@6 {
compatible = "intel,ssp-dai";
power-domains = <&io0_domain>;
zephyr,pm-device-runtime-auto;
reg = <0x6>;
status = "okay";
};
ssp07: ssp@7 {
compatible = "intel,ssp-dai";
power-domains = <&io0_domain>;
zephyr,pm-device-runtime-auto;
reg = <0x7>;
status = "okay";
};
@ -284,53 +299,68 @@
&hda_link_in 2>;
dma-names = "tx", "rx";
ssp-index = <1>;
power-domains = <&io0_domain>;
status = "okay";
ssp10: ssp@10 {
compatible = "intel,ssp-dai";
power-domains = <&io0_domain>;
zephyr,pm-device-runtime-auto;
reg = <0x10>;
status = "okay";
};
ssp11: ssp@11 {
compatible = "intel,ssp-dai";
power-domains = <&io0_domain>;
zephyr,pm-device-runtime-auto;
reg = <0x11>;
status = "okay";
};
ssp12: ssp@12 {
compatible = "intel,ssp-dai";
power-domains = <&io0_domain>;
zephyr,pm-device-runtime-auto;
reg = <0x12>;
status = "okay";
};
ssp13: ssp@13 {
compatible = "intel,ssp-dai";
power-domains = <&io0_domain>;
zephyr,pm-device-runtime-auto;
reg = <0x13>;
status = "okay";
};
ssp14: ssp@14 {
compatible = "intel,ssp-dai";
power-domains = <&io0_domain>;
zephyr,pm-device-runtime-auto;
reg = <0x14>;
status = "okay";
};
ssp15: ssp@15 {
compatible = "intel,ssp-dai";
power-domains = <&io0_domain>;
zephyr,pm-device-runtime-auto;
reg = <0x15>;
status = "okay";
};
ssp16: ssp@16 {
compatible = "intel,ssp-dai";
power-domains = <&io0_domain>;
zephyr,pm-device-runtime-auto;
reg = <0x16>;
status = "okay";
};
ssp17: ssp@17 {
compatible = "intel,ssp-dai";
power-domains = <&io0_domain>;
zephyr,pm-device-runtime-auto;
reg = <0x17>;
status = "okay";
};
@ -349,53 +379,68 @@
&hda_link_in 3>;
dma-names = "tx", "rx";
ssp-index = <2>;
power-domains = <&io0_domain>;
status = "okay";
ssp20: ssp@20 {
compatible = "intel,ssp-dai";
power-domains = <&io0_domain>;
zephyr,pm-device-runtime-auto;
reg = <0x20>;
status = "okay";
};
ssp21: ssp@21 {
compatible = "intel,ssp-dai";
power-domains = <&io0_domain>;
zephyr,pm-device-runtime-auto;
reg = <0x21>;
status = "okay";
};
ssp22: ssp@22 {
compatible = "intel,ssp-dai";
power-domains = <&io0_domain>;
zephyr,pm-device-runtime-auto;
reg = <0x22>;
status = "okay";
};
ssp23: ssp@23 {
compatible = "intel,ssp-dai";
power-domains = <&io0_domain>;
zephyr,pm-device-runtime-auto;
reg = <0x23>;
status = "okay";
};
ssp24: ssp@24 {
compatible = "intel,ssp-dai";
power-domains = <&io0_domain>;
zephyr,pm-device-runtime-auto;
reg = <0x24>;
status = "okay";
};
ssp25: ssp@25 {
compatible = "intel,ssp-dai";
power-domains = <&io0_domain>;
zephyr,pm-device-runtime-auto;
reg = <0x25>;
status = "okay";
};
ssp26: ssp@26 {
compatible = "intel,ssp-dai";
power-domains = <&io0_domain>;
zephyr,pm-device-runtime-auto;
reg = <0x26>;
status = "okay";
};
ssp27: ssp@27 {
compatible = "intel,ssp-dai";
power-domains = <&io0_domain>;
zephyr,pm-device-runtime-auto;
reg = <0x27>;
status = "okay";
};