1 /* SPDX-License-Identifier: GPL-2.0-only */ 2 /* 3 * Copyright (c) 2017-2020, The Linux Foundation. All rights reserved. 4 */ 5 6 #ifndef _DP_AUDIO_H_ 7 #define _DP_AUDIO_H_ 8 9 #include <linux/platform_device.h> 10 11 #include <sound/hdmi-codec.h> 12 13 struct drm_bridge; 14 15 /** 16 * struct msm_dp_audio 17 * @lane_count: number of lanes configured in current session 18 * @bw_code: link rate's bandwidth code for current session 19 */ 20 struct msm_dp_audio { 21 u32 lane_count; 22 u32 bw_code; 23 }; 24 25 /** 26 * msm_dp_audio_get() 27 * 28 * Creates and instance of dp audio. 29 * 30 * @pdev: caller's platform device instance. 31 * @link_base: pointer to the msm_dp_link resource. 32 * 33 * Returns the error code in case of failure, otherwize 34 * an instance of newly created msm_dp_module. 35 */ 36 struct msm_dp_audio *msm_dp_audio_get(struct platform_device *pdev, 37 void __iomem *link_base); 38 39 /** 40 * msm_dp_audio_put() 41 * 42 * Cleans the msm_dp_audio instance. 43 * 44 * @msm_dp_audio: an instance of msm_dp_audio. 45 */ 46 void msm_dp_audio_put(struct msm_dp_audio *msm_dp_audio); 47 48 int msm_dp_audio_prepare(struct drm_bridge *bridge, 49 struct drm_connector *connector, 50 struct hdmi_codec_daifmt *daifmt, 51 struct hdmi_codec_params *params); 52 void msm_dp_audio_shutdown(struct drm_bridge *bridge, 53 struct drm_connector *connector); 54 55 #endif /* _DP_AUDIO_H_ */ 56 57 58