55 */
66
77#include <errno.h>
8+ #include <zephyr/sys/util_macro.h>
89#include <stdbool.h>
910#include <stdint.h>
1011#include <zephyr/spinlock.h>
@@ -706,7 +707,7 @@ static inline void dai_ssp_pm_runtime_en_ssp_clk_gating(struct dai_intel_ssp *dp
706707
707708static void dai_ssp_pm_runtime_en_ssp_power (struct dai_intel_ssp * dp , uint32_t index )
708709{
709- #if CONFIG_SOC_SERIES_INTEL_CAVS_V25
710+ #if CONFIG_DAI_SSP_HAS_POWER_CONTROL
710711 int ret ;
711712
712713 LOG_INF ("%s en_ssp_power index %d" , __func__ , index );
@@ -724,12 +725,15 @@ static void dai_ssp_pm_runtime_en_ssp_power(struct dai_intel_ssp *dp, uint32_t i
724725 }
725726
726727 LOG_INF ("%s I2SLCTL" , __func__ );
727- #endif
728+ #else
729+ ARG_UNUSED (dp );
730+ ARG_UNUSED (index );
731+ #endif /* CONFIG_DAI_SSP_HAS_POWER_CONTROL */
728732}
729733
730734static void dai_ssp_pm_runtime_dis_ssp_power (struct dai_intel_ssp * dp , uint32_t index )
731735{
732- #if CONFIG_SOC_SERIES_INTEL_CAVS_V25
736+ #if CONFIG_DAI_SSP_HAS_POWER_CONTROL
733737 int ret ;
734738
735739 LOG_INF ("%s index %d" , __func__ , index );
@@ -747,7 +751,10 @@ static void dai_ssp_pm_runtime_dis_ssp_power(struct dai_intel_ssp *dp, uint32_t
747751 }
748752
749753 LOG_INF ("%s I2SLCTL" , __func__ );
750- #endif
754+ #else
755+ ARG_UNUSED (dp );
756+ ARG_UNUSED (index );
757+ #endif /* CONFIG_DAI_SSP_HAS_POWER_CONTROL */
751758}
752759
753760/* empty SSP transmit FIFO */
@@ -1538,7 +1545,11 @@ static int dai_ssp_set_config_blob(struct dai_intel_ssp *dp, const void *spec_co
15381545 ssrsa = blob -> i2s_driver_config .i2s_config .ssrsa ;
15391546
15401547 sys_write32 (ssc0 , dai_base (dp ) + SSCR0 );
1548+ sys_write32 (blob -> i2s_driver_config .i2s_config .ssc2 & ~SSCR2_SFRMEN ,
1549+ dai_base (dp ) + SSCR2 ); /* hardware specific flow */
15411550 sys_write32 (blob -> i2s_driver_config .i2s_config .ssc1 , dai_base (dp ) + SSCR1 );
1551+ sys_write32 (blob -> i2s_driver_config .i2s_config .ssc2 | SSCR2_SFRMEN ,
1552+ dai_base (dp ) + SSCR2 ); /* hardware specific flow */
15421553 sys_write32 (blob -> i2s_driver_config .i2s_config .ssc2 , dai_base (dp ) + SSCR2 );
15431554 sys_write32 (blob -> i2s_driver_config .i2s_config .ssc3 , dai_base (dp ) + SSCR3 );
15441555 sys_write32 (blob -> i2s_driver_config .i2s_config .sspsp , dai_base (dp ) + SSPSP );
@@ -1748,7 +1759,10 @@ static void dai_ssp_stop(struct dai_intel_ssp *dp, int direction)
17481759 /* disable SSP port if no users */
17491760 if (ssp -> state [DAI_DIR_CAPTURE ] == DAI_STATE_PRE_RUNNING &&
17501761 ssp -> state [DAI_DIR_PLAYBACK ] == DAI_STATE_PRE_RUNNING ) {
1751- if (!(ssp -> clk_active & SSP_CLK_BCLK_ES_REQ )) {
1762+ bool clear_rse_bits = COND_CODE_1 (CONFIG_INTEL_ADSP_CAVS ,
1763+ (!(ssp -> clk_active & SSP_CLK_BCLK_ES_REQ )),
1764+ (false));
1765+ if (clear_rse_bits ) {
17521766 /* clear TRSE/RSRE before SSE */
17531767 dai_ssp_update_bits (dp , SSCR1 , SSCR1_TSRE | SSCR1_RSRE , 0 );
17541768 dai_ssp_update_bits (dp , SSCR0 , SSCR0_SSE , 0 );
0 commit comments