[alsa-devel] [PATCH] ASoC: da732x: Mark DC offset control registers volatile

Opensource [Adam Thomson] Adam.Thomson.Opensource at diasemi.com
Mon Feb 24 14:57:53 CET 2014

On Mon, 24 Feb 2014 12:43:51 +0000, Mark Brown wrote:

> > Having looked over the driver again, can you include the following
> > registers as well:
> > DA732X_REG_HPL
> > DA732X_REG_HPR
> I did notice those.  However they are a bit more fun since they have
> some non-volatile fields in them which are also used for control.  I
> *suspect* that a lot of the time it'll be possible to get away with just
> caching the first read but it needs further study - often with these
> things the basic offset is constant in a given system so the sign may
> well be right all the time.  That's just a guess, though, and may not
> actually hold at which point a bit more attention might be needed.

The field DA732X_HP_OUT_COMPO is the only volatile field for those two
registers. Having looked at this some more, I believe the offset_cancellation
need only be done at Codec initialisation, and doesn't need to be done every time
the system resumes. Moving to a one time run may make dealing with this easier,
if we're to do something clever. However, In terms of control, really only the
MUTE, OUT_EN and OUT_HIZ_EN fields will be used with some frequency, in these
registers, and generally they will be writes which will likely cause I2C traffic
anyway. I'd be tempted to keep it simple and just make those registers volatile,
then you know it will work as expected, at least for the time being until a
better solution presents itself.

More information about the Alsa-devel mailing list