From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966569AbcHEJFQ (ORCPT ); Fri, 5 Aug 2016 05:05:16 -0400 Received: from ns.pmeerw.net ([84.19.176.92]:50882 "EHLO pmeerw.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759493AbcHEJFM (ORCPT ); Fri, 5 Aug 2016 05:05:12 -0400 Date: Fri, 5 Aug 2016 11:04:51 +0200 (CEST) From: Peter Meerwald-Stadler To: Adam Thomson cc: Mark Brown , Liam Girdwood , Jaroslav Kysela , Takashi Iwai , alsa-devel@alsa-project.org, Support Opensource , linux-kernel@vger.kernel.org, c.huber@bct-electronic.com Subject: Re: [alsa-devel] [PATCH 4/4] ASoC: da7213: Improve 32KHz mode PLL locking In-Reply-To: <497bb3724104ba16dc3588287f6071f0b7cce09e.1470318378.git.Adam.Thomson.Opensource@diasemi.com> Message-ID: References: <497bb3724104ba16dc3588287f6071f0b7cce09e.1470318378.git.Adam.Thomson.Opensource@diasemi.com> User-Agent: Alpine 2.02 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > To aid PLL in locking on to a 32KHz MCLK, some register mods > are made during PLL configuration, and when enabling the DAI, > to achieve the full range of sample rates. thanks for the patch series; we are about to test... some comments below > Signed-off-by: Adam Thomson > --- > sound/soc/codecs/da7213.c | 25 ++++++++++++++++++++++++- > 1 file changed, 24 insertions(+), 1 deletion(-) > > diff --git a/sound/soc/codecs/da7213.c b/sound/soc/codecs/da7213.c > index 79b8324..095fe40 100644 > --- a/sound/soc/codecs/da7213.c > +++ b/sound/soc/codecs/da7213.c > @@ -750,11 +750,18 @@ static int da7213_dai_event(struct snd_soc_dapm_widget *w, > snd_soc_update_bits(codec, DA7213_PC_COUNT, > DA7213_PC_FREERUN_MASK, 0); > > - /* Slave mode, if SRM not enabled no need for status checks */ > + /* If SRM not enabled then nothing more to do */ > pll_ctrl = snd_soc_read(codec, DA7213_PLL_CTRL); > if (!(pll_ctrl & DA7213_PLL_SRM_EN)) > return 0; > > + /* Assist 32KHz mode PLL lock */ > + if (pll_ctrl & DA7213_PLL_32K_MODE) { these registers cannot not found in the datasheet; maybe add descriptive #defines in da7213.h > + snd_soc_write(codec, 0xF0, 0x8B); > + snd_soc_write(codec, 0xF2, 0x03); > + snd_soc_write(codec, 0xF0, 0x00); > + } > + > /* Check SRM has locked */ > do { > pll_status = snd_soc_read(codec, DA7213_PLL_STATUS); > @@ -771,6 +778,14 @@ static int da7213_dai_event(struct snd_soc_dapm_widget *w, > > return 0; > case SND_SOC_DAPM_POST_PMD: > + /* Revert 32KHz PLL lock udpates if applied previously */ > + pll_ctrl = snd_soc_read(codec, DA7213_PLL_CTRL); > + if (pll_ctrl & DA7213_PLL_32K_MODE) { > + snd_soc_write(codec, 0xF0, 0x8B); > + snd_soc_write(codec, 0xF2, 0x01); > + snd_soc_write(codec, 0xF0, 0x00); > + } > + > /* PC free-running */ > snd_soc_update_bits(codec, DA7213_PC_COUNT, > DA7213_PC_FREERUN_MASK, > @@ -1428,6 +1443,14 @@ static int da7213_set_dai_pll(struct snd_soc_dai *codec_dai, int pll_id, > DA7213_PLL_INDIV_MASK | DA7213_PLL_MODE_MASK, > pll_ctrl); > > + /* Assist 32KHz mode PLL lock */ > + if (source == DA7213_SYSCLK_PLL_32KHZ) { > + snd_soc_write(codec, 0xF0, 0x8B); > + snd_soc_write(codec, 0xF1, 0x03); > + snd_soc_write(codec, 0xF1, 0x01); > + snd_soc_write(codec, 0xF0, 0x00); > + } > + > return 0; > } -- Peter Meerwald-Stadler +43-664-2444418 (mobile)