lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220907142124.2532620-7-luca.ceresoli@bootlin.com>
Date:   Wed,  7 Sep 2022 16:21:22 +0200
From:   luca.ceresoli@...tlin.com
To:     alsa-devel@...a-project.org, linux-rockchip@...ts.infradead.org
Cc:     Luca Ceresoli <luca.ceresoli@...tlin.com>,
        devicetree@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
        linux-kernel@...r.kernel.org, Liam Girdwood <lgirdwood@...il.com>,
        Mark Brown <broonie@...nel.org>,
        Rob Herring <robh+dt@...nel.org>,
        Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
        Heiko Stuebner <heiko@...ech.de>,
        Jaroslav Kysela <perex@...ex.cz>,
        Takashi Iwai <tiwai@...e.com>,
        Nicolas Frattaroli <frattaroli.nicolas@...il.com>,
        Philipp Zabel <p.zabel@...gutronix.de>,
        Johan Jonker <jbx6244@...il.com>,
        Chris Morgan <macromorgan@...mail.com>
Subject: [PATCH 6/8] ASoC: audio-graph: let dai_link->init be overridable

From: Luca Ceresoli <luca.ceresoli@...tlin.com>

We can already override dai_link->ops via a custom pointer in
asoc_simple_priv. Do the same for dai_link->init.

This is needed for a card that need to call .set_sysclk multiple times to
initialize more than one clock. The current code does not allow to do it
cleanly.

Signed-off-by: Luca Ceresoli <luca.ceresoli@...tlin.com>
---
 include/sound/simple_card_utils.h    | 1 +
 sound/soc/generic/audio-graph-card.c | 2 ++
 2 files changed, 3 insertions(+)

diff --git a/include/sound/simple_card_utils.h b/include/sound/simple_card_utils.h
index a0b827f0c2f6..60dab5f68f5e 100644
--- a/include/sound/simple_card_utils.h
+++ b/include/sound/simple_card_utils.h
@@ -75,6 +75,7 @@ struct asoc_simple_priv {
 	struct snd_soc_dai_link_component dummy;
 	struct snd_soc_codec_conf *codec_conf;
 	struct gpio_desc *pa_gpio;
+	int (*init)(struct snd_soc_pcm_runtime *rtd);
 	const struct snd_soc_ops *ops;
 	unsigned int dpcm_selectable:1;
 	unsigned int force_dpcm:1;
diff --git a/sound/soc/generic/audio-graph-card.c b/sound/soc/generic/audio-graph-card.c
index b327372f2e4a..38c05eb1c650 100644
--- a/sound/soc/generic/audio-graph-card.c
+++ b/sound/soc/generic/audio-graph-card.c
@@ -263,6 +263,8 @@ static int graph_link_init(struct asoc_simple_priv *priv,
 
 	dai_link->init		= asoc_simple_dai_init;
 	dai_link->ops		= &graph_ops;
+	if (priv->init)
+		dai_link->init	= priv->init;
 	if (priv->ops)
 		dai_link->ops	= priv->ops;
 
-- 
2.34.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