[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230713193905.347588-1-fido_max@inbox.ru>
Date: Thu, 13 Jul 2023 22:39:04 +0300
From: Maxim Kochetkov <fido_max@...ox.ru>
To: alsa-devel@...a-project.org
Cc: Maxim Kochetkov <fido_max@...ox.ru>,
Liam Girdwood <lgirdwood@...il.com>,
Mark Brown <broonie@...nel.org>,
Jaroslav Kysela <perex@...ex.cz>,
Takashi Iwai <tiwai@...e.com>,
Kuninori Morimoto <kuninori.morimoto.gx@...esas.com>,
Herve Codina <herve.codina@...tlin.com>,
Sameer Pujar <spujar@...dia.com>,
Astrid Rost <astrid.rost@...s.com>,
Aidan MacDonald <aidanmacdonald.0x0@...il.com>,
linux-kernel@...r.kernel.org
Subject: [PATCH] ASoC: simple-card: add trigger-stop entry parser
It may be useful to specify trigger-stop for some DMA-based simple
audio card. So add this "trigger-stop" device tree entry parser.
Signed-off-by: Maxim Kochetkov <fido_max@...ox.ru>
---
sound/soc/generic/simple-card.c | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c
index a78babf44f38..86df7d326068 100644
--- a/sound/soc/generic/simple-card.c
+++ b/sound/soc/generic/simple-card.c
@@ -145,8 +145,27 @@ static int simple_parse_node(struct asoc_simple_priv *priv,
struct snd_soc_dai_link_component *dlc;
struct asoc_simple_dai *dai;
int ret;
+ const char *str;
+ struct {
+ char *name;
+ unsigned int val;
+ } of_trigger_table[] = {
+ { "default", SND_SOC_TRIGGER_ORDER_DEFAULT },
+ { "ldc", SND_SOC_TRIGGER_ORDER_LDC },
+ };
+
if (cpu) {
+ ret = of_property_read_string(np, "trigger-stop", &str);
+ if (ret == 0) {
+ for (int i = 0; i < ARRAY_SIZE(of_trigger_table); i++) {
+ if (strcmp(str, of_trigger_table[i].name) == 0) {
+ dai_link->trigger_stop = of_trigger_table[i].val;
+ break;
+ }
+ }
+ }
+
dlc = asoc_link_to_cpu(dai_link, 0);
dai = simple_props_to_dai_cpu(dai_props, 0);
} else {
--
2.40.1
Powered by blists - more mailing lists