[alsa-devel] [PATCH] ASoC: cs4270: fix dynamic initialization of register cache

Mark Brown broonie at opensource.wolfsonmicro.com
Thu Jan 6 22:41:04 CET 2011

On Thu, Jan 06, 2011 at 02:24:11PM -0600, Timur Tabi wrote:

> What do I do if there are two CS4270s in a system, and they each have different
> power-on default values for the registers?  Granted, it's a contrived example,
> but this could happen if the first CS4270 is a rev1 chip, and the second is a
> rev2 chip.

So the driver should cope with this, for example by updating the rev1
configuration to match rev2 at probe time (presumably if the change in
rev2 was important enough to introduce the change for then rev1 needs
the change anyway).

> And even if this example is contrived, it's conceivable that there can be codecs
> where the power-on defaults are set by pin configuration.  Perhaps codec #1 is
> muted by default and codec #2 isn't.

Again, do something that seems tasteful.  For example, mark the relevant
register volatile as it might get varied randomly at runtime anyway (I'm
not sure how the mute pin plays with the register value?).  Or write out
a particular value at startup.

If there really are insurmountable obstacles (I don't beleive there are)
or you're really dead set on it then teach the core about having to read
back the state from the device.

More information about the Alsa-devel mailing list