diff options
Diffstat (limited to 'sound/pci/hda/hda_eld.c')
-rw-r--r-- | sound/pci/hda/hda_eld.c | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/sound/pci/hda/hda_eld.c b/sound/pci/hda/hda_eld.c index cb0c23a6b473..4a663471dadc 100644 --- a/sound/pci/hda/hda_eld.c +++ b/sound/pci/hda/hda_eld.c | |||
@@ -189,6 +189,9 @@ static void hdmi_update_short_audio_desc(struct cea_sad *a, | |||
189 | a->channels = GRAB_BITS(buf, 0, 0, 3); | 189 | a->channels = GRAB_BITS(buf, 0, 0, 3); |
190 | a->channels++; | 190 | a->channels++; |
191 | 191 | ||
192 | a->sample_bits = 0; | ||
193 | a->max_bitrate = 0; | ||
194 | |||
192 | a->format = GRAB_BITS(buf, 0, 3, 4); | 195 | a->format = GRAB_BITS(buf, 0, 3, 4); |
193 | switch (a->format) { | 196 | switch (a->format) { |
194 | case AUDIO_CODING_TYPE_REF_STREAM_HEADER: | 197 | case AUDIO_CODING_TYPE_REF_STREAM_HEADER: |
@@ -198,7 +201,6 @@ static void hdmi_update_short_audio_desc(struct cea_sad *a, | |||
198 | 201 | ||
199 | case AUDIO_CODING_TYPE_LPCM: | 202 | case AUDIO_CODING_TYPE_LPCM: |
200 | val = GRAB_BITS(buf, 2, 0, 3); | 203 | val = GRAB_BITS(buf, 2, 0, 3); |
201 | a->sample_bits = 0; | ||
202 | for (i = 0; i < 3; i++) | 204 | for (i = 0; i < 3; i++) |
203 | if (val & (1 << i)) | 205 | if (val & (1 << i)) |
204 | a->sample_bits |= cea_sample_sizes[i + 1]; | 206 | a->sample_bits |= cea_sample_sizes[i + 1]; |
@@ -598,24 +600,19 @@ void hdmi_eld_update_pcm_info(struct hdmi_eld *eld, struct hda_pcm_stream *pcm, | |||
598 | { | 600 | { |
599 | int i; | 601 | int i; |
600 | 602 | ||
601 | pcm->rates = 0; | 603 | /* assume basic audio support (the basic audio flag is not in ELD; |
602 | pcm->formats = 0; | 604 | * however, all audio capable sinks are required to support basic |
603 | pcm->maxbps = 0; | 605 | * audio) */ |
604 | pcm->channels_min = -1; | 606 | pcm->rates = SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000; |
605 | pcm->channels_max = 0; | 607 | pcm->formats = SNDRV_PCM_FMTBIT_S16_LE; |
608 | pcm->maxbps = 16; | ||
609 | pcm->channels_max = 2; | ||
606 | for (i = 0; i < eld->sad_count; i++) { | 610 | for (i = 0; i < eld->sad_count; i++) { |
607 | struct cea_sad *a = &eld->sad[i]; | 611 | struct cea_sad *a = &eld->sad[i]; |
608 | pcm->rates |= a->rates; | 612 | pcm->rates |= a->rates; |
609 | if (a->channels < pcm->channels_min) | ||
610 | pcm->channels_min = a->channels; | ||
611 | if (a->channels > pcm->channels_max) | 613 | if (a->channels > pcm->channels_max) |
612 | pcm->channels_max = a->channels; | 614 | pcm->channels_max = a->channels; |
613 | if (a->format == AUDIO_CODING_TYPE_LPCM) { | 615 | if (a->format == AUDIO_CODING_TYPE_LPCM) { |
614 | if (a->sample_bits & AC_SUPPCM_BITS_16) { | ||
615 | pcm->formats |= SNDRV_PCM_FMTBIT_S16_LE; | ||
616 | if (pcm->maxbps < 16) | ||
617 | pcm->maxbps = 16; | ||
618 | } | ||
619 | if (a->sample_bits & AC_SUPPCM_BITS_20) { | 616 | if (a->sample_bits & AC_SUPPCM_BITS_20) { |
620 | pcm->formats |= SNDRV_PCM_FMTBIT_S32_LE; | 617 | pcm->formats |= SNDRV_PCM_FMTBIT_S32_LE; |
621 | if (pcm->maxbps < 20) | 618 | if (pcm->maxbps < 20) |
@@ -635,7 +632,6 @@ void hdmi_eld_update_pcm_info(struct hdmi_eld *eld, struct hda_pcm_stream *pcm, | |||
635 | /* restrict the parameters by the values the codec provides */ | 632 | /* restrict the parameters by the values the codec provides */ |
636 | pcm->rates &= codec_pars->rates; | 633 | pcm->rates &= codec_pars->rates; |
637 | pcm->formats &= codec_pars->formats; | 634 | pcm->formats &= codec_pars->formats; |
638 | pcm->channels_min = max(pcm->channels_min, codec_pars->channels_min); | ||
639 | pcm->channels_max = min(pcm->channels_max, codec_pars->channels_max); | 635 | pcm->channels_max = min(pcm->channels_max, codec_pars->channels_max); |
640 | pcm->maxbps = min(pcm->maxbps, codec_pars->maxbps); | 636 | pcm->maxbps = min(pcm->maxbps, codec_pars->maxbps); |
641 | } | 637 | } |