Initial commit
Some checks failed
Build Kernel / Build all affected Kernels (push) Has been cancelled
Build all core packages / Build all core packages for selected target (push) Has been cancelled
Build and Push prebuilt tools container / Build and Push all prebuilt containers (push) Has been cancelled
Build Toolchains / Build Toolchains for each target (push) Has been cancelled
Build host tools / Build host tools for linux and macos based systems (push) Has been cancelled
Coverity scan build / Coverity x86/64 build (push) Has been cancelled
Some checks failed
Build Kernel / Build all affected Kernels (push) Has been cancelled
Build all core packages / Build all core packages for selected target (push) Has been cancelled
Build and Push prebuilt tools container / Build and Push all prebuilt containers (push) Has been cancelled
Build Toolchains / Build Toolchains for each target (push) Has been cancelled
Build host tools / Build host tools for linux and macos based systems (push) Has been cancelled
Coverity scan build / Coverity x86/64 build (push) Has been cancelled
This commit is contained in:
@@ -0,0 +1,61 @@
|
||||
From 6a3bc86ec735daf7d761c970d1a89518d97fff26 Mon Sep 17 00:00:00 2001
|
||||
From: Phil Elwell <phil@raspberrypi.com>
|
||||
Date: Thu, 4 Mar 2021 14:49:23 +0000
|
||||
Subject: [PATCH 0545/1085] ASoC: dwc: Support set_bclk_ratio
|
||||
|
||||
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
|
||||
---
|
||||
sound/soc/dwc/dwc-i2s.c | 35 +++++++++++++++++++++++++++++++++++
|
||||
1 file changed, 35 insertions(+)
|
||||
|
||||
--- a/sound/soc/dwc/dwc-i2s.c
|
||||
+++ b/sound/soc/dwc/dwc-i2s.c
|
||||
@@ -460,6 +460,40 @@ static int dw_i2s_set_tdm_slot(struct sn
|
||||
return 0;
|
||||
}
|
||||
|
||||
+static int dw_i2s_set_bclk_ratio(struct snd_soc_dai *cpu_dai,
|
||||
+ unsigned int ratio)
|
||||
+{
|
||||
+ struct dw_i2s_dev *dev = snd_soc_dai_get_drvdata(cpu_dai);
|
||||
+ struct i2s_clk_config_data *config = &dev->config;
|
||||
+
|
||||
+ dev_err(dev->dev, "%s(%d)\n", __func__, ratio);
|
||||
+ switch (ratio) {
|
||||
+ case 32:
|
||||
+ config->data_width = 16;
|
||||
+ dev->ccr = 0x00;
|
||||
+ dev->xfer_resolution = 0x02;
|
||||
+ break;
|
||||
+
|
||||
+ case 48:
|
||||
+ config->data_width = 24;
|
||||
+ dev->ccr = 0x08;
|
||||
+ dev->xfer_resolution = 0x04;
|
||||
+ break;
|
||||
+
|
||||
+ case 64:
|
||||
+ config->data_width = 32;
|
||||
+ dev->ccr = 0x10;
|
||||
+ dev->xfer_resolution = 0x05;
|
||||
+ break;
|
||||
+ default:
|
||||
+ return -EINVAL;
|
||||
+ }
|
||||
+
|
||||
+ i2s_write_reg(dev->i2s_base, CCR, dev->ccr);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
static int dw_i2s_dai_probe(struct snd_soc_dai *dai)
|
||||
{
|
||||
struct dw_i2s_dev *dev = snd_soc_dai_get_drvdata(dai);
|
||||
@@ -476,6 +510,7 @@ static const struct snd_soc_dai_ops dw_i
|
||||
.trigger = dw_i2s_trigger,
|
||||
.set_fmt = dw_i2s_set_fmt,
|
||||
.set_tdm_slot = dw_i2s_set_tdm_slot,
|
||||
+ .set_bclk_ratio = dw_i2s_set_bclk_ratio,
|
||||
};
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
Reference in New Issue
Block a user