diff options
author | Takashi Iwai <tiwai@suse.de> | 2012-07-02 09:20:37 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2012-07-03 02:23:03 -0400 |
commit | 68cb2b559278858ef9f3a7722f95df88797c7840 (patch) | |
tree | 3dd568aac5e1004ffd1e8400aa5a50ca6a11ad01 /sound/pci/intel8x0.c | |
parent | 284e7ca75f96a18f182cce38ba76ee724fb97e16 (diff) |
ALSA: Convert to new pm_ops for PCI drivers
Straightforward conversion to the new pm_ops from the legacy
suspend/resume ops.
Since we change vx222, vx_core and vxpocket have to be converted,
too.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/intel8x0.c')
-rw-r--r-- | sound/pci/intel8x0.c | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/sound/pci/intel8x0.c b/sound/pci/intel8x0.c index f4e2dd4da8cf..cd553f592e2d 100644 --- a/sound/pci/intel8x0.c +++ b/sound/pci/intel8x0.c | |||
@@ -2624,9 +2624,10 @@ static int snd_intel8x0_free(struct intel8x0 *chip) | |||
2624 | /* | 2624 | /* |
2625 | * power management | 2625 | * power management |
2626 | */ | 2626 | */ |
2627 | static int intel8x0_suspend(struct pci_dev *pci, pm_message_t state) | 2627 | static int intel8x0_suspend(struct device *dev) |
2628 | { | 2628 | { |
2629 | struct snd_card *card = pci_get_drvdata(pci); | 2629 | struct pci_dev *pci = to_pci_dev(dev); |
2630 | struct snd_card *card = dev_get_drvdata(dev); | ||
2630 | struct intel8x0 *chip = card->private_data; | 2631 | struct intel8x0 *chip = card->private_data; |
2631 | int i; | 2632 | int i; |
2632 | 2633 | ||
@@ -2658,13 +2659,14 @@ static int intel8x0_suspend(struct pci_dev *pci, pm_message_t state) | |||
2658 | /* The call below may disable built-in speaker on some laptops | 2659 | /* The call below may disable built-in speaker on some laptops |
2659 | * after S2RAM. So, don't touch it. | 2660 | * after S2RAM. So, don't touch it. |
2660 | */ | 2661 | */ |
2661 | /* pci_set_power_state(pci, pci_choose_state(pci, state)); */ | 2662 | /* pci_set_power_state(pci, PCI_D3hot); */ |
2662 | return 0; | 2663 | return 0; |
2663 | } | 2664 | } |
2664 | 2665 | ||
2665 | static int intel8x0_resume(struct pci_dev *pci) | 2666 | static int intel8x0_resume(struct device *dev) |
2666 | { | 2667 | { |
2667 | struct snd_card *card = pci_get_drvdata(pci); | 2668 | struct pci_dev *pci = to_pci_dev(dev); |
2669 | struct snd_card *card = dev_get_drvdata(dev); | ||
2668 | struct intel8x0 *chip = card->private_data; | 2670 | struct intel8x0 *chip = card->private_data; |
2669 | int i; | 2671 | int i; |
2670 | 2672 | ||
@@ -2734,6 +2736,11 @@ static int intel8x0_resume(struct pci_dev *pci) | |||
2734 | snd_power_change_state(card, SNDRV_CTL_POWER_D0); | 2736 | snd_power_change_state(card, SNDRV_CTL_POWER_D0); |
2735 | return 0; | 2737 | return 0; |
2736 | } | 2738 | } |
2739 | |||
2740 | static SIMPLE_DEV_PM_OPS(intel8x0_pm, intel8x0_suspend, intel8x0_resume); | ||
2741 | #define INTEL8X0_PM_OPS &intel8x0_pm | ||
2742 | #else | ||
2743 | #define INTEL8X0_PM_OPS NULL | ||
2737 | #endif /* CONFIG_PM */ | 2744 | #endif /* CONFIG_PM */ |
2738 | 2745 | ||
2739 | #define INTEL8X0_TESTBUF_SIZE 32768 /* enough large for one shot */ | 2746 | #define INTEL8X0_TESTBUF_SIZE 32768 /* enough large for one shot */ |
@@ -3343,10 +3350,9 @@ static struct pci_driver intel8x0_driver = { | |||
3343 | .id_table = snd_intel8x0_ids, | 3350 | .id_table = snd_intel8x0_ids, |
3344 | .probe = snd_intel8x0_probe, | 3351 | .probe = snd_intel8x0_probe, |
3345 | .remove = __devexit_p(snd_intel8x0_remove), | 3352 | .remove = __devexit_p(snd_intel8x0_remove), |
3346 | #ifdef CONFIG_PM | 3353 | .driver = { |
3347 | .suspend = intel8x0_suspend, | 3354 | .pm = INTEL8X0_PM_OPS, |
3348 | .resume = intel8x0_resume, | 3355 | }, |
3349 | #endif | ||
3350 | }; | 3356 | }; |
3351 | 3357 | ||
3352 | module_pci_driver(intel8x0_driver); | 3358 | module_pci_driver(intel8x0_driver); |