Skip to content

Commit

Permalink
Merge branch 'topic/pm-convert' into for-next
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Takashi Iwai committed Jul 19, 2012
2 parents 4609ed6 + 81fcb17 commit 1558eb8
Show file tree
Hide file tree
Showing 83 changed files with 602 additions and 410 deletions.
2 changes: 1 addition & 1 deletion include/sound/vx_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ int vx_change_frequency(struct vx_core *chip);
/*
* PM
*/
int snd_vx_suspend(struct vx_core *card, pm_message_t state);
int snd_vx_suspend(struct vx_core *card);
int snd_vx_resume(struct vx_core *card);

/*
Expand Down
9 changes: 3 additions & 6 deletions sound/arm/pxa2xx-ac97.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ static struct pxa2xx_pcm_client pxa2xx_ac97_pcm_client = {

#ifdef CONFIG_PM

static int pxa2xx_ac97_do_suspend(struct snd_card *card, pm_message_t state)
static int pxa2xx_ac97_do_suspend(struct snd_card *card)
{
pxa2xx_audio_ops_t *platform_ops = card->dev->platform_data;

Expand Down Expand Up @@ -144,7 +144,7 @@ static int pxa2xx_ac97_suspend(struct device *dev)
int ret = 0;

if (card)
ret = pxa2xx_ac97_do_suspend(card, PMSG_SUSPEND);
ret = pxa2xx_ac97_do_suspend(card);

return ret;
}
Expand All @@ -160,10 +160,7 @@ static int pxa2xx_ac97_resume(struct device *dev)
return ret;
}

static const struct dev_pm_ops pxa2xx_ac97_pm_ops = {
.suspend = pxa2xx_ac97_suspend,
.resume = pxa2xx_ac97_resume,
};
static SIMPLE_DEV_PM_OPS(pxa2xx_ac97_pm_ops, pxa2xx_ac97_suspend, pxa2xx_ac97_resume);
#endif

static int __devinit pxa2xx_ac97_probe(struct platform_device *dev)
Expand Down
18 changes: 10 additions & 8 deletions sound/atmel/abdac.c
Original file line number Diff line number Diff line change
Expand Up @@ -535,9 +535,9 @@ static int __devinit atmel_abdac_probe(struct platform_device *pdev)
}

#ifdef CONFIG_PM
static int atmel_abdac_suspend(struct platform_device *pdev, pm_message_t msg)
static int atmel_abdac_suspend(struct device *pdev)
{
struct snd_card *card = platform_get_drvdata(pdev);
struct snd_card *card = dev_get_drvdata(pdev);
struct atmel_abdac *dac = card->private_data;

dw_dma_cyclic_stop(dac->dma.chan);
Expand All @@ -547,9 +547,9 @@ static int atmel_abdac_suspend(struct platform_device *pdev, pm_message_t msg)
return 0;
}

static int atmel_abdac_resume(struct platform_device *pdev)
static int atmel_abdac_resume(struct device *pdev)
{
struct snd_card *card = platform_get_drvdata(pdev);
struct snd_card *card = dev_get_drvdata(pdev);
struct atmel_abdac *dac = card->private_data;

clk_enable(dac->pclk);
Expand All @@ -559,9 +559,11 @@ static int atmel_abdac_resume(struct platform_device *pdev)

return 0;
}

static SIMPLE_DEV_PM_OPS(atmel_abdac_pm, atmel_abdac_suspend, atmel_abdac_resume);
#define ATMEL_ABDAC_PM_OPS &atmel_abdac_pm
#else
#define atmel_abdac_suspend NULL
#define atmel_abdac_resume NULL
#define ATMEL_ABDAC_PM_OPS NULL
#endif

static int __devexit atmel_abdac_remove(struct platform_device *pdev)
Expand Down Expand Up @@ -589,9 +591,9 @@ static struct platform_driver atmel_abdac_driver = {
.remove = __devexit_p(atmel_abdac_remove),
.driver = {
.name = "atmel_abdac",
.owner = THIS_MODULE,
.pm = ATMEL_ABDAC_PM_OPS,
},
.suspend = atmel_abdac_suspend,
.resume = atmel_abdac_resume,
};

static int __init atmel_abdac_init(void)
Expand Down
18 changes: 10 additions & 8 deletions sound/atmel/ac97c.c
Original file line number Diff line number Diff line change
Expand Up @@ -1135,9 +1135,9 @@ static int __devinit atmel_ac97c_probe(struct platform_device *pdev)
}

#ifdef CONFIG_PM
static int atmel_ac97c_suspend(struct platform_device *pdev, pm_message_t msg)
static int atmel_ac97c_suspend(struct device *pdev)
{
struct snd_card *card = platform_get_drvdata(pdev);
struct snd_card *card = dev_get_drvdata(pdev);
struct atmel_ac97c *chip = card->private_data;

if (cpu_is_at32ap7000()) {
Expand All @@ -1151,9 +1151,9 @@ static int atmel_ac97c_suspend(struct platform_device *pdev, pm_message_t msg)
return 0;
}

static int atmel_ac97c_resume(struct platform_device *pdev)
static int atmel_ac97c_resume(struct device *pdev)
{
struct snd_card *card = platform_get_drvdata(pdev);
struct snd_card *card = dev_get_drvdata(pdev);
struct atmel_ac97c *chip = card->private_data;

clk_enable(chip->pclk);
Expand All @@ -1165,9 +1165,11 @@ static int atmel_ac97c_resume(struct platform_device *pdev)
}
return 0;
}

static SIMPLE_DEV_PM_OPS(atmel_ac97c_pm, atmel_ac97c_suspend, atmel_ac97c_resume);
#define ATMEL_AC97C_PM_OPS &atmel_ac97c_pm
#else
#define atmel_ac97c_suspend NULL
#define atmel_ac97c_resume NULL
#define ATMEL_AC97C_PM_OPS NULL
#endif

static int __devexit atmel_ac97c_remove(struct platform_device *pdev)
Expand Down Expand Up @@ -1210,9 +1212,9 @@ static struct platform_driver atmel_ac97c_driver = {
.remove = __devexit_p(atmel_ac97c_remove),
.driver = {
.name = "atmel_ac97c",
.owner = THIS_MODULE,
.pm = ATMEL_AC97C_PM_OPS,
},
.suspend = atmel_ac97c_suspend,
.resume = atmel_ac97c_resume,
};

static int __init atmel_ac97c_init(void)
Expand Down
22 changes: 12 additions & 10 deletions sound/drivers/aloop.c
Original file line number Diff line number Diff line change
Expand Up @@ -1177,10 +1177,9 @@ static int __devexit loopback_remove(struct platform_device *devptr)
}

#ifdef CONFIG_PM
static int loopback_suspend(struct platform_device *pdev,
pm_message_t state)
static int loopback_suspend(struct device *pdev)
{
struct snd_card *card = platform_get_drvdata(pdev);
struct snd_card *card = dev_get_drvdata(pdev);
struct loopback *loopback = card->private_data;

snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
Expand All @@ -1190,26 +1189,29 @@ static int loopback_suspend(struct platform_device *pdev,
return 0;
}

static int loopback_resume(struct platform_device *pdev)
static int loopback_resume(struct device *pdev)
{
struct snd_card *card = platform_get_drvdata(pdev);
struct snd_card *card = dev_get_drvdata(pdev);

snd_power_change_state(card, SNDRV_CTL_POWER_D0);
return 0;
}

static SIMPLE_DEV_PM_OPS(loopback_pm, loopback_suspend, loopback_resume);
#define LOOPBACK_PM_OPS &loopback_pm
#else
#define LOOPBACK_PM_OPS NULL
#endif

#define SND_LOOPBACK_DRIVER "snd_aloop"

static struct platform_driver loopback_driver = {
.probe = loopback_probe,
.remove = __devexit_p(loopback_remove),
#ifdef CONFIG_PM
.suspend = loopback_suspend,
.resume = loopback_resume,
#endif
.driver = {
.name = SND_LOOPBACK_DRIVER
.name = SND_LOOPBACK_DRIVER,
.owner = THIS_MODULE,
.pm = LOOPBACK_PM_OPS,
},
};

Expand Down
21 changes: 12 additions & 9 deletions sound/drivers/dummy.c
Original file line number Diff line number Diff line change
Expand Up @@ -1065,36 +1065,39 @@ static int __devexit snd_dummy_remove(struct platform_device *devptr)
}

#ifdef CONFIG_PM
static int snd_dummy_suspend(struct platform_device *pdev, pm_message_t state)
static int snd_dummy_suspend(struct device *pdev)
{
struct snd_card *card = platform_get_drvdata(pdev);
struct snd_card *card = dev_get_drvdata(pdev);
struct snd_dummy *dummy = card->private_data;

snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
snd_pcm_suspend_all(dummy->pcm);
return 0;
}

static int snd_dummy_resume(struct platform_device *pdev)
static int snd_dummy_resume(struct device *pdev)
{
struct snd_card *card = platform_get_drvdata(pdev);
struct snd_card *card = dev_get_drvdata(pdev);

snd_power_change_state(card, SNDRV_CTL_POWER_D0);
return 0;
}

static SIMPLE_DEV_PM_OPS(snd_dummy_pm, snd_dummy_suspend, snd_dummy_resume);
#define SND_DUMMY_PM_OPS &snd_dummy_pm
#else
#define SND_DUMMY_PM_OPS NULL
#endif

#define SND_DUMMY_DRIVER "snd_dummy"

static struct platform_driver snd_dummy_driver = {
.probe = snd_dummy_probe,
.remove = __devexit_p(snd_dummy_remove),
#ifdef CONFIG_PM
.suspend = snd_dummy_suspend,
.resume = snd_dummy_resume,
#endif
.driver = {
.name = SND_DUMMY_DRIVER
.name = SND_DUMMY_DRIVER,
.owner = THIS_MODULE,
.pm = SND_DUMMY_PM_OPS,
},
};

Expand Down
3 changes: 2 additions & 1 deletion sound/drivers/mpu401/mpu401.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,8 @@ static struct platform_driver snd_mpu401_driver = {
.probe = snd_mpu401_probe,
.remove = __devexit_p(snd_mpu401_remove),
.driver = {
.name = SND_MPU401_DRIVER
.name = SND_MPU401_DRIVER,
.owner = THIS_MODULE,
},
};

Expand Down
3 changes: 2 additions & 1 deletion sound/drivers/mtpav.c
Original file line number Diff line number Diff line change
Expand Up @@ -759,7 +759,8 @@ static struct platform_driver snd_mtpav_driver = {
.probe = snd_mtpav_probe,
.remove = __devexit_p(snd_mtpav_remove),
.driver = {
.name = SND_MTPAV_DRIVER
.name = SND_MTPAV_DRIVER,
.owner = THIS_MODULE,
},
};

Expand Down
3 changes: 2 additions & 1 deletion sound/drivers/mts64.c
Original file line number Diff line number Diff line change
Expand Up @@ -1040,7 +1040,8 @@ static struct platform_driver snd_mts64_driver = {
.probe = snd_mts64_probe,
.remove = __devexit_p(snd_mts64_remove),
.driver = {
.name = PLATFORM_DRIVER
.name = PLATFORM_DRIVER,
.owner = THIS_MODULE,
}
};

Expand Down
11 changes: 7 additions & 4 deletions sound/drivers/pcsp/pcsp.c
Original file line number Diff line number Diff line change
Expand Up @@ -200,15 +200,18 @@ static void pcsp_stop_beep(struct snd_pcsp *chip)
}

#ifdef CONFIG_PM
static int pcsp_suspend(struct platform_device *dev, pm_message_t state)
static int pcsp_suspend(struct device *dev)
{
struct snd_pcsp *chip = platform_get_drvdata(dev);
struct snd_pcsp *chip = dev_get_drvdata(dev);
pcsp_stop_beep(chip);
snd_pcm_suspend_all(chip->pcm);
return 0;
}

static SIMPLE_DEV_PM_OPS(pcsp_pm, pcsp_suspend, NULL);
#define PCSP_PM_OPS &pcsp_pm
#else
#define pcsp_suspend NULL
#define PCSP_PM_OPS NULL
#endif /* CONFIG_PM */

