kernel/0098-riscv-drivers-sound-esw-i2s-fix-HDMI-audio.patch
2025-02-11 21:42:49 -05:00

65 lines
1.6 KiB
Diff

From 32deded6eefe0654fdc1c4b136b96cbf908f7e24 Mon Sep 17 00:00:00 2001
From: Lei Deng <denglei@eswincomputing.com>
Date: Tue, 22 Oct 2024 09:52:36 +0000
Subject: [PATCH 098/128] riscv: drivers: sound: esw-i2s: fix HDMI audio
HDMI audio only supports playback
Signed-off-by: Lei Deng <denglei@eswincomputing.com>
---
sound/soc/eswin/esw-i2s.c | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/sound/soc/eswin/esw-i2s.c b/sound/soc/eswin/esw-i2s.c
index fb032ebd085e..93823dff2bdf 100755
--- a/sound/soc/eswin/esw-i2s.c
+++ b/sound/soc/eswin/esw-i2s.c
@@ -75,6 +75,8 @@
#define I2S0_IO_ADDR 0x51600124
+#define HDMI_DAI_NAME "i2s0-hdmi"
+
static struct clk *g_mclk;
static u32 dmaen_txch[] = {
@@ -375,6 +377,12 @@ static int i2s_startup(struct snd_pcm_substream *substream,
struct snd_soc_dai_link *dai_link = rtd->dai_link;
dai_link->trigger_stop = SND_SOC_TRIGGER_ORDER_LDC;
+
+ if (!strcmp(cpu_dai->name, HDMI_DAI_NAME))
+ {
+ dai_link->playback_only = 1;
+ }
+
return 0;
}
@@ -660,7 +668,7 @@ static const struct snd_soc_component_driver i2s_component = {
static struct snd_soc_dai_driver i2s_dai[4] = {
{
- .name = "i2s0-hdmi",
+ .name = HDMI_DAI_NAME,
.id = 0,
.ops = &i2s_dai_ops,
.playback = {
@@ -670,13 +678,6 @@ static struct snd_soc_dai_driver i2s_dai[4] = {
.rates = ESW_I2S_RATES,
.formats = ESW_I2S_FORMATS,
},
- .capture = {
- .stream_name = "Capture",
- .channels_min = MIN_CHANNEL_NUM,
- .channels_max = MAX_CHANNEL_NUM,
- .rates = ESW_I2S_RATES,
- .formats = ESW_I2S_FORMATS,
- },
},
{
.name = "i2s0",
--
2.47.0