]> git.baikalelectronics.ru Git - kernel.git/commit
ASoC: cs42l42: Constrain sample rate to prevent illegal SCLK
authorRichard Fitzgerald <rf@opensource.cirrus.com>
Thu, 5 Aug 2021 16:11:06 +0000 (17:11 +0100)
committerMark Brown <broonie@kernel.org>
Thu, 5 Aug 2021 19:17:15 +0000 (20:17 +0100)
commitede7b22c3fc4c4df275d48c9420933b423ac6927
treeb1fd3cb5f243930786bdf2bfb5d67e2b6c5976a1
parente0b5b9458376fec51282482dd276c1c826fb7f4d
ASoC: cs42l42: Constrain sample rate to prevent illegal SCLK

The lowest valid SCLK corresponds to 44.1 kHz at 16-bit. Sample
rates less than this would produce SCLK below the minimum when using
a normal I2S frame. A constraint must be applied to prevent this.

The constraint is not applied if the machine driver sets SCLK, to
allow setups where the host generates additional bits per LRCLK
phase to increase the SCLK frequency. In these cases the machine
driver would always have to inform this driver of the actual SCLK,
and it must select a legal SCLK.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210805161111.10410-3-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/cs42l42.c