[alsa-devel] [query] codec suspend not called when bias level is SND_SOC_BIAS_ON

Shiraz Hashim shiraz.hashim at st.com
Wed Dec 5 08:08:56 CET 2012


Hi Mark,

I was going through the suspend procedure for soc-core and I could see
that codec suspend is called only when its bias level is SND_SOC_BIAS_OFF.


     if (!codec->suspended && codec->driver->suspend) {
             switch (codec->dapm.bias_level) {
             case SND_SOC_BIAS_STANDBY:
                     /*
                      * If the CODEC is capable of idle
                      * bias off then being in STANDBY
                      * means it's doing something,
                      * otherwise fall through.
                      */
                     if (codec->dapm.idle_bias_off) {
                             dev_dbg(codec->dev,
                                     "idle_bias_off CODEC on over suspend\n");
                             break;
                     }
             case SND_SOC_BIAS_OFF:
                     codec->driver->suspend(codec);
                     codec->suspended = 1;
                     codec->cache_sync = 1;
                     break;
             default:
                     dev_dbg(codec->dev, "CODEC is on over suspend\n");
                     break;
             }
     }

My question is, during on-going audio play when system is put into
suspend, codec->driver->suspend would not be called as its bias level
is still SND_SOC_BIAS_ON, thus not giving a chance to codec to save
its state.

Is my understanding correct ? How to deal with this ?

--
regards
Shiraz


More information about the Alsa-devel mailing list