Skip to contentSkip to conversation

power management in ALSA

DISCUSSION Tehn Yit Chin 2 participants 2 messages Dec 13, 2005 – Dec 14, 2005

lore
Share & tools
lore
#0 lore raw

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

#1 lore raw

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 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
};

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