struct azx_dev *azx_dev = get_azx_dev(substream);
        struct hda_pcm_stream *hinfo = to_hda_pcm_stream(substream);
        struct snd_pcm_runtime *runtime = substream->runtime;
-       unsigned int format_val, stream_tag;
+       unsigned int format_val, stream_tag, bits;
        int err;
        struct hda_spdif_out *spdif =
                snd_hda_spdif_out_of_nid(apcm->codec, hinfo->nid);
        }
 
        snd_hdac_stream_reset(azx_stream(azx_dev));
-       format_val = snd_hdac_calc_stream_format(runtime->rate,
-                                               runtime->channels,
-                                               runtime->format,
-                                               hinfo->maxbps,
-                                               ctls);
+       bits = snd_hdac_stream_format_bits(runtime->format, SNDRV_PCM_SUBFORMAT_STD, hinfo->maxbps);
+
+       format_val = snd_hdac_spdif_stream_format(runtime->channels, bits, runtime->rate, ctls);
        if (!format_val) {
                dev_err(chip->card->dev,
                        "invalid format_val, rate=%d, ch=%d, format=%d\n",