diff options
author | Takashi Iwai <tiwai@suse.de> | 2012-07-19 02:21:40 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2012-07-19 02:21:57 -0400 |
commit | 1558eb838ff502faafacf26b6a711dbaae796009 (patch) | |
tree | 8049ea20a214033369725ed58b8b4a3ca4110887 /sound/pci/hda | |
parent | 4609ed6b1f0ab9f11a9d0361573b53d9d057c440 (diff) | |
parent | 81fcb170852d58d7ebd8101a8ef970c82056426e (diff) |
Merge branch 'topic/pm-convert' into for-next
This merges the changes for converting to new PM ops for platform
and some other drivers.
Also move some header files to local places from the public
include/sound.
Diffstat (limited to 'sound/pci/hda')
-rw-r--r-- | sound/pci/hda/hda_codec.c | 2 | ||||
-rw-r--r-- | sound/pci/hda/hda_codec.h | 2 | ||||
-rw-r--r-- | sound/pci/hda/hda_intel.c | 29 | ||||
-rw-r--r-- | sound/pci/hda/patch_analog.c | 2 | ||||
-rw-r--r-- | sound/pci/hda/patch_cirrus.c | 2 | ||||
-rw-r--r-- | sound/pci/hda/patch_conexant.c | 2 | ||||
-rw-r--r-- | sound/pci/hda/patch_realtek.c | 2 | ||||
-rw-r--r-- | sound/pci/hda/patch_sigmatel.c | 2 | ||||
-rw-r--r-- | sound/pci/hda/patch_via.c | 2 |
9 files changed, 26 insertions, 19 deletions
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c index 20580bf6969..88a9c20eb7a 100644 --- a/sound/pci/hda/hda_codec.c +++ b/sound/pci/hda/hda_codec.c | |||
@@ -3556,7 +3556,7 @@ static inline void hda_exec_init_verbs(struct hda_codec *codec) {} | |||
3556 | static void hda_call_codec_suspend(struct hda_codec *codec) | 3556 | static void hda_call_codec_suspend(struct hda_codec *codec) |
3557 | { | 3557 | { |
3558 | if (codec->patch_ops.suspend) | 3558 | if (codec->patch_ops.suspend) |
3559 | codec->patch_ops.suspend(codec, PMSG_SUSPEND); | 3559 | codec->patch_ops.suspend(codec); |
3560 | hda_cleanup_all_streams(codec); | 3560 | hda_cleanup_all_streams(codec); |
3561 | hda_set_power_state(codec, | 3561 | hda_set_power_state(codec, |
3562 | codec->afg ? codec->afg : codec->mfg, | 3562 | codec->afg ? codec->afg : codec->mfg, |
diff --git a/sound/pci/hda/hda_codec.h b/sound/pci/hda/hda_codec.h index a4ac1de7aa1..c422d330ca5 100644 --- a/sound/pci/hda/hda_codec.h +++ b/sound/pci/hda/hda_codec.h | |||
@@ -706,7 +706,7 @@ struct hda_codec_ops { | |||
706 | void (*set_power_state)(struct hda_codec *codec, hda_nid_t fg, | 706 | void (*set_power_state)(struct hda_codec *codec, hda_nid_t fg, |
707 | unsigned int power_state); | 707 | unsigned int power_state); |
708 | #ifdef CONFIG_PM | 708 | #ifdef CONFIG_PM |
709 | int (*suspend)(struct hda_codec *codec, pm_message_t state); | 709 | int (*suspend)(struct hda_codec *codec); |
710 | int (*resume)(struct hda_codec *codec); | 710 | int (*resume)(struct hda_codec *codec); |
711 | #endif | 711 | #endif |
712 | #ifdef CONFIG_SND_HDA_POWER_SAVE | 712 | #ifdef CONFIG_SND_HDA_POWER_SAVE |
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c index b4f3c7295a5..c8aced182fd 100644 --- a/sound/pci/hda/hda_intel.c +++ b/sound/pci/hda/hda_intel.c | |||
@@ -2405,9 +2405,10 @@ static void azx_power_notify(struct hda_bus *bus) | |||
2405 | * power management | 2405 | * power management |
2406 | */ | 2406 | */ |
2407 | 2407 | ||
2408 | static int azx_suspend(struct pci_dev *pci, pm_message_t state) | 2408 | static int azx_suspend(struct device *dev) |
2409 | { | 2409 | { |
2410 | struct snd_card *card = pci_get_drvdata(pci); | 2410 | struct pci_dev *pci = to_pci_dev(dev); |
2411 | struct snd_card *card = dev_get_drvdata(dev); | ||
2411 | struct azx *chip = card->private_data; | 2412 | struct azx *chip = card->private_data; |
2412 | struct azx_pcm *p; | 2413 | struct azx_pcm *p; |
2413 | 2414 | ||
@@ -2426,13 +2427,14 @@ static int azx_suspend(struct pci_dev *pci, pm_message_t state) | |||
2426 | pci_disable_msi(chip->pci); | 2427 | pci_disable_msi(chip->pci); |
2427 | pci_disable_device(pci); | 2428 | pci_disable_device(pci); |
2428 | pci_save_state(pci); | 2429 | pci_save_state(pci); |
2429 | pci_set_power_state(pci, pci_choose_state(pci, state)); | 2430 | pci_set_power_state(pci, PCI_D3hot); |
2430 | return 0; | 2431 | return 0; |
2431 | } | 2432 | } |
2432 | 2433 | ||
2433 | static int azx_resume(struct pci_dev *pci) | 2434 | static int azx_resume(struct device *dev) |
2434 | { | 2435 | { |
2435 | struct snd_card *card = pci_get_drvdata(pci); | 2436 | struct pci_dev *pci = to_pci_dev(dev); |
2437 | struct snd_card *card = dev_get_drvdata(dev); | ||
2436 | struct azx *chip = card->private_data; | 2438 | struct azx *chip = card->private_data; |
2437 | 2439 | ||
2438 | pci_set_power_state(pci, PCI_D0); | 2440 | pci_set_power_state(pci, PCI_D0); |
@@ -2457,6 +2459,12 @@ static int azx_resume(struct pci_dev *pci) | |||
2457 | snd_power_change_state(card, SNDRV_CTL_POWER_D0); | 2459 | snd_power_change_state(card, SNDRV_CTL_POWER_D0); |
2458 | return 0; | 2460 | return 0; |
2459 | } | 2461 | } |
2462 | static SIMPLE_DEV_PM_OPS(azx_pm, azx_suspend, azx_resume); | ||
2463 | #define AZX_PM_OPS &azx_pm | ||
2464 | #else | ||
2465 | #define azx_suspend(dev) | ||
2466 | #define azx_resume(dev) | ||
2467 | #define AZX_PM_OPS NULL | ||
2460 | #endif /* CONFIG_PM */ | 2468 | #endif /* CONFIG_PM */ |
2461 | 2469 | ||
2462 | 2470 | ||
@@ -2523,13 +2531,13 @@ static void azx_vs_set_state(struct pci_dev *pci, | |||
2523 | disabled ? "Disabling" : "Enabling", | 2531 | disabled ? "Disabling" : "Enabling", |
2524 | pci_name(chip->pci)); | 2532 | pci_name(chip->pci)); |
2525 | if (disabled) { | 2533 | if (disabled) { |
2526 | azx_suspend(pci, PMSG_FREEZE); | 2534 | azx_suspend(&pci->dev); |
2527 | chip->disabled = true; | 2535 | chip->disabled = true; |
2528 | snd_hda_lock_devices(chip->bus); | 2536 | snd_hda_lock_devices(chip->bus); |
2529 | } else { | 2537 | } else { |
2530 | snd_hda_unlock_devices(chip->bus); | 2538 | snd_hda_unlock_devices(chip->bus); |
2531 | chip->disabled = false; | 2539 | chip->disabled = false; |
2532 | azx_resume(pci); | 2540 | azx_resume(&pci->dev); |
2533 | } | 2541 | } |
2534 | } | 2542 | } |
2535 | } | 2543 | } |
@@ -3412,10 +3420,9 @@ static struct pci_driver azx_driver = { | |||
3412 | .id_table = azx_ids, | 3420 | .id_table = azx_ids, |
3413 | .probe = azx_probe, | 3421 | .probe = azx_probe, |
3414 | .remove = __devexit_p(azx_remove), | 3422 | .remove = __devexit_p(azx_remove), |
3415 | #ifdef CONFIG_PM | 3423 | .driver = { |
3416 | .suspend = azx_suspend, | 3424 | .pm = AZX_PM_OPS, |
3417 | .resume = azx_resume, | 3425 | }, |
3418 | #endif | ||
3419 | }; | 3426 | }; |
3420 | 3427 | ||
3421 | module_pci_driver(azx_driver); | 3428 | module_pci_driver(azx_driver); |
diff --git a/sound/pci/hda/patch_analog.c b/sound/pci/hda/patch_analog.c index d8b2d6dee98..0208fa121e5 100644 --- a/sound/pci/hda/patch_analog.c +++ b/sound/pci/hda/patch_analog.c | |||
@@ -642,7 +642,7 @@ static void ad198x_free(struct hda_codec *codec) | |||
642 | } | 642 | } |
643 | 643 | ||
644 | #ifdef CONFIG_PM | 644 | #ifdef CONFIG_PM |
645 | static int ad198x_suspend(struct hda_codec *codec, pm_message_t state) | 645 | static int ad198x_suspend(struct hda_codec *codec) |
646 | { | 646 | { |
647 | ad198x_shutup(codec); | 647 | ad198x_shutup(codec); |
648 | return 0; | 648 | return 0; |
diff --git a/sound/pci/hda/patch_cirrus.c b/sound/pci/hda/patch_cirrus.c index 9647ed4d792..0c4c1a61b37 100644 --- a/sound/pci/hda/patch_cirrus.c +++ b/sound/pci/hda/patch_cirrus.c | |||
@@ -1892,7 +1892,7 @@ static int cs421x_parse_auto_config(struct hda_codec *codec) | |||
1892 | Manage PDREF, when transitioning to D3hot | 1892 | Manage PDREF, when transitioning to D3hot |
1893 | (DAC,ADC) -> D3, PDREF=1, AFG->D3 | 1893 | (DAC,ADC) -> D3, PDREF=1, AFG->D3 |
1894 | */ | 1894 | */ |
1895 | static int cs421x_suspend(struct hda_codec *codec, pm_message_t state) | 1895 | static int cs421x_suspend(struct hda_codec *codec) |
1896 | { | 1896 | { |
1897 | struct cs_spec *spec = codec->spec; | 1897 | struct cs_spec *spec = codec->spec; |
1898 | unsigned int coef; | 1898 | unsigned int coef; |
diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c index 2bf99fc1cbf..14361184ae1 100644 --- a/sound/pci/hda/patch_conexant.c +++ b/sound/pci/hda/patch_conexant.c | |||
@@ -554,7 +554,7 @@ static int conexant_build_controls(struct hda_codec *codec) | |||
554 | } | 554 | } |
555 | 555 | ||
556 | #ifdef CONFIG_SND_HDA_POWER_SAVE | 556 | #ifdef CONFIG_SND_HDA_POWER_SAVE |
557 | static int conexant_suspend(struct hda_codec *codec, pm_message_t state) | 557 | static int conexant_suspend(struct hda_codec *codec) |
558 | { | 558 | { |
559 | snd_hda_shutup_pins(codec); | 559 | snd_hda_shutup_pins(codec); |
560 | return 0; | 560 | return 0; |
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index ec14224021a..537c365716a 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c | |||
@@ -2442,7 +2442,7 @@ static void alc_power_eapd(struct hda_codec *codec) | |||
2442 | alc_auto_setup_eapd(codec, false); | 2442 | alc_auto_setup_eapd(codec, false); |
2443 | } | 2443 | } |
2444 | 2444 | ||
2445 | static int alc_suspend(struct hda_codec *codec, pm_message_t state) | 2445 | static int alc_suspend(struct hda_codec *codec) |
2446 | { | 2446 | { |
2447 | struct alc_spec *spec = codec->spec; | 2447 | struct alc_spec *spec = codec->spec; |
2448 | alc_shutup(codec); | 2448 | alc_shutup(codec); |
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c index 07675282015..a1596a3b171 100644 --- a/sound/pci/hda/patch_sigmatel.c +++ b/sound/pci/hda/patch_sigmatel.c | |||
@@ -4997,7 +4997,7 @@ static int stac92xx_resume(struct hda_codec *codec) | |||
4997 | return 0; | 4997 | return 0; |
4998 | } | 4998 | } |
4999 | 4999 | ||
5000 | static int stac92xx_suspend(struct hda_codec *codec, pm_message_t state) | 5000 | static int stac92xx_suspend(struct hda_codec *codec) |
5001 | { | 5001 | { |
5002 | stac92xx_shutup(codec); | 5002 | stac92xx_shutup(codec); |
5003 | return 0; | 5003 | return 0; |
diff --git a/sound/pci/hda/patch_via.c b/sound/pci/hda/patch_via.c index 82b368068e0..90645560ed3 100644 --- a/sound/pci/hda/patch_via.c +++ b/sound/pci/hda/patch_via.c | |||
@@ -1748,7 +1748,7 @@ static void via_unsol_event(struct hda_codec *codec, | |||
1748 | } | 1748 | } |
1749 | 1749 | ||
1750 | #ifdef CONFIG_PM | 1750 | #ifdef CONFIG_PM |
1751 | static int via_suspend(struct hda_codec *codec, pm_message_t state) | 1751 | static int via_suspend(struct hda_codec *codec) |
1752 | { | 1752 | { |
1753 | struct via_spec *spec = codec->spec; | 1753 | struct via_spec *spec = codec->spec; |
1754 | vt1708_stop_hp_work(spec); | 1754 | vt1708_stop_hp_work(spec); |