#include "reg_helper.h"
#include "dce_audio.h"
#include "dce/dce_11_0_d.h"
#include "dce/dce_11_0_sh_mask.h"
#define DCE_AUD(audio) …
#define CTX …
#define DC_LOGGER_INIT() …
#define REG(reg) …
#undef FN
#define FN(reg_name, field_name) …
#define IX_REG(reg) …
#define AZ_REG_READ(reg_name) …
#define AZ_REG_WRITE(reg_name, value) …
static void write_indirect_azalia_reg(struct audio *audio,
uint32_t reg_index,
uint32_t reg_data)
{ … }
static uint32_t read_indirect_azalia_reg(struct audio *audio, uint32_t reg_index)
{ … }
static bool is_audio_format_supported(
const struct audio_info *audio_info,
enum audio_format_code audio_format_code,
uint32_t *format_index)
{ … }
static void check_audio_bandwidth_hdmi(
const struct audio_crtc_info *crtc_info,
uint32_t channel_count,
union audio_sample_rates *sample_rates)
{ … }
static struct fixed31_32 get_link_symbol_clk_freq_mhz(enum dc_link_rate link_rate)
{ … }
struct dp_audio_layout_config { … };
static void get_audio_layout_config(
uint32_t channel_count,
enum dp_link_encoding encoding,
struct dp_audio_layout_config *output)
{ … }
static uint32_t get_av_stream_map_lane_count(
enum dp_link_encoding encoding,
enum dc_lane_count lane_count,
bool is_mst)
{ … }
static uint32_t get_audio_sdp_overhead(
enum dp_link_encoding encoding,
enum dc_lane_count lane_count,
bool is_mst)
{ … }
static uint32_t calculate_required_audio_bw_in_symbols(
const struct audio_crtc_info *crtc_info,
const struct dp_audio_layout_config *layout_config,
uint32_t channel_count,
uint32_t sample_rate_hz,
uint32_t av_stream_map_lane_count,
uint32_t audio_sdp_overhead)
{ … }
static uint32_t calculate_available_hblank_bw_in_symbols(
const struct audio_crtc_info *crtc_info,
const struct audio_dp_link_info *dp_link_info)
{ … }
static void check_audio_bandwidth_dp(
const struct audio_crtc_info *crtc_info,
const struct audio_dp_link_info *dp_link_info,
uint32_t channel_count,
union audio_sample_rates *sample_rates)
{ … }
static void check_audio_bandwidth(
const struct audio_crtc_info *crtc_info,
const struct audio_dp_link_info *dp_link_info,
uint32_t channel_count,
enum signal_type signal,
union audio_sample_rates *sample_rates)
{ … }
static void set_high_bit_rate_capable(
struct audio *audio,
bool capable)
{ … }
static void set_video_latency(
struct audio *audio,
int latency_in_ms)
{ … }
static void set_audio_latency(
struct audio *audio,
int latency_in_ms)
{ … }
void dce_aud_az_enable(struct audio *audio)
{ … }
void dce_aud_az_disable(struct audio *audio)
{ … }
void dce_aud_az_configure(
struct audio *audio,
enum signal_type signal,
const struct audio_crtc_info *crtc_info,
const struct audio_info *audio_info,
const struct audio_dp_link_info *dp_link_info)
{ … }
static void get_azalia_clock_info_hdmi(
uint32_t crtc_pixel_clock_100hz,
uint32_t actual_pixel_clock_100Hz,
struct azalia_clock_info *azalia_clock_info)
{ … }
static void get_azalia_clock_info_dp(
uint32_t requested_pixel_clock_100Hz,
const struct audio_pll_info *pll_info,
struct azalia_clock_info *azalia_clock_info)
{ … }
void dce_aud_wall_dto_setup(
struct audio *audio,
enum signal_type signal,
const struct audio_crtc_info *crtc_info,
const struct audio_pll_info *pll_info)
{ … }
#if defined(CONFIG_DRM_AMD_DC_SI)
static void dce60_aud_wall_dto_setup(
struct audio *audio,
enum signal_type signal,
const struct audio_crtc_info *crtc_info,
const struct audio_pll_info *pll_info)
{ … }
#endif
static bool dce_aud_endpoint_valid(struct audio *audio)
{ … }
void dce_aud_hw_init(
struct audio *audio)
{ … }
static const struct audio_funcs funcs = …;
#if defined(CONFIG_DRM_AMD_DC_SI)
static const struct audio_funcs dce60_funcs = …;
#endif
void dce_aud_destroy(struct audio **audio)
{ … }
struct audio *dce_audio_create(
struct dc_context *ctx,
unsigned int inst,
const struct dce_audio_registers *reg,
const struct dce_audio_shift *shifts,
const struct dce_audio_mask *masks
)
{ … }
#if defined(CONFIG_DRM_AMD_DC_SI)
struct audio *dce60_audio_create(
struct dc_context *ctx,
unsigned int inst,
const struct dce_audio_registers *reg,
const struct dce_audio_shift *shifts,
const struct dce_audio_mask *masks
)
{ … }
#endif