[alsa-devel] [PATCH 2/3] ASoC: Add WM8990 driver

Mark Brown broonie at opensource.wolfsonmicro.com
Thu Jun 5 14:15:31 CEST 2008

On Thu, Jun 05, 2008 at 01:08:08PM +0200, Takashi Iwai wrote:

> > +			/* Delay to allow output caps to discharge */
> > +			schedule_timeout_interruptible(msecs_to_jiffies(300));

> Why interruptible?  Maybe msleep() is better for such a purpose?

The general pattern is to use schedule_timeout_interruptible() in these
bias state changes since several of the transitions may be triggered as
part of stream startup and teardown and therefore probably should be
interruptible in case someone has second thoughts about starting a
playback or something.  However, in this driver there aren't any delays
outside of the initial power up and power down sequences so I'll just
change it to use msleep().

> > +	codec->num_dai = 2;
> > +	codec->reg_cache_size = sizeof(wm8990_reg);

> A wrong value assignment in this file, too.  But, ARRAY_SIZE() is also
> wrong since the max reg value is ARRAY_SIZE().  ARRAY_SIZE()+1 is the
> right value, but then it's really unclear what it means...

What's happening is that the code this was taken from has saved a word
of memory by not including the (non-cacheable) reset/id register in the
cache but tripped up a bit doing it.  I don't think the two bytes are
worth the complexity so I'll simplify.

More information about the Alsa-devel mailing list