]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
ASoC: hdmi-codec: allow to refine formats actually supported
authorOlivier Moysan <olivier.moysan@foss.st.com>
Wed, 8 Jan 2025 17:03:55 +0000 (18:03 +0100)
committerDmitry Baryshkov <dmitry.baryshkov@linaro.org>
Sun, 26 Jan 2025 12:01:12 +0000 (14:01 +0200)
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-olivier.moysan@foss.st.com
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
include/sound/hdmi-codec.h
sound/soc/codecs/hdmi-codec.c

index b220072cfa1baf503efbe2d530d7e8392dc16603..273f4c36fad98f3af39900d27c2e5654b2876467 100644 (file)
@@ -120,6 +120,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;
index 69f98975e14ae367f482862724a358eb138ebf6a..5c47aa0551c94be4284b291e0dc04b9c49dc97f0 100644 (file)
@@ -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));