Skip to content

Commit c77ad74

Browse files
committed
ASoC: SOF: Intel: hda: set I2S slave before enabling DSP
By default, the I2S ports are configured in master mode during DSP powerup sequences, the FS and BCLK lines will be driven on startup, even when the topology file explicitly requires the SSP to be slave. This may be problematic for external components configured in master mode who don't expect the Intel SOC/PCH to drive. Fix by configuring the SSP as slave before the SSP outputs are enabled to avoid this transient behavior. When the topology file configures the SSP as clock master, the initial slave configuration will be overridden. Signed-off-by: Zhu Yingjiang <yingjiang.zhu@linux.intel.com>
1 parent 1ebc619 commit c77ad74

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

sound/soc/sof/intel/hda-loader.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ static int cl_dsp_init(struct snd_sof_dev *sdev, const void *fwdata,
8484
const struct sof_intel_dsp_desc *chip = hda->desc;
8585
unsigned int status;
8686
int ret;
87+
int i;
8788

8889
/* step 1: power up corex */
8990
ret = hda_dsp_core_power_up(sdev, chip->cores_mask);
@@ -92,6 +93,16 @@ static int cl_dsp_init(struct snd_sof_dev *sdev, const void *fwdata,
9293
goto err;
9394
}
9495

96+
/* DSP is powered up, set all SSPs to slave mode */
97+
for (i = 0; i < chip->ssp_count; i++) {
98+
snd_sof_dsp_update_bits_unlocked(sdev, HDA_DSP_BAR,
99+
chip->ssp_base_offset
100+
+ i * SSP_DEV_MEM_SIZE
101+
+ SSP_SSC1_OFFSET,
102+
SSP_SET_SLAVE,
103+
SSP_SET_SLAVE);
104+
}
105+
95106
/* step 2: purge FW request */
96107
snd_sof_dsp_write(sdev, HDA_DSP_BAR, chip->ipc_req,
97108
chip->ipc_req_mask | (HDA_DSP_IPC_PURGE_FW |

sound/soc/sof/intel/hda.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,12 @@
350350
#define APL_SSP_COUNT 6
351351
#define CNL_SSP_COUNT 3
352352

353+
/* SSP Registers */
354+
#define SSP_SSC1_OFFSET 0x4
355+
#define SSP_SET_SCLK_SLAVE BIT(25)
356+
#define SSP_SET_SFRM_SLAVE BIT(24)
357+
#define SSP_SET_SLAVE (SSP_SET_SCLK_SLAVE | SSP_SET_SFRM_SLAVE)
358+
353359
#define HDA_IDISP_CODEC(x) ((x) & BIT(2))
354360

355361
struct sof_intel_dsp_bdl {

0 commit comments

Comments
 (0)