From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751639AbcFJAiR (ORCPT ); Thu, 9 Jun 2016 20:38:17 -0400 Received: from mezzanine.sirena.org.uk ([106.187.55.193]:54654 "EHLO mezzanine.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750751AbcFJAiP (ORCPT ); Thu, 9 Jun 2016 20:38:15 -0400 Date: Fri, 10 Jun 2016 01:37:55 +0100 From: Mark Brown To: Maxime Ripard Cc: Rob Herring , Chen-Yu Tsai , Liam Girdwood , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Andrea Venturi , Code Kipper , gianfranco@moddevices.com Message-ID: <20160610003755.GC7510@sirena.org.uk> References: <20160601175430.11625-1-maxime.ripard@free-electrons.com> <20160601175430.11625-3-maxime.ripard@free-electrons.com> <20160602102651.GF2282@sirena.org.uk> <20160609210515.GI5242@lukather> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="8V5qWCo32XWuTbWR" Content-Disposition: inline In-Reply-To: <20160609210515.GI5242@lukather> X-Cookie: We've upped our standards, so up yours! User-Agent: Mutt/1.6.0 (2016-04-01) X-SA-Exim-Connect-IP: 2a01:348:6:8808:fab::3 X-SA-Exim-Mail-From: broonie@sirena.org.uk Subject: Re: [PATCH 2/4] ASoC: sunxi: Add Allwinner A10 Digital Audio 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 --8V5qWCo32XWuTbWR Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Jun 09, 2016 at 11:05:15PM +0200, Maxime Ripard wrote: > On Thu, Jun 02, 2016 at 11:26:51AM +0100, Mark Brown wrote: > > > +static int sun4i_i2s_params_to_sr(struct snd_pcm_hw_params *params) > > > +{ > > > + switch (params_width(params)) { > > > + case 16: > > > + return 0; > > > + } > > > + > > > + return -EINVAL; > > > +} > > The switch statement here and in the _wss() function look weird because > > they don't have default cases. Since there's only one user of both > > functions it seems better to have the switch statements inline anyway. > I don't know, maybe it's just me, but I really find it cleaner that > way, and the compiler will probably inline it anyway. If you insist, > I'll change it though. Yes, it's really not helping here. > > > + for (i = 0; sun4i_i2s_mclk_div[i].div; i++) { > > > + const struct sun4i_i2s_clk_div *mdiv = sun4i_i2s_mclk_div + i; > > Why not just write these as normal array lookups? > By normal, you mean using ARRAY_SIZE()? array[index]. > > > +static int sun4i_i2s_dai_probe(struct snd_soc_dai *dai) > > > +{ > > > + struct sun4i_i2s *i2s = snd_soc_dai_get_drvdata(dai); > > > + /* Enable the whole hardware block */ > > > + regmap_write(i2s->regmap, SUN4I_I2S_CTRL_REG, > > > + SUN4I_I2S_CTRL_GL_EN); > > Runtime PM? It also seems like this is something that ought to be > > covered in the suspend and resume callbacks. > runtime_pm is supported, and uses the regmap cache to keep those > changes. No, my point is that I'd expect to see the block powered off on suspend. --8V5qWCo32XWuTbWR Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJXWgviAAoJECTWi3JdVIfQtswH/jeHY9+bWRXu9FDKJbcVCVtk pgHCTE2f4JoXn7NqFdlihh2Om0rfviwhXymbiYlQ0ql2EoZp+16BqtRFZTSViee+ 2A7x72JLr/SNVy2XVUElzYHmsfRyu0EemCpEE7aPSFj9JphbOZpTT1IqJH2pfzaA 04SUAoO+F/sQryZRI796GEHDk+qLPWWkXL596lRX2kXbV64M2WKGIbyMiRVbnjzv ZV9wpnARMOMe/+1brKvPregMx7tvOr0OIWnEpu/m2c0qiEhYcPr7sRpZA9gnpd/L NNROg8T+dEh24+t/g8V2Pg5fyWI3mHvgipdiOn7N7AQCs0/hIhLDj6LrL2YMdr0= =kmoV -----END PGP SIGNATURE----- --8V5qWCo32XWuTbWR--