All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 00/10] ASoC: tlv320aic32x4: Rework Clock Setting
@ 2019-03-22  0:58 Annaliese McDermond
  2019-03-22  0:58 ` [PATCH v4 01/10] ASoC: tlv320aic32x4: Model PLL in CCF Annaliese McDermond
                   ` (9 more replies)
  0 siblings, 10 replies; 14+ messages in thread
From: Annaliese McDermond @ 2019-03-22  0:58 UTC (permalink / raw)
  To: broonie, alsa-devel; +Cc: team, Annaliese McDermond

The current tlv320aic32x4 code sets the various clock parameters by
looking in a static table in the kernel.  This works well enough,
but it has a few disadvantages.

1)  If the master clock doesn't match one of the precalculated values
    the driver cannot work.  This could be because the designer
    decided to use a different crystal, or because the clock comes
    from a PLL that can't quite achieve the proper frequency
    exactly.

2)  The driver only supports certain pre-calculated sample rates.
    The actual hardware can support many more.  These changes
    enable those rates.  Additionally, certain sample rates at
    certain clock rates were previously unavailable as
    combinations.

This patch dynamically calculates the various PLL and divider
values to find something that works.

Additionally, to enable much of this, the clock tree is
modeled as a part of the Common Clock Framework.  This allows
for easier debugigng as you can use the standard tools such as
/sys/kernel/debug/clk/clk_summary.  It also simplifies enabling
the entirety of the clock tree needed, and makes sure unused
clocks become disabled.

These patches have been tested and are working on a Raspberry Pi
with the simplecard driver.

Changes in v2:
 - Update 0002 patch to change Kconfig to add dependency on CCF
 - Update 0002 patch to correct the SPDX identifier
 - Update 0002 patch to use EXPORT_SYMBOL_GPL() instead of
   EXPORT_SYMBOL()
 - Update patches 0002, 0004 and 0005 to use prepare/unprepare
   instead of enable/disable since the i2c operations are not
   atomic
 - Update 0004 patch to fix indentation in commit message
 - Drop patch 0009 because it is a duplicate of the already
   committed patch in 667e9334
 - Update 0019 patch to keep aic32x4_set_dai_sysclk but to have
   it use clk_set_rate to set the master clock rate

Changes in v3:
 - Rebase on current for-next
 - Move "Properly Set Processing Blocks" to the start of the
   patches so that it can potentially be applied as a bug
   fix

Changes in v4:
 - Rabase on current for-next
 - Regenerate patches to get them to apply correctly.
   Verified with git-am on for-next and they appear
   to work here.

Annaliese McDermond (10):
  ASoC: tlv320aic32x4: Model PLL in CCF
  ASoC: tlv320aic32x4: Model CODEC_CLKIN in CCF
  ASoC: tlv320aic32x4: Model DAC/ADC dividers in CCF
  ASoC: tlv320aic32x4: Model BDIV divider in CCF
  ASoC: tlv320aic32x4: Control clock gating with CCF
  ASoC: tlv320aic32x4: Move aosr and dosr setting to separate functions
  ASoC: tlv320aic32x4: Dynamically Determine Clocking
  ASoC: tlv320aic32x4: Restructure set_dai_sysclk
  ASoC: tlv320aic32x4: Remove mclk references
  ASoC: tlv320aic32x4: Allow 192000 Sample Rate

 sound/soc/codecs/Kconfig             |   1 +
 sound/soc/codecs/Makefile            |   2 +-
 sound/soc/codecs/tlv320aic32x4-clk.c | 483 +++++++++++++++++++++++++++
 sound/soc/codecs/tlv320aic32x4.c     | 427 +++++++++++------------
 sound/soc/codecs/tlv320aic32x4.h     |  11 +
 5 files changed, 692 insertions(+), 232 deletions(-)
 create mode 100644 sound/soc/codecs/tlv320aic32x4-clk.c

-- 
2.19.1

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

end of thread, other threads:[~2019-03-25 16:11 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-22  0:58 [PATCH v4 00/10] ASoC: tlv320aic32x4: Rework Clock Setting Annaliese McDermond
2019-03-22  0:58 ` [PATCH v4 01/10] ASoC: tlv320aic32x4: Model PLL in CCF Annaliese McDermond
2019-03-25 16:11   ` Applied "ASoC: tlv320aic32x4: Model PLL in CCF" to the asoc tree Mark Brown
2019-03-22  0:58 ` [PATCH v4 02/10] ASoC: tlv320aic32x4: Model CODEC_CLKIN in CCF Annaliese McDermond
2019-03-22  0:58 ` [PATCH v4 03/10] ASoC: tlv320aic32x4: Model DAC/ADC dividers " Annaliese McDermond
2019-03-25 16:11   ` Applied "ASoC: tlv320aic32x4: Model DAC/ADC dividers in CCF" to the asoc tree Mark Brown
2019-03-22  0:58 ` [PATCH v4 04/10] ASoC: tlv320aic32x4: Model BDIV divider in CCF Annaliese McDermond
2019-03-22  0:58 ` [PATCH v4 05/10] ASoC: tlv320aic32x4: Control clock gating with CCF Annaliese McDermond
2019-03-22  0:58 ` [PATCH v4 06/10] ASoC: tlv320aic32x4: Move aosr and dosr setting to separate functions Annaliese McDermond
2019-03-22  0:58 ` [PATCH v4 07/10] ASoC: tlv320aic32x4: Dynamically Determine Clocking Annaliese McDermond
2019-03-25 16:11   ` Applied "ASoC: tlv320aic32x4: Dynamically Determine Clocking" to the asoc tree Mark Brown
2019-03-22  0:58 ` [PATCH v4 08/10] ASoC: tlv320aic32x4: Restructure set_dai_sysclk Annaliese McDermond
2019-03-22  0:58 ` [PATCH v4 09/10] ASoC: tlv320aic32x4: Remove mclk references Annaliese McDermond
2019-03-22  0:58 ` [PATCH v4 10/10] ASoC: tlv320aic32x4: Allow 192000 Sample Rate Annaliese McDermond

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.