Skip to content

Commit

Permalink
ASoC: Remove platform device from DAI suspend and resume operations
Browse files Browse the repository at this point in the history
None of the DAIs use it except s3c2412-i2s which only uses it for
dev_() printouts.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
  • Loading branch information
Mark Brown committed Dec 3, 2008
1 parent 07c84d0 commit dc7d7b8
Show file tree
Hide file tree
Showing 12 changed files with 31 additions and 53 deletions.
6 changes: 2 additions & 4 deletions include/sound/soc-dai.h
Original file line number Diff line number Diff line change
Expand Up @@ -191,10 +191,8 @@ struct snd_soc_dai {
struct snd_soc_dai *dai);
void (*remove)(struct platform_device *pdev,
struct snd_soc_dai *dai);
int (*suspend)(struct platform_device *pdev,
struct snd_soc_dai *dai);
int (*resume)(struct platform_device *pdev,
struct snd_soc_dai *dai);
int (*suspend)(struct snd_soc_dai *dai);
int (*resume)(struct snd_soc_dai *dai);

/* ops */
struct snd_soc_dai_ops ops;
Expand Down
6 changes: 2 additions & 4 deletions sound/soc/atmel/atmel_ssc_dai.c
Original file line number Diff line number Diff line change
Expand Up @@ -628,8 +628,7 @@ static int atmel_ssc_prepare(struct snd_pcm_substream *substream,


#ifdef CONFIG_PM
static int atmel_ssc_suspend(struct platform_device *pdev,
struct snd_soc_dai *cpu_dai)
static int atmel_ssc_suspend(struct snd_soc_dai *cpu_dai)
{
struct atmel_ssc_info *ssc_p;

Expand Down Expand Up @@ -657,8 +656,7 @@ static int atmel_ssc_suspend(struct platform_device *pdev,



static int atmel_ssc_resume(struct platform_device *pdev,
struct snd_soc_dai *cpu_dai)
static int atmel_ssc_resume(struct snd_soc_dai *cpu_dai)
{
struct atmel_ssc_info *ssc_p;
u32 cr;
Expand Down
6 changes: 2 additions & 4 deletions sound/soc/au1x/psc-ac97.c
Original file line number Diff line number Diff line change
Expand Up @@ -314,8 +314,7 @@ static void au1xpsc_ac97_remove(struct platform_device *pdev,
au1xpsc_ac97_workdata = NULL;
}

static int au1xpsc_ac97_suspend(struct platform_device *pdev,
struct snd_soc_dai *dai)
static int au1xpsc_ac97_suspend(struct snd_soc_dai *dai)
{
/* save interesting registers and disable PSC */
au1xpsc_ac97_workdata->pm[0] =
Expand All @@ -329,8 +328,7 @@ static int au1xpsc_ac97_suspend(struct platform_device *pdev,
return 0;
}

static int au1xpsc_ac97_resume(struct platform_device *pdev,
struct snd_soc_dai *dai)
static int au1xpsc_ac97_resume(struct snd_soc_dai *dai)
{
/* restore PSC clock config */
au_writel(au1xpsc_ac97_workdata->pm[0] | PSC_SEL_PS_AC97MODE,
Expand Down
6 changes: 2 additions & 4 deletions sound/soc/au1x/psc-i2s.c
Original file line number Diff line number Diff line change
Expand Up @@ -339,8 +339,7 @@ static void au1xpsc_i2s_remove(struct platform_device *pdev,
au1xpsc_i2s_workdata = NULL;
}

static int au1xpsc_i2s_suspend(struct platform_device *pdev,
struct snd_soc_dai *cpu_dai)
static int au1xpsc_i2s_suspend(struct snd_soc_dai *cpu_dai)
{
/* save interesting register and disable PSC */
au1xpsc_i2s_workdata->pm[0] =
Expand All @@ -354,8 +353,7 @@ static int au1xpsc_i2s_suspend(struct platform_device *pdev,
return 0;
}

static int au1xpsc_i2s_resume(struct platform_device *pdev,
struct snd_soc_dai *cpu_dai)
static int au1xpsc_i2s_resume(struct snd_soc_dai *cpu_dai)
{
/* select I2S mode and PSC clock */
au_writel(PSC_CTRL_DISABLE, PSC_CTRL(au1xpsc_i2s_workdata));
Expand Down
6 changes: 2 additions & 4 deletions sound/soc/blackfin/bf5xx-ac97.c
Original file line number Diff line number Diff line change
Expand Up @@ -269,8 +269,7 @@ struct snd_ac97_bus_ops soc_ac97_ops = {
EXPORT_SYMBOL_GPL(soc_ac97_ops);

#ifdef CONFIG_PM
static int bf5xx_ac97_suspend(struct platform_device *pdev,
struct snd_soc_dai *dai)
static int bf5xx_ac97_suspend(struct snd_soc_dai *dai)
{
struct sport_device *sport =
(struct sport_device *)dai->private_data;
Expand All @@ -285,8 +284,7 @@ static int bf5xx_ac97_suspend(struct platform_device *pdev,
return 0;
}

static int bf5xx_ac97_resume(struct platform_device *pdev,
struct snd_soc_dai *dai)
static int bf5xx_ac97_resume(struct snd_soc_dai *dai)
{
int ret;
struct sport_device *sport =
Expand Down
6 changes: 2 additions & 4 deletions sound/soc/blackfin/bf5xx-i2s.c
Original file line number Diff line number Diff line change
Expand Up @@ -222,16 +222,14 @@ static int bf5xx_i2s_probe(struct platform_device *pdev,
return 0;
}

static void bf5xx_i2s_remove(struct platform_device *pdev,
struct snd_soc_dai *dai)
static void bf5xx_i2s_remove(struct snd_soc_dai *dai)
{
pr_debug("%s enter\n", __func__);
peripheral_free_list(&sport_req[sport_num][0]);
}

#ifdef CONFIG_PM
static int bf5xx_i2s_suspend(struct platform_device *dev,
struct snd_soc_dai *dai)
static int bf5xx_i2s_suspend(struct snd_soc_dai *dai)
{
struct sport_device *sport =
(struct sport_device *)dai->private_data;
Expand Down
6 changes: 2 additions & 4 deletions sound/soc/pxa/pxa-ssp.c
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,7 @@ static void pxa_ssp_shutdown(struct snd_pcm_substream *substream,

#ifdef CONFIG_PM

static int pxa_ssp_suspend(struct platform_device *pdev,
struct snd_soc_dai *cpu_dai)
static int pxa_ssp_suspend(struct snd_soc_dai *cpu_dai)
{
struct ssp_priv *priv = cpu_dai->private_data;

Expand All @@ -257,8 +256,7 @@ static int pxa_ssp_suspend(struct platform_device *pdev,
return 0;
}

static int pxa_ssp_resume(struct platform_device *pdev,
struct snd_soc_dai *cpu_dai)
static int pxa_ssp_resume(struct snd_soc_dai *cpu_dai)
{
struct ssp_priv *priv = cpu_dai->private_data;

Expand Down
6 changes: 2 additions & 4 deletions sound/soc/pxa/pxa2xx-ac97.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,12 @@ static struct pxa2xx_pcm_dma_params pxa2xx_ac97_pcm_mic_mono_in = {
};

#ifdef CONFIG_PM
static int pxa2xx_ac97_suspend(struct platform_device *pdev,
struct snd_soc_dai *dai)
static int pxa2xx_ac97_suspend(struct snd_soc_dai *dai)
{
return pxa2xx_ac97_hw_suspend();
}

static int pxa2xx_ac97_resume(struct platform_device *pdev,
struct snd_soc_dai *dai)
static int pxa2xx_ac97_resume(struct snd_soc_dai *dai)
{
return pxa2xx_ac97_hw_resume();
}
Expand Down
6 changes: 2 additions & 4 deletions sound/soc/pxa/pxa2xx-i2s.c
Original file line number Diff line number Diff line change
Expand Up @@ -293,8 +293,7 @@ static void pxa2xx_i2s_shutdown(struct snd_pcm_substream *substream,
}

#ifdef CONFIG_PM
static int pxa2xx_i2s_suspend(struct platform_device *dev,
struct snd_soc_dai *dai)
static int pxa2xx_i2s_suspend(struct snd_soc_dai *dai)
{
if (!dai->active)
return 0;
Expand All @@ -311,8 +310,7 @@ static int pxa2xx_i2s_suspend(struct platform_device *dev,
return 0;
}

static int pxa2xx_i2s_resume(struct platform_device *pdev,
struct snd_soc_dai *dai)
static int pxa2xx_i2s_resume(struct snd_soc_dai *dai)
{
if (!dai->active)
return 0;
Expand Down
16 changes: 7 additions & 9 deletions sound/soc/s3c24xx/s3c2412-i2s.c
Original file line number Diff line number Diff line change
Expand Up @@ -649,8 +649,7 @@ static int s3c2412_i2s_probe(struct platform_device *pdev,
}

#ifdef CONFIG_PM
static int s3c2412_i2s_suspend(struct platform_device *dev,
struct snd_soc_dai *dai)
static int s3c2412_i2s_suspend(struct snd_soc_dai *dai)
{
struct s3c2412_i2s_info *i2s = &s3c2412_i2s;
u32 iismod;
Expand All @@ -665,25 +664,24 @@ static int s3c2412_i2s_suspend(struct platform_device *dev,
iismod = readl(i2s->regs + S3C2412_IISMOD);

if (iismod & S3C2412_IISCON_RXDMA_ACTIVE)
dev_warn(&dev->dev, "%s: RXDMA active?\n", __func__);
pr_warning("%s: RXDMA active?\n", __func__);

if (iismod & S3C2412_IISCON_TXDMA_ACTIVE)
dev_warn(&dev->dev, "%s: TXDMA active?\n", __func__);
pr_warning("%s: TXDMA active?\n", __func__);

if (iismod & S3C2412_IISCON_IIS_ACTIVE)
dev_warn(&dev->dev, "%s: IIS active\n", __func__);
pr_warning("%s: IIS active\n", __func__);
}

return 0;
}

static int s3c2412_i2s_resume(struct platform_device *pdev,
struct snd_soc_dai *dai)
static int s3c2412_i2s_resume(struct snd_soc_dai *dai)
{
struct s3c2412_i2s_info *i2s = &s3c2412_i2s;

dev_info(&pdev->dev, "dai_active %d, IISMOD %08x, IISCON %08x\n",
dai->active, i2s->suspend_iismod, i2s->suspend_iiscon);
pr_info("dai_active %d, IISMOD %08x, IISCON %08x\n",
dai->active, i2s->suspend_iismod, i2s->suspend_iiscon);

if (dai->active) {
writel(i2s->suspend_iiscon, i2s->regs + S3C2412_IISCON);
Expand Down
6 changes: 2 additions & 4 deletions sound/soc/s3c24xx/s3c24xx-i2s.c
Original file line number Diff line number Diff line change
Expand Up @@ -419,8 +419,7 @@ static int s3c24xx_i2s_probe(struct platform_device *pdev,
}

#ifdef CONFIG_PM
static int s3c24xx_i2s_suspend(struct platform_device *pdev,
struct snd_soc_dai *cpu_dai)
static int s3c24xx_i2s_suspend(struct snd_soc_dai *cpu_dai)
{
DBG("Entered %s\n", __func__);

Expand All @@ -434,8 +433,7 @@ static int s3c24xx_i2s_suspend(struct platform_device *pdev,
return 0;
}

static int s3c24xx_i2s_resume(struct platform_device *pdev,
struct snd_soc_dai *cpu_dai)
static int s3c24xx_i2s_resume(struct snd_soc_dai *cpu_dai)
{
DBG("Entered %s\n", __func__);
clk_enable(s3c24xx_i2s.iis_clk);
Expand Down
8 changes: 4 additions & 4 deletions sound/soc/soc-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -650,7 +650,7 @@ static int soc_suspend(struct platform_device *pdev, pm_message_t state)
for (i = 0; i < card->num_links; i++) {
struct snd_soc_dai *cpu_dai = card->dai_link[i].cpu_dai;
if (cpu_dai->suspend && !cpu_dai->ac97_control)
cpu_dai->suspend(pdev, cpu_dai);
cpu_dai->suspend(cpu_dai);
if (platform->suspend)
platform->suspend(cpu_dai);
}
Expand All @@ -676,7 +676,7 @@ static int soc_suspend(struct platform_device *pdev, pm_message_t state)
for (i = 0; i < card->num_links; i++) {
struct snd_soc_dai *cpu_dai = card->dai_link[i].cpu_dai;
if (cpu_dai->suspend && cpu_dai->ac97_control)
cpu_dai->suspend(pdev, cpu_dai);
cpu_dai->suspend(cpu_dai);
}

if (card->suspend_post)
Expand Down Expand Up @@ -712,7 +712,7 @@ static void soc_resume_deferred(struct work_struct *work)
for (i = 0; i < card->num_links; i++) {
struct snd_soc_dai *cpu_dai = card->dai_link[i].cpu_dai;
if (cpu_dai->resume && cpu_dai->ac97_control)
cpu_dai->resume(pdev, cpu_dai);
cpu_dai->resume(cpu_dai);
}

if (codec_dev->resume)
Expand All @@ -739,7 +739,7 @@ static void soc_resume_deferred(struct work_struct *work)
for (i = 0; i < card->num_links; i++) {
struct snd_soc_dai *cpu_dai = card->dai_link[i].cpu_dai;
if (cpu_dai->resume && !cpu_dai->ac97_control)
cpu_dai->resume(pdev, cpu_dai);
cpu_dai->resume(cpu_dai);
if (platform->resume)
platform->resume(cpu_dai);
}
Expand Down

0 comments on commit dc7d7b8

Please sign in to comment.