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 "dp_catalog.h" 12 #include <sound/hdmi-codec.h> 13 14 /** 15 * struct msm_dp_audio 16 * @lane_count: number of lanes configured in current session 17 * @bw_code: link rate's bandwidth code for current session 18 */ 19 struct msm_dp_audio { 20 u32 lane_count; 21 u32 bw_code; 22 }; 23 24 /** 25 * msm_dp_audio_get() 26 * 27 * Creates and instance of dp audio. 28 * 29 * @pdev: caller's platform device instance. 30 * @catalog: an instance of msm_dp_catalog module. 31 * 32 * Returns the error code in case of failure, otherwize 33 * an instance of newly created msm_dp_module. 34 */ 35 struct msm_dp_audio *msm_dp_audio_get(struct platform_device *pdev, 36 struct msm_dp_catalog *catalog); 37 38 /** 39 * msm_dp_audio_put() 40 * 41 * Cleans the msm_dp_audio instance. 42 * 43 * @msm_dp_audio: an instance of msm_dp_audio. 44 */ 45 void msm_dp_audio_put(struct msm_dp_audio *msm_dp_audio); 46 47 int msm_dp_audio_prepare(struct drm_connector *connector, 48 struct drm_bridge *bridge, 49 struct hdmi_codec_daifmt *daifmt, 50 struct hdmi_codec_params *params); 51 void msm_dp_audio_shutdown(struct drm_connector *connector, 52 struct drm_bridge *bridge); 53 54 #endif /* _DP_AUDIO_H_ */ 55 56 57