linux/sound/pci/hda/hda_eld.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * Generic routines and proc interface for ELD(EDID Like Data) information
 *
 * Copyright(c) 2008 Intel Corporation.
 * Copyright (c) 2013 Anssi Hannula <[email protected]>
 *
 * Authors:
 * 		Wu Fengguang <[email protected]>
 */

#include <linux/init.h>
#include <linux/slab.h>
#include <sound/core.h>
#include <asm/unaligned.h>
#include <sound/hda_chmap.h>
#include <sound/hda_codec.h>
#include "hda_local.h"

enum eld_versions {};

enum cea_edid_versions {};

static const char * const eld_connection_type_names[4] =;

enum cea_audio_coding_types {};

enum cea_audio_coding_xtypes {};

static const char * const cea_audio_coding_type_names[] =;

/*
 * The following two lists are shared between
 * 	- HDMI audio InfoFrame (source to sink)
 * 	- CEA E-EDID Extension (sink to source)
 */

/*
 * SS1:SS0 index => sample size
 */
static const int cea_sample_sizes[4] =;

/*
 * SF2:SF1:SF0 index => sampling frequency
 */
static const int cea_sampling_frequencies[8] =;

static unsigned int hdmi_get_eld_data(struct hda_codec *codec, hda_nid_t nid,
					int byte_index)
{}

#define GRAB_BITS(buf, byte, lowbit, bits)

static void hdmi_update_short_audio_desc(struct hda_codec *codec,
					 struct cea_sad *a,
					 const unsigned char *buf)
{}

/*
 * Be careful, ELD buf could be totally rubbish!
 */
int snd_hdmi_parse_eld(struct hda_codec *codec, struct parsed_hdmi_eld *e,
			  const unsigned char *buf, int size)
{}

int snd_hdmi_get_eld_size(struct hda_codec *codec, hda_nid_t nid)
{}

int snd_hdmi_get_eld(struct hda_codec *codec, hda_nid_t nid,
		     unsigned char *buf, int *eld_size)
{}

/*
 * SNDRV_PCM_RATE_* and AC_PAR_PCM values don't match, print correct rates with
 * hdmi-specific routine.
 */
static void hdmi_print_pcm_rates(int pcm, char *buf, int buflen)
{}

#define SND_PRINT_RATES_ADVISED_BUFSIZE

static void hdmi_show_short_audio_desc(struct hda_codec *codec,
				       struct cea_sad *a)
{}

void snd_hdmi_show_eld(struct hda_codec *codec, struct parsed_hdmi_eld *e)
{}

#ifdef CONFIG_SND_PROC_FS

static void hdmi_print_sad_info(int i, struct cea_sad *a,
				struct snd_info_buffer *buffer)
{}

void snd_hdmi_print_eld_info(struct hdmi_eld *eld,
			     struct snd_info_buffer *buffer,
			     hda_nid_t pin_nid, int dev_id, hda_nid_t cvt_nid)
{}

void snd_hdmi_write_eld_info(struct hdmi_eld *eld,
			     struct snd_info_buffer *buffer)
{}
#endif /* CONFIG_SND_PROC_FS */

/* update PCM info based on ELD */
void snd_hdmi_eld_update_pcm_info(struct parsed_hdmi_eld *e,
			      struct hda_pcm_stream *hinfo)
{}


/* ATI/AMD specific stuff (ELD emulation) */

#define ATI_VERB_SET_AUDIO_DESCRIPTOR
#define ATI_VERB_SET_SINK_INFO_INDEX
#define ATI_VERB_GET_SPEAKER_ALLOCATION
#define ATI_VERB_GET_AUDIO_DESCRIPTOR
#define ATI_VERB_GET_AUDIO_VIDEO_DELAY
#define ATI_VERB_GET_SINK_INFO_INDEX
#define ATI_VERB_GET_SINK_INFO_DATA

#define ATI_SPKALLOC_SPKALLOC
#define ATI_SPKALLOC_TYPE_HDMI
#define ATI_SPKALLOC_TYPE_DISPLAYPORT

/* first three bytes are just standard SAD */
#define ATI_AUDIODESC_CHANNELS
#define ATI_AUDIODESC_RATES
#define ATI_AUDIODESC_LPCM_STEREO_RATES

/* in standard HDMI VSDB format */
#define ATI_DELAY_VIDEO_LATENCY
#define ATI_DELAY_AUDIO_LATENCY

enum ati_sink_info_idx {};

int snd_hdmi_get_eld_ati(struct hda_codec *codec, hda_nid_t nid,
			 unsigned char *buf, int *eld_size, bool rev3_or_later)
{}