This field doesn't mean anything for DMIC or HDaudio, move it where it makes sense (I2S/TDM modes)
Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com --- src/audio/dai.c | 2 +- src/drivers/apl-ssp.c | 6 +++--- src/drivers/byt-ssp.c | 2 +- src/include/uapi/ipc.h | 3 +-- 4 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/src/audio/dai.c b/src/audio/dai.c index 1c50c08..7905665 100644 --- a/src/audio/dai.c +++ b/src/audio/dai.c @@ -628,7 +628,7 @@ static int dai_config(struct comp_dev *dev, struct sof_ipc_dai_config *config) dd->config.burst_elems = config->ssp.tdm_slots;
/* calc frame bytes */ - switch (config->sample_valid_bits) { + switch (config->ssp.sample_valid_bits) { case 16: dev->frame_bytes = 2 * config->ssp.tdm_slots; break; diff --git a/src/drivers/apl-ssp.c b/src/drivers/apl-ssp.c index 0153b7c..a02d934 100644 --- a/src/drivers/apl-ssp.c +++ b/src/drivers/apl-ssp.c @@ -406,7 +406,7 @@ static inline int ssp_set_config(struct dai *dai, sspsp |= SSPSP_STRTDLY(start_delay); sspsp |= SSPSP_SFRMWDTH(frame_len);
- bdiv_min = config->ssp.tdm_slots * config->sample_valid_bits; + bdiv_min = config->ssp.tdm_slots * config->ssp.sample_valid_bits; if (bdiv < bdiv_min) { trace_ssp_error("ecc"); ret = -EINVAL; @@ -422,7 +422,7 @@ static inline int ssp_set_config(struct dai *dai,
sspsp2 |= (frame_end_padding & SSPSP2_FEP_MASK);
- data_size = config->sample_valid_bits; + data_size = config->ssp.sample_valid_bits;
if (data_size > 16) sscr0 |= (SSCR0_EDSS | SSCR0_DSIZE(data_size - 16)); @@ -438,7 +438,7 @@ static inline int ssp_set_config(struct dai *dai, mdivr = 0x00000fff;
/* setting TFT and RFT */ - switch (config->sample_valid_bits) { + switch (config->ssp.sample_valid_bits) { case 16: /* use 2 bytes for each slot */ tft = active_tx_slots * 2; diff --git a/src/drivers/byt-ssp.c b/src/drivers/byt-ssp.c index a9e77df..758f211 100644 --- a/src/drivers/byt-ssp.c +++ b/src/drivers/byt-ssp.c @@ -431,7 +431,7 @@ static inline int ssp_set_config(struct dai *dai, sspsp |= SSPSP_SFRMWDTH(frame_len); sscr5 |= SSCR5_FRM_ASRT_CLOCKS(frame_len);
- data_size = config->sample_valid_bits; + data_size = config->ssp.sample_valid_bits;
if (data_size > 16) sscr0 |= (SSCR0_EDSS | SSCR0_DSIZE(data_size - 16)); diff --git a/src/include/uapi/ipc.h b/src/include/uapi/ipc.h index a2e0199..fbf1c07 100644 --- a/src/include/uapi/ipc.h +++ b/src/include/uapi/ipc.h @@ -242,6 +242,7 @@ struct sof_ipc_dai_ssp_params { uint32_t tx_slots;
/* data */ + uint32_t sample_valid_bits; uint16_t tdm_slot_width; uint16_t reserved2; /* alignment */
@@ -279,8 +280,6 @@ struct sof_ipc_dai_config { uint16_t format; /* SOF_DAI_FMT_ */ uint16_t reserved; /* alignment */
- uint32_t sample_valid_bits; - /* HW specific data */ union { struct sof_ipc_dai_ssp_params ssp;