alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [alsa-devel] [RFC PATCH 1/3] ALSA:hda: Simplify and clear calculating SDxFMT
@ 2019-09-05  5:32 Pawel Harlozinski
  2019-09-05  5:33 ` [alsa-devel] [RFC PATCH 2/3] ALSA:core: Add rate 24kHz Pawel Harlozinski
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Pawel Harlozinski @ 2019-09-05  5:32 UTC (permalink / raw)
  To: alsa-devel
  Cc: cezary.rojewski, patch, tiwai, lgirdwood, pierre-louis.bossart,
	broonie, Pawel Harlozinski

Set SDxFMT based only on given format, due to maxbps not always being set.
Split cases for formats 20,24,32 bits.
For format SNDRV_PCM_FORMAT_FLOAT_LE width is equal 32 so it will end up
with same mask.

Signed-off-by: Pawel Harlozinski <pawel.harlozinski@linux.intel.com>
---
 sound/hda/hdac_device.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/sound/hda/hdac_device.c b/sound/hda/hdac_device.c
index b26cc93e7e10..add758e11b85 100644
--- a/sound/hda/hdac_device.c
+++ b/sound/hda/hdac_device.c
@@ -759,14 +759,13 @@ unsigned int snd_hdac_calc_stream_format(unsigned int rate,
 		val |= AC_FMT_BITS_16;
 		break;
 	case 20:
+		val |= AC_FMT_BITS_20;
+		break;
 	case 24:
+		val |= AC_FMT_BITS_24;
+		break;
 	case 32:
-		if (maxbps >= 32 || format == SNDRV_PCM_FORMAT_FLOAT_LE)
-			val |= AC_FMT_BITS_32;
-		else if (maxbps >= 24)
-			val |= AC_FMT_BITS_24;
-		else
-			val |= AC_FMT_BITS_20;
+		val |= AC_FMT_BITS_32;
 		break;
 	default:
 		return 0;
-- 
2.17.1

_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel

^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2019-09-06 14:17 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-05  5:32 [alsa-devel] [RFC PATCH 1/3] ALSA:hda: Simplify and clear calculating SDxFMT Pawel Harlozinski
2019-09-05  5:33 ` [alsa-devel] [RFC PATCH 2/3] ALSA:core: Add rate 24kHz Pawel Harlozinski
2019-09-05  5:48   ` Takashi Iwai
2019-09-05 13:11     ` Pierre-Louis Bossart
2019-09-05 13:16       ` Takashi Iwai
2019-09-05 14:00         ` Pierre-Louis Bossart
2019-09-05 14:09           ` Takashi Iwai
2019-09-05  5:33 ` [alsa-devel] [RFC PATCH 3/3] ALSA:hda: Add rates 24kHz, 64kHz Pawel Harlozinski
2019-09-05  5:33 ` Pawel Harlozinski
2019-09-05  5:47 ` [alsa-devel] [RFC PATCH 1/3] ALSA:hda: Simplify and clear calculating SDxFMT Takashi Iwai
2019-09-06 13:41   ` Harlozinski, Pawel
2019-09-06 14:16     ` Takashi Iwai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).