0
0
mirror of https://github.com/libretro/Lakka-LibreELEC.git synced 2025-03-01 03:21:21 +00:00
Lakka-LibreELEC/projects/Amlogic/patches/linux/amlogic-0064-WIP-ASoC-meson-aiu-encoder-i2s-implement-the-.mute_s.patch
2021-03-28 15:57:24 +00:00

70 lines
2.3 KiB
Diff

From 27a0b699cf76c8fc3e2ad354af85bfe3cb04bfc0 Mon Sep 17 00:00:00 2001
From: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Date: Wed, 23 Dec 2020 02:46:54 +0100
Subject: [PATCH 64/88] WIP: ASoC: meson: aiu: encoder-i2s: implement the
.mute_stream callback
Implement the .mute_stream callback based on the code from the vendor
driver.
Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
---
sound/soc/meson/aiu-encoder-i2s.c | 15 +++++++++++++++
sound/soc/meson/aiu.h | 1 +
2 files changed, 16 insertions(+)
diff --git a/sound/soc/meson/aiu-encoder-i2s.c b/sound/soc/meson/aiu-encoder-i2s.c
index 932224552146..d6aea7797641 100644
--- a/sound/soc/meson/aiu-encoder-i2s.c
+++ b/sound/soc/meson/aiu-encoder-i2s.c
@@ -28,6 +28,8 @@
#define AIU_CLK_CTRL_MORE_I2S_DIV GENMASK(5, 0)
#define AIU_CODEC_DAC_LRCLK_CTRL_DIV GENMASK(11, 0)
+#define AIU_I2S_MUTE_SWAP_MUTE GENMASK(15, 8)
+
static void aiu_encoder_i2s_divider_enable(struct snd_soc_component *component,
bool enable)
{
@@ -352,6 +354,18 @@ static void aiu_encoder_i2s_shutdown(struct snd_pcm_substream *substream,
clk_bulk_disable_unprepare(aiu->i2s.clk_num, aiu->i2s.clks);
}
+static int aiu_encoder_i2s_mute_stream(struct snd_soc_dai *dai, int mute,
+ int stream)
+{
+ struct snd_soc_component *component = dai->component;
+
+ snd_soc_component_update_bits(component, AIU_I2S_MUTE_SWAP,
+ AIU_I2S_MUTE_SWAP_MUTE,
+ mute ? AIU_I2S_MUTE_SWAP_MUTE : 0);
+
+ return 0;
+}
+
const struct snd_soc_dai_ops aiu_encoder_i2s_dai_ops = {
.trigger = aiu_encoder_i2s_trigger,
.hw_params = aiu_encoder_i2s_hw_params,
@@ -360,5 +374,6 @@ const struct snd_soc_dai_ops aiu_encoder_i2s_dai_ops = {
.set_sysclk = aiu_encoder_i2s_set_sysclk,
.startup = aiu_encoder_i2s_startup,
.shutdown = aiu_encoder_i2s_shutdown,
+ .mute_stream = aiu_encoder_i2s_mute_stream,
};
diff --git a/sound/soc/meson/aiu.h b/sound/soc/meson/aiu.h
index 393b6c2307e4..7884c50f244d 100644
--- a/sound/soc/meson/aiu.h
+++ b/sound/soc/meson/aiu.h
@@ -66,6 +66,7 @@ extern const struct snd_soc_dai_ops aiu_encoder_spdif_dai_ops;
#define AIU_958_CHSTAT_L0 0x020
#define AIU_958_CHSTAT_L1 0x024
#define AIU_958_CTRL 0x028
+#define AIU_I2S_MUTE_SWAP 0x030
#define AIU_I2S_SOURCE_DESC 0x034
#define AIU_I2S_DAC_CFG 0x040
#define AIU_I2S_SYNC 0x044
--
2.17.1