diff options
Diffstat (limited to 'sound/soc/samsung/pcm.c')
-rw-r--r-- | sound/soc/samsung/pcm.c | 34 |
1 files changed, 14 insertions, 20 deletions
diff --git a/sound/soc/samsung/pcm.c b/sound/soc/samsung/pcm.c index 05a47cf7f06..56780206c00 100644 --- a/sound/soc/samsung/pcm.c +++ b/sound/soc/samsung/pcm.c | |||
@@ -14,6 +14,7 @@ | |||
14 | #include <linux/clk.h> | 14 | #include <linux/clk.h> |
15 | #include <linux/io.h> | 15 | #include <linux/io.h> |
16 | #include <linux/module.h> | 16 | #include <linux/module.h> |
17 | #include <linux/pm_runtime.h> | ||
17 | 18 | ||
18 | #include <sound/soc.h> | 19 | #include <sound/soc.h> |
19 | #include <sound/pcm_params.h> | 20 | #include <sound/pcm_params.h> |
@@ -452,7 +453,7 @@ static int s3c_pcm_set_sysclk(struct snd_soc_dai *cpu_dai, | |||
452 | return 0; | 453 | return 0; |
453 | } | 454 | } |
454 | 455 | ||
455 | static struct snd_soc_dai_ops s3c_pcm_dai_ops = { | 456 | static const struct snd_soc_dai_ops s3c_pcm_dai_ops = { |
456 | .set_sysclk = s3c_pcm_set_sysclk, | 457 | .set_sysclk = s3c_pcm_set_sysclk, |
457 | .set_clkdiv = s3c_pcm_set_clkdiv, | 458 | .set_clkdiv = s3c_pcm_set_clkdiv, |
458 | .trigger = s3c_pcm_trigger, | 459 | .trigger = s3c_pcm_trigger, |
@@ -478,7 +479,7 @@ static struct snd_soc_dai_ops s3c_pcm_dai_ops = { | |||
478 | .formats = SNDRV_PCM_FMTBIT_S16_LE, \ | 479 | .formats = SNDRV_PCM_FMTBIT_S16_LE, \ |
479 | } | 480 | } |
480 | 481 | ||
481 | struct snd_soc_dai_driver s3c_pcm_dai[] = { | 482 | static struct snd_soc_dai_driver s3c_pcm_dai[] = { |
482 | [0] = { | 483 | [0] = { |
483 | .name = "samsung-pcm.0", | 484 | .name = "samsung-pcm.0", |
484 | S3C_PCM_DAI_DECLARE, | 485 | S3C_PCM_DAI_DECLARE, |
@@ -488,7 +489,6 @@ struct snd_soc_dai_driver s3c_pcm_dai[] = { | |||
488 | S3C_PCM_DAI_DECLARE, | 489 | S3C_PCM_DAI_DECLARE, |
489 | }, | 490 | }, |
490 | }; | 491 | }; |
491 | EXPORT_SYMBOL_GPL(s3c_pcm_dai); | ||
492 | 492 | ||
493 | static __devinit int s3c_pcm_dev_probe(struct platform_device *pdev) | 493 | static __devinit int s3c_pcm_dev_probe(struct platform_device *pdev) |
494 | { | 494 | { |
@@ -570,12 +570,6 @@ static __devinit int s3c_pcm_dev_probe(struct platform_device *pdev) | |||
570 | } | 570 | } |
571 | clk_enable(pcm->pclk); | 571 | clk_enable(pcm->pclk); |
572 | 572 | ||
573 | ret = snd_soc_register_dai(&pdev->dev, &s3c_pcm_dai[pdev->id]); | ||
574 | if (ret != 0) { | ||
575 | dev_err(&pdev->dev, "failed to get pcm_clock\n"); | ||
576 | goto err5; | ||
577 | } | ||
578 | |||
579 | s3c_pcm_stereo_in[pdev->id].dma_addr = mem_res->start | 573 | s3c_pcm_stereo_in[pdev->id].dma_addr = mem_res->start |
580 | + S3C_PCM_RXFIFO; | 574 | + S3C_PCM_RXFIFO; |
581 | s3c_pcm_stereo_out[pdev->id].dma_addr = mem_res->start | 575 | s3c_pcm_stereo_out[pdev->id].dma_addr = mem_res->start |
@@ -587,6 +581,14 @@ static __devinit int s3c_pcm_dev_probe(struct platform_device *pdev) | |||
587 | pcm->dma_capture = &s3c_pcm_stereo_in[pdev->id]; | 581 | pcm->dma_capture = &s3c_pcm_stereo_in[pdev->id]; |
588 | pcm->dma_playback = &s3c_pcm_stereo_out[pdev->id]; | 582 | pcm->dma_playback = &s3c_pcm_stereo_out[pdev->id]; |
589 | 583 | ||
584 | pm_runtime_enable(&pdev->dev); | ||
585 | |||
586 | ret = snd_soc_register_dai(&pdev->dev, &s3c_pcm_dai[pdev->id]); | ||
587 | if (ret != 0) { | ||
588 | dev_err(&pdev->dev, "failed to get register DAI: %d\n", ret); | ||
589 | goto err5; | ||
590 | } | ||
591 | |||
590 | return 0; | 592 | return 0; |
591 | 593 | ||
592 | err5: | 594 | err5: |
@@ -610,6 +612,8 @@ static __devexit int s3c_pcm_dev_remove(struct platform_device *pdev) | |||
610 | 612 | ||
611 | snd_soc_unregister_dai(&pdev->dev); | 613 | snd_soc_unregister_dai(&pdev->dev); |
612 | 614 | ||
615 | pm_runtime_disable(&pdev->dev); | ||
616 | |||
613 | iounmap(pcm->regs); | 617 | iounmap(pcm->regs); |
614 | 618 | ||
615 | mem_res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 619 | mem_res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
@@ -632,17 +636,7 @@ static struct platform_driver s3c_pcm_driver = { | |||
632 | }, | 636 | }, |
633 | }; | 637 | }; |
634 | 638 | ||
635 | static int __init s3c_pcm_init(void) | 639 | module_platform_driver(s3c_pcm_driver); |
636 | { | ||
637 | return platform_driver_register(&s3c_pcm_driver); | ||
638 | } | ||
639 | module_init(s3c_pcm_init); | ||
640 | |||
641 | static void __exit s3c_pcm_exit(void) | ||
642 | { | ||
643 | platform_driver_unregister(&s3c_pcm_driver); | ||
644 | } | ||
645 | module_exit(s3c_pcm_exit); | ||
646 | 640 | ||
647 | /* Module information */ | 641 | /* Module information */ |
648 | MODULE_AUTHOR("Jaswinder Singh, <jassi.brar@samsung.com>"); | 642 | MODULE_AUTHOR("Jaswinder Singh, <jassi.brar@samsung.com>"); |