mirror of
https://github.com/Fishwaldo/build.git
synced 2025-07-12 16:08:49 +00:00
60 lines
2 KiB
Diff
60 lines
2 KiB
Diff
From 3c114698990fb506d478fd5dd27a3298e526ef50 Mon Sep 17 00:00:00 2001
|
|
From: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
|
|
Date: Wed, 23 Dec 2020 02:45:27 +0100
|
|
Subject: [PATCH 38/58] WIP: ASoC: meson: aiu: encoder-spdif: implement the
|
|
.mute_stream callback
|
|
|
|
Implement the .mute_stream callback based on code from the vendor
|
|
driver.
|
|
|
|
Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
|
|
---
|
|
sound/soc/meson/aiu-encoder-spdif.c | 21 +++++++++++++++++++++
|
|
1 file changed, 21 insertions(+)
|
|
|
|
diff --git a/sound/soc/meson/aiu-encoder-spdif.c b/sound/soc/meson/aiu-encoder-spdif.c
|
|
index de850913975f..5c42a784cee4 100644
|
|
--- a/sound/soc/meson/aiu-encoder-spdif.c
|
|
+++ b/sound/soc/meson/aiu-encoder-spdif.c
|
|
@@ -19,6 +19,8 @@
|
|
#define AIU_958_MISC_U_FROM_STREAM BIT(12)
|
|
#define AIU_958_MISC_FORCE_LR BIT(13)
|
|
#define AIU_958_CTRL_HOLD_EN BIT(0)
|
|
+#define AIU_958_CTRL_MUTE_RIGHT_SPEAKER BIT(3)
|
|
+#define AIU_958_CTRL_MUTE_LEFT_SPEAKER BIT(4)
|
|
#define AIU_CLK_CTRL_958_DIV_EN BIT(1)
|
|
#define AIU_CLK_CTRL_958_DIV GENMASK(5, 4)
|
|
#define AIU_CLK_CTRL_958_DIV_MORE BIT(12)
|
|
@@ -200,10 +202,29 @@ static void aiu_encoder_spdif_shutdown(struct snd_pcm_substream *substream,
|
|
clk_bulk_disable_unprepare(aiu->spdif.clk_num, aiu->spdif.clks);
|
|
}
|
|
|
|
+static int aiu_encoder_spdif_mute_stream(struct snd_soc_dai *dai, int mute,
|
|
+ int stream)
|
|
+{
|
|
+ struct snd_soc_component *component = dai->component;
|
|
+ u32 value = 0;
|
|
+
|
|
+ if (mute)
|
|
+ value = AIU_958_CTRL_MUTE_RIGHT_SPEAKER |
|
|
+ AIU_958_CTRL_MUTE_LEFT_SPEAKER;
|
|
+
|
|
+ snd_soc_component_update_bits(component, AIU_958_CTRL,
|
|
+ AIU_958_CTRL_MUTE_RIGHT_SPEAKER |
|
|
+ AIU_958_CTRL_MUTE_LEFT_SPEAKER,
|
|
+ value);
|
|
+
|
|
+ return 0;
|
|
+}
|
|
+
|
|
const struct snd_soc_dai_ops aiu_encoder_spdif_dai_ops = {
|
|
.trigger = aiu_encoder_spdif_trigger,
|
|
.hw_params = aiu_encoder_spdif_hw_params,
|
|
.hw_free = aiu_encoder_spdif_hw_free,
|
|
.startup = aiu_encoder_spdif_startup,
|
|
.shutdown = aiu_encoder_spdif_shutdown,
|
|
+ .mute_stream = aiu_encoder_spdif_mute_stream,
|
|
};
|
|
--
|
|
2.25.1
|
|
|