static void pcsp_shutdown(struct platform_device *dev)
Expand All @@ -221,10 +224,10 @@ static struct platform_driver pcsp_platform_driver = {
.driver = {
.name = "pcspkr",
.owner = THIS_MODULE,
.pm = PCSP_PM_OPS,
},
.probe = pcsp_probe,
.remove = __devexit_p(pcsp_remove),
.suspend = pcsp_suspend,
.shutdown = pcsp_shutdown,
};

Expand Down
3 changes: 2 additions & 1 deletion sound/drivers/portman2x4.c
Original file line number Diff line number Diff line change
Expand Up @@ -829,7 +829,8 @@ static struct platform_driver snd_portman_driver = {
.probe = snd_portman_probe,
.remove = __devexit_p(snd_portman_remove),
.driver = {
.name = PLATFORM_DRIVER
.name = PLATFORM_DRIVER,
.owner = THIS_MODULE,
}
};

Expand Down
3 changes: 2 additions & 1 deletion sound/drivers/serial-u16550.c
Original file line number Diff line number Diff line change
Expand Up @@ -995,7 +995,8 @@ static struct platform_driver snd_serial_driver = {
.probe = snd_serial_probe,
.remove = __devexit_p( snd_serial_remove),
.driver = {
.name = SND_SERIAL_DRIVER
.name = SND_SERIAL_DRIVER,
.owner = THIS_MODULE,
},
};

Expand Down
3 changes: 2 additions & 1 deletion sound/drivers/virmidi.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,8 @@ static struct platform_driver snd_virmidi_driver = {
.probe = snd_virmidi_probe,
.remove = __devexit_p(snd_virmidi_remove),
.driver = {
.name = SND_VIRMIDI_DRIVER
.name = SND_VIRMIDI_DRIVER,
.owner = THIS_MODULE,
},
};

Expand Down
2 changes: 1 addition & 1 deletion sound/drivers/vx/vx_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -725,7 +725,7 @@ EXPORT_SYMBOL(snd_vx_dsp_load);
/*
* suspend
*/
int snd_vx_suspend(struct vx_core *chip, pm_message_t state)
int snd_vx_suspend(struct vx_core *chip)
{
unsigned int i;

Expand Down
24 changes: 15 additions & 9 deletions sound/pci/ali5451/ali5451.c
Original file line number Diff line number Diff line change
Expand Up @@ -1884,9 +1884,10 @@ static int __devinit snd_ali_mixer(struct snd_ali * codec)
}

#ifdef CONFIG_PM
static int ali_suspend(struct pci_dev *pci, pm_message_t state)
static int ali_suspend(struct device *dev)
{
struct snd_card *card = pci_get_drvdata(pci);
struct pci_dev *pci = to_pci_dev(dev);
struct snd_card *card = dev_get_drvdata(dev);
struct snd_ali *chip = card->private_data;
struct snd_ali_image *im;
int i, j;
Expand Down Expand Up @@ -1929,13 +1930,14 @@ static int ali_suspend(struct pci_dev *pci, pm_message_t state)

pci_disable_device(pci);
pci_save_state(pci);
pci_set_power_state(pci, pci_choose_state(pci, state));
pci_set_power_state(pci, PCI_D3hot);
return 0;
}

