xref: /openbmc/linux/drivers/gpu/drm/msm/dp/dp_audio.h (revision ffcdf473)
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_panel.h"
12 #include "dp_catalog.h"
13 #include <sound/hdmi-codec.h>
14 
15 /**
16  * struct 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 dp_audio {
21 	u32 lane_count;
22 	u32 bw_code;
23 };
24 
25 /**
26  * dp_audio_get()
27  *
28  * Creates and instance of dp audio.
29  *
30  * @pdev: caller's platform device instance.
31  * @panel: an instance of dp_panel module.
32  * @catalog: an instance of dp_catalog module.
33  *
34  * Returns the error code in case of failure, otherwize
35  * an instance of newly created dp_module.
36  */
37 struct dp_audio *dp_audio_get(struct platform_device *pdev,
38 			struct dp_panel *panel,
39 			struct dp_catalog *catalog);
40 
41 /**
42  * dp_register_audio_driver()
43  *
44  * Registers DP device with hdmi_codec interface.
45  *
46  * @dev: DP device instance.
47  * @dp_audio: an instance of dp_audio module.
48  *
49  *
50  * Returns the error code in case of failure, otherwise
51  * zero on success.
52  */
53 int dp_register_audio_driver(struct device *dev,
54 		struct dp_audio *dp_audio);
55 
56 void dp_unregister_audio_driver(struct device *dev, struct dp_audio *dp_audio);
57 
58 /**
59  * dp_audio_put()
60  *
61  * Cleans the dp_audio instance.
62  *
63  * @dp_audio: an instance of dp_audio.
64  */
65 void dp_audio_put(struct dp_audio *dp_audio);
66 
67 int dp_audio_hw_params(struct device *dev,
68 	void *data,
69 	struct hdmi_codec_daifmt *daifmt,
70 	struct hdmi_codec_params *params);
71 
72 #endif /* _DP_AUDIO_H_ */
73 
74 
75