It's better to express MCLK and BCLK as freqencies rather than as ratios.
Signed-off-by: Liam Girdwood liam.r.girdwood@linux.intel.com --- src/drivers/ssp.c | 4 +++- src/include/reef/dai.h | 3 +-- src/ipc/intel-ipc.c | 6 +++--- 3 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/src/drivers/ssp.c b/src/drivers/ssp.c index 9656104..c285af3 100644 --- a/src/drivers/ssp.c +++ b/src/drivers/ssp.c @@ -252,7 +252,9 @@ static inline int ssp_set_config(struct dai *dai, struct dai_config *dai_config) return -ENODEV; }
- sscr0 |= SSCR0_SCR(dai->config.mclk_fs / dai->config.bclk_fs - 1); + /* BCLK is generated from MCLK */ + sscr0 |= SSCR0_SCR(dai->config.mclk / dai->config.bclk - 1); + /* format */ switch (dai->config.format & DAI_FMT_FORMAT_MASK) { case DAI_FMT_I2S: diff --git a/src/include/reef/dai.h b/src/include/reef/dai.h index 5a29e85..cfcc428 100644 --- a/src/include/reef/dai.h +++ b/src/include/reef/dai.h @@ -103,8 +103,7 @@ struct dai_config { uint32_t frame_size; /* in BCLKs */ struct dai_slot_map tx_slot_map[DAI_NUM_SLOT_MAPS]; struct dai_slot_map rx_slot_map[DAI_NUM_SLOT_MAPS]; - uint32_t bclk_fs; /* ratio between frame size and BCLK */ - uint32_t mclk_fs; /* ratio between frame size and MCLK */ + uint32_t bclk; /* BCLK frequency in Hz */ uint32_t mclk; /* mclk frequency in Hz */ uint32_t clk_src; /* DAI specific clk source */ uint32_t lbm; /* loopback mode */ diff --git a/src/ipc/intel-ipc.c b/src/ipc/intel-ipc.c index cfe53c1..bfffaf6 100644 --- a/src/ipc/intel-ipc.c +++ b/src/ipc/intel-ipc.c @@ -565,9 +565,9 @@ static uint32_t ipc_device_set_formats(uint32_t header) dai_dev->dai_config.mclk = config_req.clock_frequency; dai_dev->dai_config.format = DAI_FMT_I2S | DAI_FMT_CONT | DAI_FMT_NB_NF | DAI_FMT_CBS_CFS; - dai_dev->dai_config.frame_size = 32; /* TODO 16bit stereo hard coded */ - dai_dev->dai_config.bclk_fs = 32; /* 32 BCLKs per frame - */ - dai_dev->dai_config.mclk_fs = 256; + dai_dev->dai_config.frame_size = 24; /* really sample size */ + dai_dev->dai_config.bclk = 2400000; + dai_dev->dai_config.mclk = 19200000; dai_dev->dai_config.clk_src = SSP_CLK_EXT;
comp_dai_config(dai_dev->dev.cd, &dai_dev->dai_config);