[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160610003755.GC7510@sirena.org.uk>
Date: Fri, 10 Jun 2016 01:37:55 +0100
From: Mark Brown <broonie@...nel.org>
To: Maxime Ripard <maxime.ripard@...e-electrons.com>
Cc: Rob Herring <robh+dt@...nel.org>, Chen-Yu Tsai <wens@...e.org>,
Liam Girdwood <lgirdwood@...il.com>,
devicetree@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
alsa-devel@...a-project.org, linux-kernel@...r.kernel.org,
Andrea Venturi <ennesimamail.av@...il.com>,
Code Kipper <codekipper@...il.com>, gianfranco@...devices.com
Subject: Re: [PATCH 2/4] ASoC: sunxi: Add Allwinner A10 Digital Audio driver
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.
Download attachment "signature.asc" of type "application/pgp-signature" (474 bytes)
Powered by blists - more mailing lists