Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/bridge: allow limiting I2S formats

By default HDMI codec registers all formats supported on the I2S bus.
Allow bridges (and connectors) to limit the list of the PCM formats
supported by the HDMI codec.

Reviewed-by: Maxime Ripard <mripard@kernel.org>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://lore.kernel.org/r/20250517-drm-hdmi-connector-cec-v6-2-35651db6f19b@oss.qualcomm.com
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>

+14 -1
+1
drivers/gpu/drm/display/drm_bridge_connector.c
··· 717 717 ret = drm_connector_hdmi_audio_init(connector, dev, 718 718 &drm_bridge_connector_hdmi_audio_funcs, 719 719 bridge->hdmi_audio_max_i2s_playback_channels, 720 + bridge->hdmi_audio_i2s_formats, 720 721 bridge->hdmi_audio_spdif_playback, 721 722 bridge->hdmi_audio_dai_port); 722 723 if (ret)
+3
drivers/gpu/drm/display/drm_hdmi_audio_helper.c
··· 142 142 * @hdmi_codec_dev: device to be used as a parent for the HDMI Codec 143 143 * @funcs: callbacks for this HDMI Codec 144 144 * @max_i2s_playback_channels: maximum number of playback I2S channels 145 + * @i2s_formats: set of I2S formats (use 0 for a bus-specific set) 145 146 * @spdif_playback: set if HDMI codec has S/PDIF playback port 146 147 * @dai_port: sound DAI port, -1 if it is not enabled 147 148 * ··· 155 154 struct device *hdmi_codec_dev, 156 155 const struct drm_connector_hdmi_audio_funcs *funcs, 157 156 unsigned int max_i2s_playback_channels, 157 + u64 i2s_formats, 158 158 bool spdif_playback, 159 159 int dai_port) 160 160 { ··· 163 161 .ops = &drm_connector_hdmi_audio_ops, 164 162 .max_i2s_channels = max_i2s_playback_channels, 165 163 .i2s = !!max_i2s_playback_channels, 164 + .i2s_formats = i2s_formats, 166 165 .spdif = spdif_playback, 167 166 .no_i2s_capture = true, 168 167 .no_spdif_capture = true,
+1 -1
drivers/gpu/drm/vc4/vc4_hdmi.c
··· 562 562 563 563 ret = drm_connector_hdmi_audio_init(connector, dev->dev, 564 564 &vc4_hdmi_audio_funcs, 565 - 8, false, -1); 565 + 8, 0, false, -1); 566 566 if (ret) 567 567 return ret; 568 568
+1
include/drm/display/drm_hdmi_audio_helper.h
··· 14 14 struct device *hdmi_codec_dev, 15 15 const struct drm_connector_hdmi_audio_funcs *funcs, 16 16 unsigned int max_i2s_playback_channels, 17 + u64 i2s_formats, 17 18 bool spdif_playback, 18 19 int sound_dai_port); 19 20 void drm_connector_hdmi_audio_plugged_notify(struct drm_connector *connector,
+8
include/drm/drm_bridge.h
··· 1017 1017 int hdmi_audio_max_i2s_playback_channels; 1018 1018 1019 1019 /** 1020 + * @hdmi_audio_i2s_formats: supported I2S formats, optional. The 1021 + * default is to allow all formats supported by the corresponding I2S 1022 + * bus driver. This is only used for bridges setting 1023 + * @DRM_BRIDGE_OP_HDMI_AUDIO or @DRM_BRIDGE_OP_DP_AUDIO. 1024 + */ 1025 + u64 hdmi_audio_i2s_formats; 1026 + 1027 + /** 1020 1028 * @hdmi_audio_spdif_playback: set if this bridge has S/PDIF playback 1021 1029 * port for @DRM_BRIDGE_OP_HDMI_AUDIO or @DRM_BRIDGE_OP_DP_AUDIO. 1022 1030 */