All of lore.kernel.org
 help / color / mirror / Atom feed
* power management in ALSA
@ 2005-12-13 23:50 Tehn Yit Chin
  2005-12-14 11:25 ` Takashi Iwai
  0 siblings, 1 reply; 4+ messages in thread
From: Tehn Yit Chin @ 2005-12-13 23:50 UTC (permalink / raw)
  To: alsa-devel

[-- Attachment #1: Type: text/plain, Size: 898 bytes --]

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

[-- Attachment #2: Type: text/html, Size: 1167 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: power management in ALSA
  2005-12-13 23:50 power management in ALSA Tehn Yit Chin
@ 2005-12-14 11:25 ` Takashi Iwai
  0 siblings, 0 replies; 4+ messages in thread
From: Takashi Iwai @ 2005-12-14 11:25 UTC (permalink / raw)
  To: Tehn Yit Chin; +Cc: alsa-devel

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: power management in alsa
  2007-07-25 12:36 power management in alsa Andi Kleen
@ 2007-07-25 12:58 ` Takashi Iwai
  0 siblings, 0 replies; 4+ messages in thread
From: Takashi Iwai @ 2007-07-25 12:58 UTC (permalink / raw)
  To: Andi Kleen; +Cc: linux-pm, perex

At Wed, 25 Jul 2007 14:36:58 +0200,
Andi Kleen wrote:
> 
> 
> Hallo,
> 
> I noticed ALSA hda seems to only change PCI power management states
> of the sound devices on suspend/resume. Is there a reason the device
> cannot be automatically suspended when nobody has sound opened? 

I made once the automatic power-control patch for hd-audio, but it was
possibly racy and a bit messy implementation, so I abandoned it.
Since then, no one has worked on this issue.


Takashi

^ permalink raw reply	[flat|nested] 4+ messages in thread

* power management in alsa
@ 2007-07-25 12:36 Andi Kleen
  2007-07-25 12:58 ` Takashi Iwai
  0 siblings, 1 reply; 4+ messages in thread
From: Andi Kleen @ 2007-07-25 12:36 UTC (permalink / raw)
  To: tiwai, perex, linux-pm


Hallo,

I noticed ALSA hda seems to only change PCI power management states
of the sound devices on suspend/resume. Is there a reason the device
cannot be automatically suspended when nobody has sound opened? 

-Andi

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-07-25 12:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-12-13 23:50 power management in ALSA Tehn Yit Chin
2005-12-14 11:25 ` Takashi Iwai
2007-07-25 12:36 power management in alsa Andi Kleen
2007-07-25 12:58 ` Takashi Iwai

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.