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

Configure Feed

Select the types of activity you want to include in your feed.

drm/bridge: add function interface for DisplayPort audio implementation

It is common for the DisplayPort bridges to implement audio support. In
preparation to providing a generic framework for DP audio, add
corresponding interface to struct drm_bridge. As suggested by Maxime
for now this is mostly c&p of the corresponding HDMI audio API.

Reviewed-by: Maxime Ripard <mripard@kernel.org>
Link: https://lore.kernel.org/r/20250314-dp-hdmi-audio-v6-2-dbd228fa73d7@oss.qualcomm.com
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>

+82 -6
+82 -6
include/drm/drm_bridge.h
··· 738 738 bool enable, int direction); 739 739 740 740 /** 741 + * @dp_audio_startup: 742 + * 743 + * Called when ASoC starts a DisplayPort audio stream setup. 744 + * 745 + * This callback is optional, it can be implemented by bridges that 746 + * set the @DRM_BRIDGE_OP_DP_AUDIO flag in their &drm_bridge->ops. 747 + * 748 + * Returns: 749 + * 0 on success, a negative error code otherwise 750 + */ 751 + int (*dp_audio_startup)(struct drm_connector *connector, 752 + struct drm_bridge *bridge); 753 + 754 + /** 755 + * @dp_audio_prepare: 756 + * Configures DisplayPort audio stream. Can be called multiple 757 + * times for each setup. 758 + * 759 + * This callback is optional but it must be implemented by bridges that 760 + * set the @DRM_BRIDGE_OP_DP_AUDIO flag in their &drm_bridge->ops. 761 + * 762 + * Returns: 763 + * 0 on success, a negative error code otherwise 764 + */ 765 + int (*dp_audio_prepare)(struct drm_connector *connector, 766 + struct drm_bridge *bridge, 767 + struct hdmi_codec_daifmt *fmt, 768 + struct hdmi_codec_params *hparms); 769 + 770 + /** 771 + * @dp_audio_shutdown: 772 + * 773 + * Shut down the DisplayPort audio stream. 774 + * 775 + * This callback is optional but it must be implemented by bridges that 776 + * set the @DRM_BRIDGE_OP_DP_AUDIO flag in their &drm_bridge->ops. 777 + * 778 + * Returns: 779 + * 0 on success, a negative error code otherwise 780 + */ 781 + void (*dp_audio_shutdown)(struct drm_connector *connector, 782 + struct drm_bridge *bridge); 783 + 784 + /** 785 + * @dp_audio_mute_stream: 786 + * 787 + * Mute/unmute DisplayPort audio stream. 788 + * 789 + * This callback is optional, it can be implemented by bridges that 790 + * set the @DRM_BRIDGE_OP_DP_AUDIO flag in their &drm_bridge->ops. 791 + * 792 + * Returns: 793 + * 0 on success, a negative error code otherwise 794 + */ 795 + int (*dp_audio_mute_stream)(struct drm_connector *connector, 796 + struct drm_bridge *bridge, 797 + bool enable, int direction); 798 + 799 + /** 741 800 * @debugfs_init: 742 801 * 743 802 * Allows bridges to create bridge-specific debugfs files. ··· 889 830 * 890 831 * Note: currently there can be at most one bridge in a chain that sets 891 832 * this bit. This is to simplify corresponding glue code in connector 892 - * drivers. 833 + * drivers. Also it is not possible to have a bridge in the chain that 834 + * sets @DRM_BRIDGE_OP_DP_AUDIO if there is a bridge that sets this 835 + * flag. 893 836 */ 894 837 DRM_BRIDGE_OP_HDMI_AUDIO = BIT(5), 838 + /** 839 + * @DRM_BRIDGE_OP_DP_AUDIO: The bridge provides DisplayPort audio operations. 840 + * Bridges that set this flag must implement the 841 + * &drm_bridge_funcs->dp_audio_prepare and 842 + * &drm_bridge_funcs->dp_audio_shutdown callbacks. 843 + * 844 + * Note: currently there can be at most one bridge in a chain that sets 845 + * this bit. This is to simplify corresponding glue code in connector 846 + * drivers. Also it is not possible to have a bridge in the chain that 847 + * sets @DRM_BRIDGE_OP_HDMI_AUDIO if there is a bridge that sets this 848 + * flag. 849 + */ 850 + DRM_BRIDGE_OP_DP_AUDIO = BIT(6), 895 851 }; 896 852 897 853 /** ··· 1020 946 1021 947 /** 1022 948 * @hdmi_audio_dev: device to be used as a parent for the HDMI Codec if 1023 - * @DRM_BRIDGE_OP_HDMI_AUDIO is set. 949 + * either of @DRM_BRIDGE_OP_HDMI_AUDIO or @DRM_BRIDGE_OP_DP_AUDIO is set. 1024 950 */ 1025 951 struct device *hdmi_audio_dev; 1026 952 1027 953 /** 1028 954 * @hdmi_audio_max_i2s_playback_channels: maximum number of playback 1029 - * I2S channels for the bridge that sets @DRM_BRIDGE_OP_HDMI_AUDIO. 955 + * I2S channels for the @DRM_BRIDGE_OP_HDMI_AUDIO or 956 + * @DRM_BRIDGE_OP_DP_AUDIO. 1030 957 */ 1031 958 int hdmi_audio_max_i2s_playback_channels; 1032 959 1033 960 /** 1034 961 * @hdmi_audio_spdif_playback: set if this bridge has S/PDIF playback 1035 - * port for @DRM_BRIDGE_OP_HDMI_AUDIO 962 + * port for @DRM_BRIDGE_OP_HDMI_AUDIO or @DRM_BRIDGE_OP_DP_AUDIO. 1036 963 */ 1037 964 unsigned int hdmi_audio_spdif_playback : 1; 1038 965 1039 966 /** 1040 - * @hdmi_audio_dai_port: sound DAI port for @DRM_BRIDGE_OP_HDMI_AUDIO, 1041 - * -1 if it is not used. 967 + * @hdmi_audio_dai_port: sound DAI port for either of 968 + * @DRM_BRIDGE_OP_HDMI_AUDIO and @DRM_BRIDGE_OP_DP_AUDIO, -1 if it is 969 + * not used. 1042 970 */ 1043 971 int hdmi_audio_dai_port; 1044 972 };