Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drivers: DAI: Intel: Capture corruption risk fix and code improve patches for ACE DMIC #74414

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 6 additions & 13 deletions drivers/dai/intel/dmic/dmic.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,6 @@ static void dai_dmic_update_bits(const struct dai_intel_dmic *dmic,
{
uint32_t dest = dmic->reg_base + reg;

LOG_INF("%s base %x, reg %x, mask %x, value %x", __func__,
dmic->reg_base, reg, mask, val);

sys_write32((sys_read32(dest) & (~mask)) | (val & mask), dest);
}

Expand Down Expand Up @@ -556,7 +553,12 @@ static void dai_dmic_start(struct dai_intel_dmic *dmic)

/* enable port */
key = k_spin_lock(&dmic->lock);
LOG_DBG("dmic_start(), dai_index = %d", dmic->dai_config_params.dai_index);

#ifdef CONFIG_SOC_SERIES_INTEL_ADSP_ACE
for (i = 0; i < CONFIG_DAI_DMIC_HW_CONTROLLERS; i++)
dai_dmic_update_bits(dmic, dmic_base[i] + CIC_CONTROL, CIC_CONTROL_SOFT_RESET, 0);
#endif

dmic->startcount = 0;

/* Compute unmute ramp gain update coefficient. */
Expand All @@ -570,18 +572,9 @@ static void dai_dmic_start(struct dai_intel_dmic *dmic)
dai_dmic_start_fifo_packers(dmic, dmic->dai_config_params.dai_index);

for (i = 0; i < CONFIG_DAI_DMIC_HW_CONTROLLERS; i++) {
#ifdef CONFIG_SOC_SERIES_INTEL_ADSP_ACE
dai_dmic_update_bits(dmic, dmic_base[i] + CIC_CONTROL,
CIC_CONTROL_SOFT_RESET, 0);

LOG_INF("dmic_start(), cic 0x%08x",
dai_dmic_read(dmic, dmic_base[i] + CIC_CONTROL));
#endif

mic_a = dmic->enable[i] & 1;
mic_b = (dmic->enable[i] & 2) >> 1;
start_fir = dmic->enable[i] > 0;
LOG_INF("dmic_start(), pdm%d mic_a = %u, mic_b = %u", i, mic_a, mic_b);

/* If both microphones are needed start them simultaneously
* to start them in sync. The reset may be cleared for another
Expand Down
Loading