Skip to content

Commit

Permalink
ASoC: xlnx: enable multi sample rate support for I2S sound card
Browse files Browse the repository at this point in the history
Patch enables I2S sound card with multiple sampling rates for playback
and capture. Values were based on the PMOD used in audio pipeline.

Signed-off-by: Maruthi Srinivas Bayyavarapu <maruthi.srinivas.bayyavarapu@xilinx.com>
Reviewed-by: Hyun Kwon <hyun.kwon@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
  • Loading branch information
Maruthi Srinivas Bayyavarapu authored and Michal Simek committed Jan 29, 2019
1 parent 9792eb7 commit 81edb2b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion sound/soc/xilinx/xlnx_pl_snd_card.c
Expand Up @@ -159,10 +159,13 @@ static int xlnx_i2s_card_hw_params(struct snd_pcm_substream *substream,
}
}

prv->mclk_val = prv->mclk_ratio * sample_rate;
clk_div = DIV_ROUND_UP(prv->mclk_ratio, 2 * ch * data_width);
ret = snd_soc_dai_set_clkdiv(cpu_dai, 0, clk_div);
if (ret)
return ret;

return ret;
return clk_set_rate(prv->mclk, prv->mclk_val);
}

static const struct snd_soc_ops xlnx_sdi_card_ops = {
Expand Down

0 comments on commit 81edb2b

Please sign in to comment.