summaryrefslogtreecommitdiff
path: root/sound/pci/hda
diff options
context:
space:
mode:
Diffstat (limited to 'sound/pci/hda')
-rw-r--r--sound/pci/hda/hda_codec.c15
-rw-r--r--sound/pci/hda/hda_codec.h1
-rw-r--r--sound/pci/hda/hda_eld.c5
3 files changed, 21 insertions, 0 deletions
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
index 23a9c2eca982..93f979db5a2e 100644
--- a/sound/pci/hda/hda_codec.c
+++ b/sound/pci/hda/hda_codec.c
@@ -2840,6 +2840,15 @@ static int snd_hda_spdif_out_switch_put(struct snd_kcontrol *kcontrol,
return change;
}
+static int snd_hda_hdmi_decode_get(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+{
+ struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
+
+ ucontrol->value.integer.value[0] = codec->ac3dec_capable;
+ return 0;
+}
+
static struct snd_kcontrol_new dig_mixes[] = {
{
.access = SNDRV_CTL_ELEM_ACCESS_READ,
@@ -2869,6 +2878,12 @@ static struct snd_kcontrol_new dig_mixes[] = {
.get = snd_hda_spdif_out_switch_get,
.put = snd_hda_spdif_out_switch_put,
},
+ {
+ .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+ .name = "AC3 Decode Capability",
+ .info = snd_ctl_boolean_mono_info,
+ .get = snd_hda_hdmi_decode_get,
+ },
{ } /* end */
};
diff --git a/sound/pci/hda/hda_codec.h b/sound/pci/hda/hda_codec.h
index 8f801ae14a15..59d4cbe7e06a 100644
--- a/sound/pci/hda/hda_codec.h
+++ b/sound/pci/hda/hda_codec.h
@@ -867,6 +867,7 @@ struct hda_codec {
unsigned long power_jiffies;
#endif
+ bool ac3dec_capable;
/* codec-specific additional proc output */
void (*proc_widget_hook)(struct snd_info_buffer *buffer,
struct hda_codec *codec, hda_nid_t nid);
diff --git a/sound/pci/hda/hda_eld.c b/sound/pci/hda/hda_eld.c
index 44f199c69c4d..615dcb0af1b7 100644
--- a/sound/pci/hda/hda_eld.c
+++ b/sound/pci/hda/hda_eld.c
@@ -351,6 +351,11 @@ int snd_hdmi_get_eld(struct hdmi_eld *eld,
}
ret = hdmi_update_eld(eld, buf, size);
+ codec->ac3dec_capable = false;
+ for (i = 0; i < eld->sad_count; i++) {
+ if (eld->sad[i].format == AUDIO_CODING_TYPE_AC3)
+ codec->ac3dec_capable = true;
+ }
error:
kfree(buf);