[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:03:39 CET 2011
On Wed, Jan 05, 2011 at 03:04:31PM -0600, Timur Tabi wrote:
> Unlike all the other codec drivers, the CS4270 driver does not
> initialize codec_drv->reg_cache_default, so the pointer is NULL during
> the kmemdup() call.
> What is the criteria for defining reg_cache_default? Many drivers
> don't define it:
In general the expectation is that unless it's got a good reason not to
a well written CODEC driver will use all the standard register cache
infrastructure, including providing a set of defaults. Good reasons for
this include things like not having any registers and indeterminate
default hardware state.
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.
More information about the Alsa-devel
mailing list