OSDN Git Service

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)
commit96c3bb00239de4fb5f4ddca42c1f90d6d9b3c697
treebe7582124228f44f48d77314846af74ebc5d3988
parentfbafbf6517274a797e6e6508c18dd8dba5920c89
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