2020-09-12 13:49:29 -07:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
|
|
/*
|
|
|
|
* Copyright (c) 2017-2020, The Linux Foundation. All rights reserved.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _DP_AUDIO_H_
|
|
|
|
#define _DP_AUDIO_H_
|
|
|
|
|
|
|
|
#include <linux/platform_device.h>
|
|
|
|
|
|
|
|
#include <sound/hdmi-codec.h>
|
|
|
|
|
2025-05-18 14:21:44 +03:00
|
|
|
struct drm_bridge;
|
|
|
|
|
2020-09-12 13:49:29 -07:00
|
|
|
/**
|
2024-10-29 22:28:24 +02:00
|
|
|
* struct msm_dp_audio
|
2020-09-12 13:49:29 -07:00
|
|
|
* @lane_count: number of lanes configured in current session
|
|
|
|
* @bw_code: link rate's bandwidth code for current session
|
|
|
|
*/
|
2024-10-29 22:28:24 +02:00
|
|
|
struct msm_dp_audio {
|
2020-09-12 13:49:29 -07:00
|
|
|
u32 lane_count;
|
|
|
|
u32 bw_code;
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
2024-10-29 22:28:24 +02:00
|
|
|
* msm_dp_audio_get()
|
2020-09-12 13:49:29 -07:00
|
|
|
*
|
|
|
|
* Creates and instance of dp audio.
|
|
|
|
*
|
|
|
|
* @pdev: caller's platform device instance.
|
2025-05-18 14:21:44 +03:00
|
|
|
* @link_base: pointer to the msm_dp_link resource.
|
2020-09-12 13:49:29 -07:00
|
|
|
*
|
|
|
|
* Returns the error code in case of failure, otherwize
|
2024-10-29 22:28:24 +02:00
|
|
|
* an instance of newly created msm_dp_module.
|
2020-09-12 13:49:29 -07:00
|
|
|
*/
|
2024-10-29 22:28:24 +02:00
|
|
|
struct msm_dp_audio *msm_dp_audio_get(struct platform_device *pdev,
|
2025-05-18 14:21:44 +03:00
|
|
|
void __iomem *link_base);
|
2020-09-12 13:49:29 -07:00
|
|
|
|
|
|
|
/**
|
2024-10-29 22:28:24 +02:00
|
|
|
* msm_dp_audio_put()
|
2020-09-12 13:49:29 -07:00
|
|
|
*
|
2024-10-29 22:28:24 +02:00
|
|
|
* Cleans the msm_dp_audio instance.
|
2020-09-12 13:49:29 -07:00
|
|
|
*
|
2024-10-29 22:28:24 +02:00
|
|
|
* @msm_dp_audio: an instance of msm_dp_audio.
|
2020-09-12 13:49:29 -07:00
|
|
|
*/
|
2024-10-29 22:28:24 +02:00
|
|
|
void msm_dp_audio_put(struct msm_dp_audio *msm_dp_audio);
|
2020-09-12 13:49:29 -07:00
|
|
|
|
2025-07-03 20:49:52 +08:00
|
|
|
int msm_dp_audio_prepare(struct drm_bridge *bridge,
|
|
|
|
struct drm_connector *connector,
|
2025-05-02 01:41:42 +03:00
|
|
|
struct hdmi_codec_daifmt *daifmt,
|
|
|
|
struct hdmi_codec_params *params);
|
2025-07-03 20:49:52 +08:00
|
|
|
void msm_dp_audio_shutdown(struct drm_bridge *bridge,
|
|
|
|
struct drm_connector *connector);
|
2020-09-12 13:49:29 -07:00
|
|
|
|
|
|
|
#endif /* _DP_AUDIO_H_ */
|
|
|
|
|
|
|
|
|