summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolin Chen <b42378@freescale.com>2013-09-12 14:32:24 +0800
committerNicolin Chen <b42378@freescale.com>2013-09-12 17:49:17 +0800
commitd5a503b1c2f0ae52264b1b51bcf28a8f8f540908 (patch)
tree25d041db7b8951d9d4d3b1405293f305eccfab6b
parenta243d0339a0119f1b6999296463770081b715c92 (diff)
ENGR00279368-2 ASoC: fsl: Add missing snd_soc_pm_ops to all machine drivers
Alsa machine drivers need snd_soc_pm_ops to support normal suspend/resume feature, thus add this to all machine drivers. Also add missing SUSPEND and RESUME cases to trigger() in fsl_ssi.c Acked-by: Wang Shengjiu <b02247@freescale.com> Signed-off-by: Nicolin Chen <b42378@freescale.com>
-rw-r--r--sound/soc/fsl/fsl_ssi.c2
-rw-r--r--sound/soc/fsl/imx-cs42888.c3
-rw-r--r--sound/soc/fsl/imx-hdmi.c5
-rw-r--r--sound/soc/fsl/imx-si476x.c3
-rw-r--r--sound/soc/fsl/imx-spdif.c11
-rw-r--r--sound/soc/fsl/imx-wm8962.c15
6 files changed, 28 insertions, 11 deletions
diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c
index 731fc3f293c6..aa0be19a05a2 100644
--- a/sound/soc/fsl/fsl_ssi.c
+++ b/sound/soc/fsl/fsl_ssi.c
@@ -511,6 +511,7 @@ static int fsl_ssi_trigger(struct snd_pcm_substream *substream, int cmd,
switch (cmd) {
case SNDRV_PCM_TRIGGER_START:
+ case SNDRV_PCM_TRIGGER_RESUME:
case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
write_ssi_mask(&ssi->scr, 0,
@@ -525,6 +526,7 @@ static int fsl_ssi_trigger(struct snd_pcm_substream *substream, int cmd,
break;
case SNDRV_PCM_TRIGGER_STOP:
+ case SNDRV_PCM_TRIGGER_SUSPEND:
case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
write_ssi_mask(&ssi->scr, CCSR_SSI_SCR_TE, 0);
diff --git a/sound/soc/fsl/imx-cs42888.c b/sound/soc/fsl/imx-cs42888.c
index f10fe19e7926..efecc6641c6d 100644
--- a/sound/soc/fsl/imx-cs42888.c
+++ b/sound/soc/fsl/imx-cs42888.c
@@ -328,6 +328,8 @@ static int imx_cs42888_probe(struct platform_device *pdev)
snd_soc_card_imx_cs42888.dev = &pdev->dev;
+ platform_set_drvdata(pdev, &snd_soc_card_imx_cs42888);
+
ret = snd_soc_register_card(&snd_soc_card_imx_cs42888);
if (ret)
dev_err(&pdev->dev, "snd_soc_register_card failed (%d)\n", ret);
@@ -356,6 +358,7 @@ static struct platform_driver imx_cs42888_driver = {
.driver = {
.name = "imx-cs42888",
.owner = THIS_MODULE,
+ .pm = &snd_soc_pm_ops,
.of_match_table = imx_cs42888_dt_ids,
},
};
diff --git a/sound/soc/fsl/imx-hdmi.c b/sound/soc/fsl/imx-hdmi.c
index c6b33b942fe9..5a8fcadc2fde 100644
--- a/sound/soc/fsl/imx-hdmi.c
+++ b/sound/soc/fsl/imx-hdmi.c
@@ -66,6 +66,8 @@ static int imx_hdmi_audio_probe(struct platform_device *pdev)
card->dev = &pdev->dev;
card->dai_link->cpu_dai_name = dev_name(&hdmi_pdev->dev);
+ platform_set_drvdata(pdev, card);
+
ret = snd_soc_register_card(card);
if (ret)
dev_err(&pdev->dev, "failed to register card: %d\n", ret);
@@ -79,7 +81,7 @@ end:
static int imx_hdmi_audio_remove(struct platform_device *pdev)
{
- struct snd_soc_card *card = &snd_soc_card_imx_hdmi;
+ struct snd_soc_card *card = platform_get_drvdata(pdev);
snd_soc_unregister_card(card);
@@ -99,6 +101,7 @@ static struct platform_driver imx_hdmi_audio_driver = {
.of_match_table = imx_hdmi_dt_ids,
.name = "imx-audio-hdmi",
.owner = THIS_MODULE,
+ .pm = &snd_soc_pm_ops,
},
};
diff --git a/sound/soc/fsl/imx-si476x.c b/sound/soc/fsl/imx-si476x.c
index d3febf80af59..3d56912ed5f4 100644
--- a/sound/soc/fsl/imx-si476x.c
+++ b/sound/soc/fsl/imx-si476x.c
@@ -119,6 +119,8 @@ static int imx_si476x_probe(struct platform_device *pdev)
card->dai_link->cpu_dai_name = dev_name(&ssi_pdev->dev);
card->dai_link->platform_of_node = ssi_np;
+ platform_set_drvdata(pdev, card);
+
ret = snd_soc_register_card(card);
if (ret)
dev_err(&pdev->dev, "Failed to register card: %d\n", ret);
@@ -149,6 +151,7 @@ static struct platform_driver imx_si476x_driver = {
.driver = {
.name = "imx-tuner-si476x",
.owner = THIS_MODULE,
+ .pm = &snd_soc_pm_ops,
.of_match_table = imx_si476x_dt_ids,
},
.probe = imx_si476x_probe,
diff --git a/sound/soc/fsl/imx-spdif.c b/sound/soc/fsl/imx-spdif.c
index 816013b0ebba..0b9d2d76d714 100644
--- a/sound/soc/fsl/imx-spdif.c
+++ b/sound/soc/fsl/imx-spdif.c
@@ -87,14 +87,15 @@ static int imx_spdif_audio_probe(struct platform_device *pdev)
if (ret)
goto error_dir;
+ platform_set_drvdata(pdev, &data->card);
+ snd_soc_card_set_drvdata(&data->card, data);
+
ret = snd_soc_register_card(&data->card);
if (ret) {
dev_err(&pdev->dev, "snd_soc_register_card failed: %d\n", ret);
goto error_dir;
}
- platform_set_drvdata(pdev, data);
-
goto end;
error_dir:
@@ -112,14 +113,15 @@ end:
static int imx_spdif_audio_remove(struct platform_device *pdev)
{
- struct imx_spdif_data *data = platform_get_drvdata(pdev);
+ struct snd_soc_card *card = platform_get_drvdata(pdev);
+ struct imx_spdif_data *data = snd_soc_card_get_drvdata(card);
if (data->rxdev)
platform_device_unregister(data->rxdev);
if (data->txdev)
platform_device_unregister(data->txdev);
- snd_soc_unregister_card(&data->card);
+ snd_soc_unregister_card(card);
return 0;
}
@@ -134,6 +136,7 @@ static struct platform_driver imx_spdif_driver = {
.driver = {
.name = "imx-spdif",
.owner = THIS_MODULE,
+ .pm = &snd_soc_pm_ops,
.of_match_table = imx_spdif_dt_ids,
},
.probe = imx_spdif_audio_probe,
diff --git a/sound/soc/fsl/imx-wm8962.c b/sound/soc/fsl/imx-wm8962.c
index a8b49e6ac8b6..586fe876c04c 100644
--- a/sound/soc/fsl/imx-wm8962.c
+++ b/sound/soc/fsl/imx-wm8962.c
@@ -180,7 +180,8 @@ static int imx_hifi_hw_params(struct snd_pcm_substream *substream,
struct snd_soc_dai *codec_dai = rtd->codec_dai;
struct imx_priv *priv = &card_priv;
struct device *dev = &priv->pdev->dev;
- struct imx_wm8962_data *data = platform_get_drvdata(priv->pdev);
+ struct snd_soc_card *card = codec_dai->codec->card;
+ struct imx_wm8962_data *data = snd_soc_card_get_drvdata(card);
unsigned int sample_rate = params_rate(params);
snd_pcm_format_t sample_format = params_format(params);
u32 dai_format, pll_out;
@@ -366,7 +367,7 @@ static int imx_wm8962_late_probe(struct snd_soc_card *card)
{
struct snd_soc_dai *codec_dai = card->rtd[0].codec_dai;
struct imx_priv *priv = &card_priv;
- struct imx_wm8962_data *data = platform_get_drvdata(priv->pdev);
+ struct imx_wm8962_data *data = snd_soc_card_get_drvdata(card);
struct device *dev = &priv->pdev->dev;
int ret;
@@ -500,14 +501,15 @@ static int imx_wm8962_probe(struct platform_device *pdev)
data->card.late_probe = imx_wm8962_late_probe;
+ platform_set_drvdata(pdev, &data->card);
+ snd_soc_card_set_drvdata(&data->card, data);
+
ret = snd_soc_register_card(&data->card);
if (ret) {
dev_err(&pdev->dev, "snd_soc_register_card failed (%d)\n", ret);
goto fail;
}
- platform_set_drvdata(pdev, data);
-
if (gpio_is_valid(priv->hp_gpio)) {
ret = driver_create_file(pdev->dev.driver, &driver_attr_headphone);
if (ret) {
@@ -541,12 +543,12 @@ fail:
static int imx_wm8962_remove(struct platform_device *pdev)
{
- struct imx_wm8962_data *data = platform_get_drvdata(pdev);
+ struct snd_soc_card *card = platform_get_drvdata(pdev);
driver_remove_file(pdev->dev.driver, &driver_attr_microphone);
driver_remove_file(pdev->dev.driver, &driver_attr_headphone);
- snd_soc_unregister_card(&data->card);
+ snd_soc_unregister_card(card);
return 0;
}
@@ -561,6 +563,7 @@ static struct platform_driver imx_wm8962_driver = {
.driver = {
.name = "imx-wm8962",
.owner = THIS_MODULE,
+ .pm = &snd_soc_pm_ops,
.of_match_table = imx_wm8962_dt_ids,
},
.probe = imx_wm8962_probe,