]> git.baikalelectronics.ru Git - kernel.git/commit
ASoC: tlv320aic32x4: Dynamically Determine Clocking
authorAnnaliese McDermond <nh6z@nh6z.net>
Fri, 22 Mar 2019 00:58:51 +0000 (17:58 -0700)
committerMark Brown <broonie@kernel.org>
Mon, 25 Mar 2019 15:54:42 +0000 (15:54 +0000)
commite94555635d8fa0f5b4937a89dc207fc3fa16c1b7
treebe7582124228f44f48d77314846af74ebc5d3988
parent78c53f45f33188b94b8a81d2a8d330027bffcde7
ASoC: tlv320aic32x4: Dynamically Determine Clocking

The existing code uses a static lookup table to determine the
settings of the various clock devices on board the chip.  This is
limiting in a couple of ways.  First, this doesn't allow for any
master clock rates other than the three that have been
precalculated.  Additionally, new sample rates are difficult to
add to the table.  Witness that the chip is capable of 192000 Hz
sampling, but it is not provided by this driver.  Last, if the
driver is clocked by something that isn't a crystal, the
upstream clock may not be able to achieve exactly the rate
requested in the driver.  This will mean that clocking will be
slightly off for the sampling clock or that it won't work at all.

This patch determines the settings for all of the clocks at
runtime considering the real conditions of the clocks in the
system.  The rules for the clocks are in TI's SLAA557 application
guide on pages 37, 51 and 77.

Signed-off-by: Annaliese McDermond <nh6z@nh6z.net>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/tlv320aic32x4.c
sound/soc/codecs/tlv320aic32x4.h