[alsa-devel] [PATCH 01/19] ASoC: upd9976: Add Renesas uPD9976 codec driver

Mark Brown broonie at opensource.wolfsonmicro.com
Wed May 4 18:11:21 CEST 2011


On Wed, May 04, 2011 at 11:12:50PM +0800, Lu Guanqun wrote:
> On Wed, May 04, 2011 at 10:46:00PM +0800, Dimitris Papastamos wrote:
> > On Wed, May 04, 2011 at 09:44:58PM +0800, Lu Guanqun wrote:

> > > +	case SND_SOC_BIAS_OFF:
> > > +		snd_soc_write(codec, UPD9976_VREFPLL, 0);
> > > +		snd_soc_write(codec, UPD9976_VAUDIOCNT, 0x24);
> > > +		break;
> > > +	}

> > Why not snd_soc_update_bits()?  These should normally be DAPM widgets.

> There's no DAPM widgets bound to these two registers. So I'm afraid it's
> OK to use snd_soc_write when it's been powered off totally.

That's an orthogonal thing, the usual reason for pushing back on this
stuff is that people have open coded a read/modify/write cycle which
only updates a subset of bits.  In this case I think the writes are fine
as you're setting the full register to a specific value.

> > > +static int upd9976_codec_probe(struct snd_soc_codec *codec)
> > > +{
> > > +	upd9976_set_bias_level(codec, SND_SOC_BIAS_OFF);
> > > +
> > > +	return 0;
> > > +}

> > Why SND_SOC_BIAS_OFF and not SND_SOC_BIAS_STANDBY?

> Try to use as little power as possible.

You should set idle_bias_off in the CODEC driver if you're doing this
otherwise DAPM will just bring the CODEC up to _STANDBY at runtime.


More information about the Alsa-devel mailing list