diff options
author | Cezary Rojewski <cezary.rojewski@intel.com> | 2023-11-17 13:06:02 +0100 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2023-11-27 17:28:11 +0100 |
commit | d5c00ab2f508176e8d8bd976d8b2207c5f0a932b (patch) | |
tree | 854180ab9b0a9fd073b13d5b5d49ab51e67a9710 /sound/soc/codecs/hda-dai.c | |
parent | 0d41f0c07f19de7fb5790cbe462dddb68af60fa8 (diff) |
ASoC: codecs: hda: Switch to new stream-format interface
To provide option for selecting different bit-per-sample than just the
maximum one, use the new format calculation mechanism.
While at it, complete PCM stream initialization with subformat options.
Acked-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Acked-by: Jaroslav Kysela <perex@perex.cz>
Link: https://lore.kernel.org/r/20231117120610.1755254-9-cezary.rojewski@intel.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/soc/codecs/hda-dai.c')
-rw-r--r-- | sound/soc/codecs/hda-dai.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sound/soc/codecs/hda-dai.c b/sound/soc/codecs/hda-dai.c index 5371ff086261..7bd7ddcd810f 100644 --- a/sound/soc/codecs/hda-dai.c +++ b/sound/soc/codecs/hda-dai.c @@ -76,13 +76,16 @@ static int hda_codec_dai_prepare(struct snd_pcm_substream *substream, struct snd struct hdac_stream *stream; struct hda_codec *codec; unsigned int format; + unsigned int bits; int ret; codec = dev_to_hda_codec(dai->dev); stream = substream->runtime->private_data; stream_info = snd_soc_dai_get_dma_data(dai, substream); - format = snd_hdac_calc_stream_format(runtime->rate, runtime->channels, runtime->format, - runtime->sample_bits, 0); + + bits = snd_hdac_stream_format_bits(runtime->format, runtime->subformat, + stream_info->maxbps); + format = snd_hdac_stream_format(runtime->channels, bits, runtime->rate); ret = snd_hda_codec_prepare(codec, stream_info, stream->stream_tag, format, substream); if (ret < 0) { |