From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752463AbcEKUyN (ORCPT ); Wed, 11 May 2016 16:54:13 -0400 Received: from mezzanine.sirena.org.uk ([106.187.55.193]:46458 "EHLO mezzanine.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751782AbcEKUyL (ORCPT ); Wed, 11 May 2016 16:54:11 -0400 Date: Wed, 11 May 2016 21:53:53 +0100 From: Mark Brown To: Peter Rosin Cc: linux-kernel@vger.kernel.org, Rob Herring , Pawel Moll , Mark Rutland , Ian Campbell , Kumar Gala , Liam Girdwood , Jaroslav Kysela , Takashi Iwai , alsa-devel@alsa-project.org, devicetree@vger.kernel.org Message-ID: <20160511205353.GV6261@sirena.org.uk> References: <1462892797-1147-1-git-send-email-peda@axentia.se> <20160511152950.GL6261@sirena.org.uk> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="1AtvaQRkIQxkm1Oe" Content-Disposition: inline In-Reply-To: X-Cookie: When in doubt, follow your heart. User-Agent: Mutt/1.6.0 (2016-04-01) X-SA-Exim-Connect-IP: 94.175.94.161 X-SA-Exim-Mail-From: broonie@sirena.org.uk Subject: Re: [PATCH] ASoC: MAX9860: new driver X-SA-Exim-Version: 4.2.1 (built Mon, 26 Dec 2011 16:24:06 +0000) X-SA-Exim-Scanned: Yes (on mezzanine.sirena.org.uk) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --1AtvaQRkIQxkm1Oe Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Wed, May 11, 2016 at 10:28:12PM +0200, Peter Rosin wrote: > On 2016-05-11 17:29, Mark Brown wrote: > > On Tue, May 10, 2016 at 05:06:37PM +0200, Peter Rosin wrote: > >> + if (master) { > >> + switch (max9860->pclk_rate) { > >> + case 12000000: > >> + sysclk = MAX9860_FREQ_12MHZ; > >> + break; > >> + case 13000000: > >> + sysclk = MAX9860_FREQ_13MHZ; > >> + break; > >> + case 19200000: > >> + sysclk = MAX9860_FREQ_19_2MHZ; > >> + break; > >> + } > > What if we have another PCLK rate? > In that case the sysclk variable will remain cleared (0) and the > code that follows will trigger the PLL section with the N divider > for clock master mode (that mode is always used in clock slave mode). The code needs to make it clear that this is an intentional fallthrough, an explicit default case would help a lot. > > We didn't go into cache only mode on suspend? I'd also expect to see > > the regulators disabled over suspend and some system PM ops. > Ooops, that is a leftover, and I think it can be removed. However, your > comment suggests that I have misunderstood the workings of > SND_SOC_DAPM_REGULATOR_SUPPLY. I thought dapm would take care of the > regulators (and the clocks for SND_SOC_DAPM_CLOCK_SUPPLY) so that > disabling regulators over suspend was handled by the asoc core? It will disable the regulators but that's not going to end well if you're including core supplies required to maintain the register map, it'll disable before runtime suspend and enable after runtime resume. The regulator supply widget is intended for supplies that power particular components on the CODEC. > >> + ret = clk_prepare_enable(mclk); > >> + if (ret) { > >> + dev_err(dev, "Failed to enable MCLK: %d\n", ret); > >> + clk_put(mclk); > >> + return ret; > >> + } > >> + *mclk_rate = clk_get_rate(mclk); > >> + clk_disable_unprepare(mclk); > > This is definitely confused too. Enabling the clock to read the > > programmed frequency is at best odd, and obviously if we do get the rate > > this will ensure that MCLK is disabled which probably isn't ideal. > This is the same situation as for the regulators, I thought dapm > handled it and would prep/enable clocks when they were needed? That still doesn't explain the bouncing on and off here. --1AtvaQRkIQxkm1Oe Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJXM5vhAAoJECTWi3JdVIfQdNgH/1Fqs/C1wA3GFyeGyOlpLXUy DsKNDfpO6t1AgGBbWZT3Yt8H//mdkRMeY7Puu33bJCOX7AOy7ZFdckxj7k1YwcpP RN/RfgMKqS7f5lJyRZGot/16nZmL9a7UaiArBVPOSwkOYNTa4cJj+2COww1EsB7J ipPz1xqJvlN5EhZLDtSM3q/QkL9ml20aOCxg2qgjEkuzTOy0JFB7BY/dkLSfSCKn jheiHednBF/9fcoHfu97WWxMBi3c9FkkcH6yrOcH080KuXlsDmop4TNiFNP7ar7c VnAjeSUSuIPFwPJEZ9StytBoXpTRKlBBz/u9ESCL3v5eIvXeKIWRoJOPXT9gigQ= =s+WP -----END PGP SIGNATURE----- --1AtvaQRkIQxkm1Oe--