Commit 2f6e8a85 authored by Subhransu S. Prusty's avatar Subhransu S. Prusty Committed by Takashi Iwai

ALSA: hda - Move chmap support helpers/ops to core

Chmap helpers, ops, controls are moved to core.
Signed-off-by: default avatarSubhransu S. Prusty <subhransu.s.prusty@intel.com>
Signed-off-by: default avatarVinod Koul <vinod.koul@intel.com>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 828cb4ed
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#ifndef __SOUND_HDA_CHMAP_H #ifndef __SOUND_HDA_CHMAP_H
#define __SOUND_HDA_CHMAP_H #define __SOUND_HDA_CHMAP_H
#include <sound/pcm.h>
#include <sound/hdaudio.h> #include <sound/hdaudio.h>
...@@ -58,4 +59,18 @@ struct hdac_chmap { ...@@ -58,4 +59,18 @@ struct hdac_chmap {
void snd_hdac_register_chmap_ops(struct hdac_device *hdac, void snd_hdac_register_chmap_ops(struct hdac_device *hdac,
struct hdac_chmap *chmap); struct hdac_chmap *chmap);
int hdmi_channel_allocation(struct hdac_device *hdac, int spk_alloc,
int channels, bool chmap_set,
bool non_pcm, unsigned char *map);
int hdmi_get_active_channels(int ca);
void hdmi_setup_channel_mapping(struct hdac_chmap *chmap,
hda_nid_t pin_nid, bool non_pcm, int ca,
int channels, unsigned char *map,
bool chmap_set);
void snd_print_channel_allocation(int spk_alloc, char *buf, int buflen);
struct hdac_cea_channel_speaker_allocation *hdmi_get_ch_alloc_from_ca(int ca);
int to_spk_mask(unsigned char c);
int spk_to_chmap(int spk);
int snd_hdac_add_chmap_ctls(struct snd_pcm *pcm, int pcm_idx,
struct hdac_chmap *chmap);
#endif /* __SOUND_HDA_CHMAP_H */ #endif /* __SOUND_HDA_CHMAP_H */
This diff is collapsed.
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
#include <linux/slab.h> #include <linux/slab.h>
#include <sound/core.h> #include <sound/core.h>
#include <asm/unaligned.h> #include <asm/unaligned.h>
#include <sound/hda_chmap.h>
#include "hda_codec.h" #include "hda_codec.h"
#include "hda_local.h" #include "hda_local.h"
...@@ -42,20 +43,6 @@ enum cea_edid_versions { ...@@ -42,20 +43,6 @@ enum cea_edid_versions {
CEA_EDID_VER_RESERVED = 4, CEA_EDID_VER_RESERVED = 4,
}; };
static const char * const cea_speaker_allocation_names[] = {
/* 0 */ "FL/FR",
/* 1 */ "LFE",
/* 2 */ "FC",
/* 3 */ "RL/RR",
/* 4 */ "RC",
/* 5 */ "FLC/FRC",
/* 6 */ "RLC/RRC",
/* 7 */ "FLW/FRW",
/* 8 */ "FLH/FRH",
/* 9 */ "TC",
/* 10 */ "FCH",
};
static const char * const eld_connection_type_names[4] = { static const char * const eld_connection_type_names[4] = {
"HDMI", "HDMI",
"DisplayPort", "DisplayPort",
...@@ -419,18 +406,6 @@ static void hdmi_show_short_audio_desc(struct hda_codec *codec, ...@@ -419,18 +406,6 @@ static void hdmi_show_short_audio_desc(struct hda_codec *codec,
a->channels, buf, buf2); a->channels, buf, buf2);
} }
void snd_print_channel_allocation(int spk_alloc, char *buf, int buflen)
{
int i, j;
for (i = 0, j = 0; i < ARRAY_SIZE(cea_speaker_allocation_names); i++) {
if (spk_alloc & (1 << i))
j += snprintf(buf + j, buflen - j, " %s",
cea_speaker_allocation_names[i]);
}
buf[j] = '\0'; /* necessary when j == 0 */
}
void snd_hdmi_show_eld(struct hda_codec *codec, struct parsed_hdmi_eld *e) void snd_hdmi_show_eld(struct hda_codec *codec, struct parsed_hdmi_eld *e)
{ {
int i; int i;
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment