aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/s3c24xx/s3c24xx-i2s.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/s3c24xx/s3c24xx-i2s.c')
-rw-r--r--sound/soc/s3c24xx/s3c24xx-i2s.c39
1 files changed, 27 insertions, 12 deletions
diff --git a/sound/soc/s3c24xx/s3c24xx-i2s.c b/sound/soc/s3c24xx/s3c24xx-i2s.c
index c3ac890a3986..1d0bade10d3d 100644
--- a/sound/soc/s3c24xx/s3c24xx-i2s.c
+++ b/sound/soc/s3c24xx/s3c24xx-i2s.c
@@ -252,7 +252,7 @@ static int s3c24xx_i2s_hw_params(struct snd_pcm_substream *substream,
252 else 252 else
253 dma_data = &s3c24xx_i2s_pcm_stereo_in; 253 dma_data = &s3c24xx_i2s_pcm_stereo_in;
254 254
255 snd_soc_dai_set_dma_data(rtd->dai->cpu_dai, substream, dma_data); 255 snd_soc_dai_set_dma_data(rtd->cpu_dai, substream, dma_data);
256 256
257 /* Working copies of register */ 257 /* Working copies of register */
258 iismod = readl(s3c24xx_i2s.regs + S3C2410_IISMOD); 258 iismod = readl(s3c24xx_i2s.regs + S3C2410_IISMOD);
@@ -280,9 +280,8 @@ static int s3c24xx_i2s_trigger(struct snd_pcm_substream *substream, int cmd,
280 struct snd_soc_dai *dai) 280 struct snd_soc_dai *dai)
281{ 281{
282 int ret = 0; 282 int ret = 0;
283 struct snd_soc_pcm_runtime *rtd = substream->private_data;
284 struct s3c_dma_params *dma_data = 283 struct s3c_dma_params *dma_data =
285 snd_soc_dai_get_dma_data(rtd->dai->cpu_dai, substream); 284 snd_soc_dai_get_dma_data(dai, substream);
286 285
287 pr_debug("Entered %s\n", __func__); 286 pr_debug("Entered %s\n", __func__);
288 287
@@ -387,8 +386,7 @@ u32 s3c24xx_i2s_get_clockrate(void)
387} 386}
388EXPORT_SYMBOL_GPL(s3c24xx_i2s_get_clockrate); 387EXPORT_SYMBOL_GPL(s3c24xx_i2s_get_clockrate);
389 388
390static int s3c24xx_i2s_probe(struct platform_device *pdev, 389static int s3c24xx_i2s_probe(struct snd_soc_dai *dai)
391 struct snd_soc_dai *dai)
392{ 390{
393 pr_debug("Entered %s\n", __func__); 391 pr_debug("Entered %s\n", __func__);
394 392
@@ -396,7 +394,7 @@ static int s3c24xx_i2s_probe(struct platform_device *pdev,
396 if (s3c24xx_i2s.regs == NULL) 394 if (s3c24xx_i2s.regs == NULL)
397 return -ENXIO; 395 return -ENXIO;
398 396
399 s3c24xx_i2s.iis_clk = clk_get(&pdev->dev, "iis"); 397 s3c24xx_i2s.iis_clk = clk_get(dai->dev, "iis");
400 if (s3c24xx_i2s.iis_clk == NULL) { 398 if (s3c24xx_i2s.iis_clk == NULL) {
401 pr_err("failed to get iis_clock\n"); 399 pr_err("failed to get iis_clock\n");
402 iounmap(s3c24xx_i2s.regs); 400 iounmap(s3c24xx_i2s.regs);
@@ -465,9 +463,7 @@ static struct snd_soc_dai_ops s3c24xx_i2s_dai_ops = {
465 .set_sysclk = s3c24xx_i2s_set_sysclk, 463 .set_sysclk = s3c24xx_i2s_set_sysclk,
466}; 464};
467 465
468struct snd_soc_dai s3c24xx_i2s_dai = { 466static struct snd_soc_dai_driver s3c24xx_i2s_dai = {
469 .name = "s3c24xx-i2s",
470 .id = 0,
471 .probe = s3c24xx_i2s_probe, 467 .probe = s3c24xx_i2s_probe,
472 .suspend = s3c24xx_i2s_suspend, 468 .suspend = s3c24xx_i2s_suspend,
473 .resume = s3c24xx_i2s_resume, 469 .resume = s3c24xx_i2s_resume,
@@ -483,17 +479,36 @@ struct snd_soc_dai s3c24xx_i2s_dai = {
483 .formats = SNDRV_PCM_FMTBIT_S8 | SNDRV_PCM_FMTBIT_S16_LE,}, 479 .formats = SNDRV_PCM_FMTBIT_S8 | SNDRV_PCM_FMTBIT_S16_LE,},
484 .ops = &s3c24xx_i2s_dai_ops, 480 .ops = &s3c24xx_i2s_dai_ops,
485}; 481};
486EXPORT_SYMBOL_GPL(s3c24xx_i2s_dai); 482
483static __devinit int s3c24xx_iis_dev_probe(struct platform_device *pdev)
484{
485 return snd_soc_register_dai(&pdev->dev, &s3c24xx_i2s_dai);
486}
487
488static __devexit int s3c24xx_iis_dev_remove(struct platform_device *pdev)
489{
490 snd_soc_unregister_dai(&pdev->dev);
491 return 0;
492}
493
494static struct platform_driver s3c24xx_iis_driver = {
495 .probe = s3c24xx_iis_dev_probe,
496 .remove = s3c24xx_iis_dev_remove,
497 .driver = {
498 .name = "s3c24xx-iis",
499 .owner = THIS_MODULE,
500 },
501};
487 502
488static int __init s3c24xx_i2s_init(void) 503static int __init s3c24xx_i2s_init(void)
489{ 504{
490 return snd_soc_register_dai(&s3c24xx_i2s_dai); 505 return platform_driver_register(&s3c24xx_iis_driver);
491} 506}
492module_init(s3c24xx_i2s_init); 507module_init(s3c24xx_i2s_init);
493 508
494static void __exit s3c24xx_i2s_exit(void) 509static void __exit s3c24xx_i2s_exit(void)
495{ 510{
496 snd_soc_unregister_dai(&s3c24xx_i2s_dai); 511 platform_driver_unregister(&s3c24xx_iis_driver);
497} 512}
498module_exit(s3c24xx_i2s_exit); 513module_exit(s3c24xx_i2s_exit);
499 514