Re: [PATCH 1/2] ASoC: Add support for Conexant CX2072X CODEC

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 02 May 2019 09:04:06 +0200,
Takashi Iwai wrote:
> 
> > > +int snd_soc_cx2072x_get_jack_state(struct snd_soc_component *codec)
> > > +{
> > > +	struct cx2072x_priv *cx2072x = snd_soc_component_get_drvdata(codec);
> > > +	unsigned int jack;
> > > +	unsigned int type = 0;
> > > +	int state = 0;
> > > +	bool need_cache_bypass =
> > > +		snd_soc_component_get_bias_level(codec) == SND_SOC_BIAS_OFF;
> > > +
> > > +	if (need_cache_bypass)
> > > +		regcache_cache_only(cx2072x->regmap, false);
> > 
> > This looks funky and racy - what's going on here?  If the register map
> > is live and usable why is it in cache only mode?
> 
> Not to read the register while the chip is turned off, I suppose.

Actually other way round: the codec driver tries to avoid the whole
register access while the chip is in BIAS_OFF state.  OTOH, the jack
state check is still required even in that state, so it flips the
cache-only flag temporarily at reading the jack detect bit.

I guess we may remove the cache-only behavior, although this is a
nice-to-have thing.


Takashi
_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel



[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Pulse Audio]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux