[alsa-devel] [PATCH 1/2] ASoC: soc-cache: Use reg_def_copy instead of reg_cache_default

Mark Brown broonie at opensource.wolfsonmicro.com
Thu Jan 6 00:29:47 CET 2011

On Wed, Jan 05, 2011 at 05:08:20PM -0600, Timur Tabi wrote:

> My concern is that I think it's unwise to hard-code the default values of the
> registers in the source file.  Who's to say that a newer version of the chip
> won't have different power-on defaults?

In practical terms this is vanishingly unlikely; 

> I do want to support a register cache, but I don't want to hard-code the default
> values into cs4270.c.  Is this supported?

If something you'd like to do doesn't seem to be working or is otherwise
not there and you can see a way to implement it sensibly then the most
obvious thing would seem to be to implement it.

Please remember that this isn't a frozen commercial OS release from a
third party, you can contribute to the core code if you see a need to.
None of this is fixed in stone and a lot of it comes from looking at the
code and taking opportunities to add appropriate abstractions - look at
symmetric_rates, or the creation of soc-cache for example.

> > As you will doubtless have seen when you looked at the code every other
> > reference to reg_cache_default checks to see if it's set before using
> > it.  This does rather suggest that the intention of the code is that it
> > be optional.

> So are you saying that there's a bug in this patch?  Perhaps that code should
> look like this:

Perhaps it should, though my immediate question (without looking at the
existing code again) is why the existing tests are being removed.

More information about the Alsa-devel mailing list