linux/drivers/gpu/drm/radeon/radeon_audio.c

/*
 * Copyright 2014 Advanced Micro Devices, Inc.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a
 * copy of this software and associated documentation files (the "Software"),
 * to deal in the Software without restriction, including without limitation
 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
 * and/or sell copies of the Software, and to permit persons to whom the
 * Software is furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
 * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 * OTHER DEALINGS IN THE SOFTWARE.
 *
 * Authors: Slava Grigorev <[email protected]>
 */

#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)
{}

/*
 * calculate CTS and N values if they are not found in the table
 */
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)
{}

/*
 * update the N and CTS parameters for a given pixel clock rate
 */
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)
{}

/*
 * update the info frames with the data from the current display mode
 */
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)
{}

/*
 * Audio component support
 */
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)
{}