From: Takashi Iwai Subject: Re: power management in ALSA Date: Wed, 14 Dec 2005 12:25:19 +0100 Message-ID: References: Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Return-path: In-Reply-To: Sender: alsa-devel-admin@lists.sourceforge.net Errors-To: alsa-devel-admin@lists.sourceforge.net List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , List-Archive: To: Tehn Yit Chin Cc: alsa-devel@lists.sourceforge.net List-Id: alsa-devel@alsa-project.org At Wed, 14 Dec 2005 10:50:05 +1100, Tehn Yit Chin wrote: > > 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. 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