Commit 32c168c8 authored by Anssi Hannula's avatar Anssi Hannula Committed by Takashi Iwai

ALSA: hda - Set Stream Type in Stream Format according to AES0

Set bit 15 (Stream Type) of HDA Stream Format to 1 (Non-PCM) when IEC958
channel status bit 1 (AES0 & 0x02) is set to 1 (non-audio).

This is a prequisite for HDMI HBR passthrough.
Signed-off-by: default avatarAnssi Hannula <anssi.hannula@iki.fi>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 68c18697
...@@ -3051,7 +3051,8 @@ static struct hda_rate_tbl rate_bits[] = { ...@@ -3051,7 +3051,8 @@ static struct hda_rate_tbl rate_bits[] = {
unsigned int snd_hda_calc_stream_format(unsigned int rate, unsigned int snd_hda_calc_stream_format(unsigned int rate,
unsigned int channels, unsigned int channels,
unsigned int format, unsigned int format,
unsigned int maxbps) unsigned int maxbps,
unsigned short spdif_ctls)
{ {
int i; int i;
unsigned int val = 0; unsigned int val = 0;
...@@ -3095,6 +3096,9 @@ unsigned int snd_hda_calc_stream_format(unsigned int rate, ...@@ -3095,6 +3096,9 @@ unsigned int snd_hda_calc_stream_format(unsigned int rate,
return 0; return 0;
} }
if (spdif_ctls & AC_DIG1_NONAUDIO)
val |= 0x8000;
return val; return val;
} }
EXPORT_SYMBOL_HDA(snd_hda_calc_stream_format); EXPORT_SYMBOL_HDA(snd_hda_calc_stream_format);
......
...@@ -928,7 +928,8 @@ void snd_hda_codec_cleanup_stream(struct hda_codec *codec, hda_nid_t nid); ...@@ -928,7 +928,8 @@ void snd_hda_codec_cleanup_stream(struct hda_codec *codec, hda_nid_t nid);
unsigned int snd_hda_calc_stream_format(unsigned int rate, unsigned int snd_hda_calc_stream_format(unsigned int rate,
unsigned int channels, unsigned int channels,
unsigned int format, unsigned int format,
unsigned int maxbps); unsigned int maxbps,
unsigned short spdif_ctls);
int snd_hda_is_supported_format(struct hda_codec *codec, hda_nid_t nid, int snd_hda_is_supported_format(struct hda_codec *codec, hda_nid_t nid,
unsigned int format); unsigned int format);
......
...@@ -1653,7 +1653,8 @@ static int azx_pcm_prepare(struct snd_pcm_substream *substream) ...@@ -1653,7 +1653,8 @@ static int azx_pcm_prepare(struct snd_pcm_substream *substream)
format_val = snd_hda_calc_stream_format(runtime->rate, format_val = snd_hda_calc_stream_format(runtime->rate,
runtime->channels, runtime->channels,
runtime->format, runtime->format,
hinfo->maxbps); hinfo->maxbps,
apcm->codec->spdif_ctls);
if (!format_val) { if (!format_val) {
snd_printk(KERN_ERR SFX snd_printk(KERN_ERR SFX
"invalid format_val, rate=%d, ch=%d, format=%d\n", "invalid format_val, rate=%d, ch=%d, format=%d\n",
......
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