From: Tehn Yit Chin Subject: power management in ALSA Date: Wed, 14 Dec 2005 10:50:05 +1100 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_815_32638535.1134517805939" Return-path: 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: alsa-devel@lists.sourceforge.net List-Id: alsa-devel@alsa-project.org ------=_Part_815_32638535.1134517805939 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline 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 =3D { .name =3D "codec", .bus =3D &platform_bus_type, .probe =3D codec_probe, .remove =3D codec_remove, .suspend =3D codec_suspend, .resume =3D codec_resume }; Any suggestions on which is a better/correct method is welcome. many thanks, tyc ------=_Part_815_32638535.1134517805939 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline 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/resu= me callbacks can be registered via snd_card_set_pm_callback(). The power ma= nagement is then handled via=20 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 re= gistered via driver_register(). I think that the power management is then h= andled by sysfs.

static struct device_driver codec_driver =3D {
   = ;     .name =3D "codec",
   = ;     .bus =3D &platform_bus_type,
  &= nbsp;     .probe =3D codec_probe,
   =      .remove =3D codec_remove,
   &nb= sp;    .suspend =3D codec_suspend,
        .resume =3D codec_resume
= };

Any suggestions on which is a better/correct method is welcome.
many thanks,
tyc
------=_Part_815_32638535.1134517805939-- ------------------------------------------------------- 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