From: Olivier Moysan olivier.moysan@foss.st.com
[ Upstream commit 038f79638e0676359e44c5db458d52994f9b5ac1 ]
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@foss.st.com Acked-by: Mark Brown broonie@kernel.org Link: https://patchwork.freedesktop.org/patch/msgid/20250108170356.413063-3-olivie... Signed-off-by: Dmitry Baryshkov dmitry.baryshkov@linaro.org Signed-off-by: Sasha Levin sashal@kernel.org --- 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 9b162ac1e08e0..498d21dfd8790 100644 --- a/include/sound/hdmi-codec.h +++ b/include/sound/hdmi-codec.h @@ -123,6 +123,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 03290d3ae59cc..915baa7016eab 100644 --- a/sound/soc/codecs/hdmi-codec.c +++ b/sound/soc/codecs/hdmi-codec.c @@ -1076,6 +1076,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));