Skip to content

Commit

Permalink
Merge pull request #156 from singalsu/fix_dmic_ipc_typo_proposal
Browse files Browse the repository at this point in the history
DMIC: Fix mistake in comment and add check for supported word lengths
  • Loading branch information
lgirdwood committed Jul 30, 2018
2 parents e3420cf + 4e06d57 commit 3ea7004
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
12 changes: 12 additions & 0 deletions src/drivers/dmic.c
Original file line number Diff line number Diff line change
Expand Up @@ -1150,6 +1150,18 @@ static int dmic_set_config(struct dai *dai, struct sof_ipc_dai_config *config)
goto finish;
}

if (prm->fifo_bits_a != 16 && prm->fifo_bits_a != 32) {
trace_dmic_error("fba");
ret = -EINVAL;
goto finish;
}

if (prm->fifo_bits_b != 16 && prm->fifo_bits_b != 32) {
trace_dmic_error("fbb");
ret = -EINVAL;
goto finish;
}

/* Match and select optimal decimators configuration for FIFOs A and B
* paths. This setup phase is still abstract. Successful completion
* points struct cfg to FIR coefficients and contains the scale value
Expand Down
4 changes: 2 additions & 2 deletions src/include/uapi/ipc.h
Original file line number Diff line number Diff line change
Expand Up @@ -329,8 +329,8 @@ struct sof_ipc_dai_dmic_params {
uint32_t fifo_fs_a; /* FIFO A sample rate in Hz (8000..96000) */
uint32_t fifo_fs_b; /* FIFO B sample rate in Hz (8000..96000) */
/* TODO: FIFO word lengths can be retrieved from SOF_DAI_FMT */
uint16_t fifo_bits_a; /* FIFO A word length (16 or 24) */
uint16_t fifo_bits_b; /* FIFO B word length (16 or 24) */
uint16_t fifo_bits_a; /* FIFO A word length (16 or 32) */
uint16_t fifo_bits_b; /* FIFO B word length (16 or 32) */
uint16_t duty_min; /* Min. mic clock duty cycle in % (20..80) */
uint16_t duty_max; /* Max. mic clock duty cycle in % (min..80) */
uint32_t num_pdm_active; /* Number of active controllers */
Expand Down

0 comments on commit 3ea7004

Please sign in to comment.