static int ali_resume(struct pci_dev *pci)
static int ali_resume(struct device *dev)
{
struct snd_card *card = pci_get_drvdata(pci);
struct pci_dev *pci = to_pci_dev(dev);
struct snd_card *card = dev_get_drvdata(dev);
struct snd_ali *chip = card->private_data;
struct snd_ali_image *im;
int i, j;
Expand Down Expand Up @@ -1982,6 +1984,11 @@ static int ali_resume(struct pci_dev *pci)
snd_power_change_state(card, SNDRV_CTL_POWER_D0);
return 0;
}

static SIMPLE_DEV_PM_OPS(ali_pm, ali_suspend, ali_resume);
#define ALI_PM_OPS &ali_pm
#else
#define ALI_PM_OPS NULL
#endif /* CONFIG_PM */

static int snd_ali_free(struct snd_ali * codec)
Expand Down Expand Up @@ -2299,10 +2306,9 @@ static struct pci_driver ali5451_driver = {
.id_table = snd_ali_ids,
.probe = snd_ali_probe,
.remove = __devexit_p(snd_ali_remove),
#ifdef CONFIG_PM
.suspend = ali_suspend,
.resume = ali_resume,
#endif
.driver = {
.pm = ALI_PM_OPS,
},
};

module_pci_driver(ali5451_driver);
Loading

0 comments on commit 1558eb8

Please sign in to comment.