[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20171214093244.udrjwgfvpxpc3jq7@localhost.localdomain>
Date: Thu, 14 Dec 2017 09:32:44 +0000
From: Charles Keepax <ckeepax@...nsource.cirrus.com>
To: Steven Eckhoff <steven.eckhoff.opensource@...il.com>
CC: Mark Brown <broonie@...nel.org>, <linux-kernel@...r.kernel.org>,
<alsa-devel@...a-project.org>, Takashi Iwai <tiwai@...e.com>,
Liam Girdwood <lgirdwood@...il.com>
Subject: Re: [alsa-devel] [PATCH v5] ASoC: TSCS42xx: Add support for Tempo
Semiconductor's TSCS42xx audio CODEC
On Tue, Dec 12, 2017 at 03:31:16PM -0600, Steven Eckhoff wrote:
> On Tue, Dec 12, 2017 at 04:32:54PM +0000, Mark Brown wrote:
> > On Mon, Dec 11, 2017 at 01:54:25PM -0600, Steven Eckhoff wrote:
> > > +static int tscs42xx_probe(struct snd_soc_codec *codec)
> > > +{
> > > + int i;
> > > + int ret;
> > > +
> > > + for (i = 0; i < ARRAY_SIZE(r_inits); ++i) {
> > > + ret = snd_soc_write(codec, r_inits[i].reg, r_inits[i].def);
> > > + if (ret < 0) {
> > > + dev_err(codec->dev,
> > > + "Failed to write codec defaults (%d)\n", ret);
> > > + return ret;
> > > + }
> > > + }
> >
> > I'd expect the driver to just reset the CODEC (it appears to have that
> > feature) and the regmap.
> >
> These init values were meant to be driver defaults that differed from
> the device defaults. In hindsight this was a bad idea. I am removing
> them in the next revision and will have the machine driver setup the
> codec appropriately.
>
Not sure what you mean here but setting up CODEC registers
directly from the machine driver is probably not ideal. You
should probably be looking into regmap_register_patch this lets
you apply a bunch of register settings to the chip every time you
do a regmap_cache_sync. This is useful for situations like the
chip has terrible register defaults you want to correct.
Thanks,
Charles
Powered by blists - more mailing lists