#include <linux/gcd.h>
#include <linux/component.h>
#include <drm/drm_crtc.h>
#include <drm/drm_eld.h>
#include <drm/drm_edid.h>
#include "dce6_afmt.h"
#include "evergreen_hdmi.h"
#include "radeon.h"
#include "atom.h"
#include "r600.h"
#include "radeon_audio.h"
void dce6_audio_enable(struct radeon_device *rdev, struct r600_audio_pin *pin,
u8 enable_mask);
struct r600_audio_pin *r600_audio_get_pin(struct radeon_device *rdev);
struct r600_audio_pin *dce6_audio_get_pin(struct radeon_device *rdev);
static void radeon_audio_hdmi_mode_set(struct drm_encoder *encoder,
struct drm_display_mode *mode);
static void radeon_audio_dp_mode_set(struct drm_encoder *encoder,
struct drm_display_mode *mode);
static const u32 pin_offsets[7] = …;
static u32 radeon_audio_rreg(struct radeon_device *rdev, u32 offset, u32 reg)
{ … }
static void radeon_audio_wreg(struct radeon_device *rdev, u32 offset,
u32 reg, u32 v)
{ … }
static struct radeon_audio_basic_funcs r600_funcs = …;
static struct radeon_audio_basic_funcs dce32_funcs = …;
static struct radeon_audio_basic_funcs dce4_funcs = …;
static struct radeon_audio_basic_funcs dce6_funcs = …;
static struct radeon_audio_funcs r600_hdmi_funcs = …;
static struct radeon_audio_funcs dce32_hdmi_funcs = …;
static struct radeon_audio_funcs dce32_dp_funcs = …;
static struct radeon_audio_funcs dce4_hdmi_funcs = …;
static struct radeon_audio_funcs dce4_dp_funcs = …;
static struct radeon_audio_funcs dce6_hdmi_funcs = …;
static struct radeon_audio_funcs dce6_dp_funcs = …;
static void radeon_audio_component_notify(struct radeon_device *rdev, int port);
static void radeon_audio_enable(struct radeon_device *rdev,
struct r600_audio_pin *pin, u8 enable_mask)
{ … }
static void radeon_audio_interface_init(struct radeon_device *rdev)
{ … }
static int radeon_audio_chipset_supported(struct radeon_device *rdev)
{ … }
int radeon_audio_init(struct radeon_device *rdev)
{ … }
u32 radeon_audio_endpoint_rreg(struct radeon_device *rdev, u32 offset, u32 reg)
{ … }
void radeon_audio_endpoint_wreg(struct radeon_device *rdev, u32 offset,
u32 reg, u32 v)
{ … }
static void radeon_audio_write_sad_regs(struct drm_encoder *encoder)
{ … }
static void radeon_audio_write_speaker_allocation(struct drm_encoder *encoder)
{ … }
static void radeon_audio_write_latency_fields(struct drm_encoder *encoder,
struct drm_display_mode *mode)
{ … }
struct r600_audio_pin *radeon_audio_get_pin(struct drm_encoder *encoder)
{ … }
static void radeon_audio_select_pin(struct drm_encoder *encoder)
{ … }
void radeon_audio_detect(struct drm_connector *connector,
struct drm_encoder *encoder,
enum drm_connector_status status)
{ … }
void radeon_audio_fini(struct radeon_device *rdev)
{ … }
static void radeon_audio_set_dto(struct drm_encoder *encoder, unsigned int clock)
{ … }
static int radeon_audio_set_avi_packet(struct drm_encoder *encoder,
struct drm_display_mode *mode)
{ … }
static void radeon_audio_calc_cts(unsigned int clock, int *CTS, int *N, int freq)
{ … }
static const struct radeon_hdmi_acr *radeon_audio_acr(unsigned int clock)
{ … }
static void radeon_audio_update_acr(struct drm_encoder *encoder, unsigned int clock)
{ … }
static void radeon_audio_set_vbi_packet(struct drm_encoder *encoder)
{ … }
static void radeon_hdmi_set_color_depth(struct drm_encoder *encoder)
{ … }
static void radeon_audio_set_audio_packet(struct drm_encoder *encoder)
{ … }
static void radeon_audio_set_mute(struct drm_encoder *encoder, bool mute)
{ … }
static void radeon_audio_hdmi_mode_set(struct drm_encoder *encoder,
struct drm_display_mode *mode)
{ … }
static void radeon_audio_dp_mode_set(struct drm_encoder *encoder,
struct drm_display_mode *mode)
{ … }
void radeon_audio_mode_set(struct drm_encoder *encoder,
struct drm_display_mode *mode)
{ … }
void radeon_audio_dpms(struct drm_encoder *encoder, int mode)
{ … }
unsigned int radeon_audio_decode_dfs_div(unsigned int div)
{ … }
static void radeon_audio_component_notify(struct radeon_device *rdev, int port)
{ … }
static int radeon_audio_component_get_eld(struct device *kdev, int port,
int pipe, bool *enabled,
unsigned char *buf, int max_bytes)
{ … }
static const struct drm_audio_component_ops radeon_audio_component_ops = …;
static int radeon_audio_component_bind(struct device *kdev,
struct device *hda_kdev, void *data)
{ … }
static void radeon_audio_component_unbind(struct device *kdev,
struct device *hda_kdev, void *data)
{ … }
static const struct component_ops radeon_audio_component_bind_ops = …;
void radeon_audio_component_init(struct radeon_device *rdev)
{ … }
void radeon_audio_component_fini(struct radeon_device *rdev)
{ … }