[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241210134254.2967524-4-olivier.moysan@foss.st.com>
Date: Tue, 10 Dec 2024 14:42:54 +0100
From: Olivier Moysan <olivier.moysan@...s.st.com>
To: Jaroslav Kysela <perex@...ex.cz>, Takashi Iwai <tiwai@...e.com>,
Liam
Girdwood <lgirdwood@...il.com>, Mark Brown <broonie@...nel.org>
CC: Olivier Moysan <olivier.moysan@...s.st.com>, <linux-sound@...r.kernel.org>,
<linux-kernel@...r.kernel.org>
Subject: [PATCH 3/3] ASoC: hdmi-codec: allow to refine formats actually supported
Currently the hdmi-codec driver registers all the formats that are
allowed on the I2S bus. Add i2s_formats field to codec data, to allow
the hdmi codec client to refine the list of the audio I2S formats
actually supported.
Signed-off-by: Olivier Moysan <olivier.moysan@...s.st.com>
---
include/sound/hdmi-codec.h | 1 +
sound/soc/codecs/hdmi-codec.c | 4 ++++
2 files changed, 5 insertions(+)
diff --git a/include/sound/hdmi-codec.h b/include/sound/hdmi-codec.h
index 5e1a9eafd10f..a65da989dab1 100644
--- a/include/sound/hdmi-codec.h
+++ b/include/sound/hdmi-codec.h
@@ -122,6 +122,7 @@ struct hdmi_codec_ops {
/* HDMI codec initalization data */
struct hdmi_codec_pdata {
const struct hdmi_codec_ops *ops;
+ u64 i2s_formats;
uint i2s:1;
uint no_i2s_playback:1;
uint no_i2s_capture:1;
diff --git a/sound/soc/codecs/hdmi-codec.c b/sound/soc/codecs/hdmi-codec.c
index d9df29a26f4f..3f9dfdbc693e 100644
--- a/sound/soc/codecs/hdmi-codec.c
+++ b/sound/soc/codecs/hdmi-codec.c
@@ -1077,6 +1077,10 @@ static int hdmi_codec_probe(struct platform_device *pdev)
if (hcd->i2s) {
daidrv[i] = hdmi_i2s_dai;
daidrv[i].playback.channels_max = hcd->max_i2s_channels;
+ if (hcd->i2s_formats) {
+ daidrv[i].playback.formats = hcd->i2s_formats;
+ daidrv[i].capture.formats = hcd->i2s_formats;
+ }
if (hcd->no_i2s_playback)
memset(&daidrv[i].playback, 0,
sizeof(daidrv[i].playback));
--
2.25.1
Powered by blists - more mailing lists