summaryrefslogtreecommitdiffstats
path: root/sound/core/control.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2005-11-17 15:55:49 +0100
committerJaroslav Kysela <perex@suse.cz>2006-01-03 12:20:19 +0100
commita381a7a66486f11606eccb8866e29848f995278f (patch)
tree4fcc2f971a1f0d509939181b91096a600454b0d6 /sound/core/control.c
parentfd66e0d0591dd12eb0bea1e9f3aa194bb93cebbd (diff)
downloadop-kernel-dev-a381a7a66486f11606eccb8866e29848f995278f.zip
op-kernel-dev-a381a7a66486f11606eccb8866e29848f995278f.tar.gz
[ALSA] Decentralize PM control
Modules: ALSA Core,Control Midlevel,/oss/Makefile Remove the centralized PM control in the sound core. Each driver is responsible to get callbacks from bus/driver now. SND_GENERIC_DRIVER is removed together with this action. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/core/control.c')
-rw-r--r--sound/core/control.c44
1 files changed, 1 insertions, 43 deletions
diff --git a/sound/core/control.c b/sound/core/control.c
index 1a14338..03ae9bb 100644
--- a/sound/core/control.c
+++ b/sound/core/control.c
@@ -1023,36 +1023,6 @@ static int snd_ctl_subscribe_events(struct snd_ctl_file *file, int __user *ptr)
return 0;
}
-#ifdef CONFIG_PM
-/*
- * change the power state
- */
-static int snd_ctl_set_power_state(struct snd_card *card, unsigned int power_state)
-{
- switch (power_state) {
- case SNDRV_CTL_POWER_D0:
- if (card->power_state != power_state) {
- card->pm_resume(card);
- snd_power_change_state(card, power_state);
- }
- break;
- case SNDRV_CTL_POWER_D3hot:
- if (card->power_state != power_state) {
- card->pm_suspend(card, PMSG_SUSPEND);
- snd_power_change_state(card, power_state);
- }
- break;
- case SNDRV_CTL_POWER_D1:
- case SNDRV_CTL_POWER_D2:
- case SNDRV_CTL_POWER_D3cold:
- /* not supported yet */
- default:
- return -EINVAL;
- }
- return 0;
-}
-#endif
-
static long snd_ctl_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
{
struct snd_ctl_file *ctl;
@@ -1092,19 +1062,7 @@ static long snd_ctl_ioctl(struct file *file, unsigned int cmd, unsigned long arg
case SNDRV_CTL_IOCTL_SUBSCRIBE_EVENTS:
return snd_ctl_subscribe_events(ctl, ip);
case SNDRV_CTL_IOCTL_POWER:
- if (get_user(err, ip))
- return -EFAULT;
- if (!capable(CAP_SYS_ADMIN))
- return -EPERM;
-#ifdef CONFIG_PM
- if (card->pm_suspend && card->pm_resume) {
- snd_power_lock(card);
- err = snd_ctl_set_power_state(card, err);
- snd_power_unlock(card);
- } else
-#endif
- err = -ENOPROTOOPT;
- return err;
+ return -ENOPROTOOPT;
case SNDRV_CTL_IOCTL_POWER_STATE:
#ifdef CONFIG_PM
return put_user(card->power_state, ip) ? -EFAULT : 0;
OpenPOWER on IntegriCloud