aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/hda_eld.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/pci/hda/hda_eld.c')
-rw-r--r--sound/pci/hda/hda_eld.c22
1 files changed, 8 insertions, 14 deletions
diff --git a/sound/pci/hda/hda_eld.c b/sound/pci/hda/hda_eld.c
index 26c3ade73583..3c17a0a5ea81 100644
--- a/sound/pci/hda/hda_eld.c
+++ b/sound/pci/hda/hda_eld.c
@@ -381,7 +381,7 @@ static void hdmi_show_short_audio_desc(struct cea_sad *a)
381 snd_print_pcm_rates(a->rates, buf, sizeof(buf)); 381 snd_print_pcm_rates(a->rates, buf, sizeof(buf));
382 382
383 if (a->format == AUDIO_CODING_TYPE_LPCM) 383 if (a->format == AUDIO_CODING_TYPE_LPCM)
384 snd_print_pcm_bits(a->sample_bits, buf2 + 8, sizeof(buf2 - 8)); 384 snd_print_pcm_bits(a->sample_bits, buf2 + 8, sizeof(buf2) - 8);
385 else if (a->max_bitrate) 385 else if (a->max_bitrate)
386 snprintf(buf2, sizeof(buf2), 386 snprintf(buf2, sizeof(buf2),
387 ", max bitrate = %d", a->max_bitrate); 387 ", max bitrate = %d", a->max_bitrate);
@@ -604,24 +604,19 @@ void hdmi_eld_update_pcm_info(struct hdmi_eld *eld, struct hda_pcm_stream *pcm,
604{ 604{
605 int i; 605 int i;
606 606
607 pcm->rates = 0; 607 /* assume basic audio support (the basic audio flag is not in ELD;
608 pcm->formats = 0; 608 * however, all audio capable sinks are required to support basic
609 pcm->maxbps = 0; 609 * audio) */
610 pcm->channels_min = -1; 610 pcm->rates = SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000;
611 pcm->channels_max = 0; 611 pcm->formats = SNDRV_PCM_FMTBIT_S16_LE;
612 pcm->maxbps = 16;
613 pcm->channels_max = 2;
612 for (i = 0; i < eld->sad_count; i++) { 614 for (i = 0; i < eld->sad_count; i++) {
613 struct cea_sad *a = &eld->sad[i]; 615 struct cea_sad *a = &eld->sad[i];
614 pcm->rates |= a->rates; 616 pcm->rates |= a->rates;
615 if (a->channels < pcm->channels_min)
616 pcm->channels_min = a->channels;
617 if (a->channels > pcm->channels_max) 617 if (a->channels > pcm->channels_max)
618 pcm->channels_max = a->channels; 618 pcm->channels_max = a->channels;
619 if (a->format == AUDIO_CODING_TYPE_LPCM) { 619 if (a->format == AUDIO_CODING_TYPE_LPCM) {
620 if (a->sample_bits & AC_SUPPCM_BITS_16) {
621 pcm->formats |= SNDRV_PCM_FMTBIT_S16_LE;
622 if (pcm->maxbps < 16)
623 pcm->maxbps = 16;
624 }
625 if (a->sample_bits & AC_SUPPCM_BITS_20) { 620 if (a->sample_bits & AC_SUPPCM_BITS_20) {
626 pcm->formats |= SNDRV_PCM_FMTBIT_S32_LE; 621 pcm->formats |= SNDRV_PCM_FMTBIT_S32_LE;
627 if (pcm->maxbps < 20) 622 if (pcm->maxbps < 20)
@@ -641,7 +636,6 @@ void hdmi_eld_update_pcm_info(struct hdmi_eld *eld, struct hda_pcm_stream *pcm,
641 /* restrict the parameters by the values the codec provides */ 636 /* restrict the parameters by the values the codec provides */
642 pcm->rates &= codec_pars->rates; 637 pcm->rates &= codec_pars->rates;
643 pcm->formats &= codec_pars->formats; 638 pcm->formats &= codec_pars->formats;
644 pcm->channels_min = max(pcm->channels_min, codec_pars->channels_min);
645 pcm->channels_max = min(pcm->channels_max, codec_pars->channels_max); 639 pcm->channels_max = min(pcm->channels_max, codec_pars->channels_max);
646 pcm->maxbps = min(pcm->maxbps, codec_pars->maxbps); 640 pcm->maxbps = min(pcm->maxbps, codec_pars->maxbps);
647} 641}