1 From 06f794e8cb227249e03893e4b4923ff58556eb60 Mon Sep 17 00:00:00 2001
2 From: Phil Elwell <phil@raspberrypi.com>
3 Date: Thu, 4 Mar 2021 14:49:23 +0000
4 Subject: [PATCH] ASoC: dwc: Support set_bclk_ratio
6 Signed-off-by: Phil Elwell <phil@raspberrypi.com>
8 sound/soc/dwc/dwc-i2s.c | 35 +++++++++++++++++++++++++++++++++++
9 1 file changed, 35 insertions(+)
11 --- a/sound/soc/dwc/dwc-i2s.c
12 +++ b/sound/soc/dwc/dwc-i2s.c
13 @@ -351,11 +351,46 @@ static int dw_i2s_set_fmt(struct snd_soc
17 +static int dw_i2s_set_bclk_ratio(struct snd_soc_dai *cpu_dai,
20 + struct dw_i2s_dev *dev = snd_soc_dai_get_drvdata(cpu_dai);
21 + struct i2s_clk_config_data *config = &dev->config;
23 + dev_err(dev->dev, "%s(%d)\n", __func__, ratio);
26 + config->data_width = 16;
28 + dev->xfer_resolution = 0x02;
32 + config->data_width = 24;
34 + dev->xfer_resolution = 0x04;
38 + config->data_width = 32;
40 + dev->xfer_resolution = 0x05;
46 + i2s_write_reg(dev->i2s_base, CCR, dev->ccr);
51 static const struct snd_soc_dai_ops dw_i2s_dai_ops = {
52 .hw_params = dw_i2s_hw_params,
53 .prepare = dw_i2s_prepare,
54 .trigger = dw_i2s_trigger,
55 .set_fmt = dw_i2s_set_fmt,
56 + .set_bclk_ratio = dw_i2s_set_bclk_ratio,