power management in ALSA
Hi all,
I am trying to put power management awareness into a driver that I wrote, but I am having a little trouble understanding which model to use.
Looking at the other drivers, I noticed that the suspend/resume callbacks can be registered via snd_card_set_pm_callback(). The power management is then handled via pm.c and friends.
The other way is to initialise the suspend/resume callbacks via the linux device driver model like the following, and then registered via driver_register(). I think that the power management is then handled by sysfs.
static struct device_driver codec_driver = {
.name = "codec",
.bus = &platform_bus_type,
.probe = codec_probe,
.remove = codec_remove,
.suspend = codec_suspend,
.resume = codec_resume
};
Any suggestions on which is a better/correct method is welcome.
many thanks,
tyc
At Wed, 14 Dec 2005 10:50:05 +1100,
Quoted 23 lines · Tehn Yit Chin
Hi all,
I am trying to put power management awareness into a driver that I wrote, but I am having a little trouble understanding which model to use.
Looking at the other drivers, I noticed that the suspend/resume callbacks can be registered via
snd_card_set_pm_callback(). The power management is then handled viapm.cand friends.The other way is to initialise the suspend/resume callbacks via the linux device driver model like the following, and then registered via
driver_register(). I think that the power management is then handled by sysfs.static struct
device_drivercodec_driver= {
.name = "codec",
.bus =&platform_bus_type,
.probe =codec_probe,
.remove =codec_remove,
.suspend =codec_suspend,
.resume =codec_resume
};
Quoted 1 line
Any suggestions on which is a better/correct method is welcome.
The PM stuff has been completely changed in the recent version. There is no longer the common PM layer in ALSA (except for snd_power_change_state()). Please take a look at ALSA 1.0.11rc1.
BTW, the correct PM implementation is the latter, using suspend/resume callbacks of corresponding driver structs.
Takashi
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click