summaryrefslogtreecommitdiff
path: root/sound/pci
diff options
context:
space:
mode:
authorSayak Ghosh Choudhury <sayakc@nvidia.com>2012-01-31 21:05:05 +0530
committerDan Willemsen <dwillemsen@nvidia.com>2013-09-14 01:11:51 -0700
commit803026570efd845b4da21b1049e65509001e943e (patch)
tree2f54207f6115aa16316fad8303e25a6f6ca1a1e0 /sound/pci
parentd9e767212ea61d8c0e2a448d40e902b7c93397b5 (diff)
ALSA:hda: add alsa control for query of device
alsa control is added to facilitate querying ac3 decode capability of connected device. ac3 decode capability of the connected device is updated in the ELD buffer. That information is updated in the ALSA control structure. Bug 909141 Bug 904553 Bug 920831 Change-Id: I81af196fc5dd85c5c87691393cf2f079611f9b47 Signed-off-by: Sayak Ghosh Choudhury <sayakc@nvidia.com> Reviewed-on: http://git-master/r/83067 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Scott Peterson <speterson@nvidia.com> Reviewed-by: Sumit Bhattacharya <sumitb@nvidia.com> Rebase-Id: R70cf80867ed43840fa8f5549e00613cd25ae9508
Diffstat (limited to 'sound/pci')
-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.c6
3 files changed, 22 insertions, 0 deletions
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
index ac3e9e1b7369..e7d71a97674b 100644
--- a/sound/pci/hda/hda_codec.c
+++ b/sound/pci/hda/hda_codec.c
@@ -3270,6 +3270,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,
@@ -3299,6 +3308,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 89a95404674a..40a5fa842dc6 100644
--- a/sound/pci/hda/hda_codec.h
+++ b/sound/pci/hda/hda_codec.h
@@ -905,6 +905,7 @@ struct hda_codec {
unsigned int (*power_filter)(struct hda_codec *codec, hda_nid_t nid,
unsigned int power_state);
+ 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 d0d7ac1e99d2..2913d5349903 100644
--- a/sound/pci/hda/hda_eld.c
+++ b/sound/pci/hda/hda_eld.c
@@ -368,6 +368,12 @@ int snd_hdmi_get_eld(struct hda_codec *codec, hda_nid_t nid,
}
*eld_size = 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:
return ret;
}