]> git.baikalelectronics.ru Git - kernel.git/commit
ASoC: nau8824: Implement hw constraint for rates
authorTakashi Iwai <tiwai@suse.de>
Tue, 23 Aug 2022 08:09:58 +0000 (10:09 +0200)
committerMark Brown <broonie@kernel.org>
Tue, 23 Aug 2022 12:04:44 +0000 (13:04 +0100)
commit9449147a4d1a7a692cf73dbb3c0f609a0da77ff1
tree0dfb13ef2ff3130d36c79605791c1faada11d5c9
parentce44fbdd1abcd840d95841ba054d9288854b97d0
ASoC: nau8824: Implement hw constraint for rates

nau8824 driver restricts the sample rate with over sampling rate, but
currently it barely bails out at hw_params with -EINVAL error (with a
kernel message); this doesn't help for user-space to recognize which
rate can be actually used.

This patch introduces the proper hw constraint for adjusting the
available range of the sample rate depending on the OSR setup, as well
as some code cleanup, for improving the communication with
user-space.  Now applications can know the valid rate beforehand and
reduces the rate appropriately without errors.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20220823081000.2965-4-tiwai@suse.de
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/nau8824.c