Commit cbc4ebb3 authored by Cezary Rojewski's avatar Cezary Rojewski Committed by Takashi Iwai
Browse files

ASoC: codecs: hdac_hdmi: 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.

Acked-by: default avatarMark Brown <broonie@kernel.org>
Signed-off-by: default avatarCezary Rojewski <cezary.rojewski@intel.com>
Acked-by: default avatarJaroslav Kysela <perex@perex.cz>
Link: https://lore.kernel.org/r/20231117120610.1755254-11-cezary.rojewski@intel.com


Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 0bb0af12
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -468,13 +468,14 @@ static int hdac_hdmi_set_hw_params(struct snd_pcm_substream *substream,
	struct hdac_hdmi_priv *hdmi = snd_soc_dai_get_drvdata(dai);
	struct hdac_hdmi_dai_port_map *dai_map;
	struct hdac_hdmi_pcm *pcm;
	unsigned int bits;
	int format;

	dai_map = &hdmi->dai_map[dai->id];

	format = snd_hdac_calc_stream_format(params_rate(hparams),
			params_channels(hparams), params_format(hparams),
			dai->driver->playback.sig_bits, 0);
	bits = snd_hdac_stream_format_bits(params_format(hparams), SNDRV_PCM_SUBFORMAT_STD,
					   dai->driver->playback.sig_bits);
	format = snd_hdac_stream_format(params_channels(hparams), bits, params_rate(hparams));

	pcm = hdac_hdmi_get_pcm_from_cvt(hdmi, dai_map->cvt);
	if (!pcm)