[Sound-open-firmware] Design decisions for PM flow

Pierre-Louis Bossart pierre-louis.bossart at linux.intel.com
Mon Dec 14 23:05:14 CET 2020


> On the IMX, I'd think that if you dont perform any actions during
> system suspend (because the device was runtime suspended), you shouldnt
> perform any actions during system resume either. IIRC, you can indicate
> you want to skip system suspend/resume if the device is runtime
> suspended by returning 1 during prepare(). Maybe something to try for
> IMX platforms?

the best way to do it is to follow the sequences in pm_runtime.rst (see 
example in drivers/soundwire/intel.c)

system_suspend(dev)

{

     if (pm_runtime_suspended(dev)) {

         /* nothing to do */

         return 0;

     }

}


system_resume(dev)

{

     if (pm_runtime_suspended(dev)) {

         /* follow required sequence from runtime_pm.rst */
         pm_runtime_disable(dev);
         pm_runtime_set_active(dev);
         pm_runtime_mark_last_busy(dev);
         pm_runtime_enable(dev);

       }

     /* normal resume */

}



More information about the Sound-open-firmware mailing list