aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorMark Brown <broonie@linaro.org>2013-08-30 06:04:24 -0400
committerMark Brown <broonie@linaro.org>2013-08-30 06:04:24 -0400
commit52b3a88439580ec32da58702968c5b70e2638424 (patch)
tree942de19961af4051d587fa87161f2247e16918a7 /sound
parent0f97b69a9feb1b0f21d25925715de142838fcc32 (diff)
parent446a3bd4329bcaf95d71c6717c2c424a0f97ff18 (diff)
Merge remote-tracking branch 'asoc/topic/kirkwood' into tmp
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/kirkwood/Kconfig4
-rw-r--r--sound/soc/kirkwood/kirkwood-i2s.c26
2 files changed, 22 insertions, 8 deletions
diff --git a/sound/soc/kirkwood/Kconfig b/sound/soc/kirkwood/Kconfig
index 9e1970c44e86..78ed4a42ad21 100644
--- a/sound/soc/kirkwood/Kconfig
+++ b/sound/soc/kirkwood/Kconfig
@@ -1,6 +1,6 @@
1config SND_KIRKWOOD_SOC 1config SND_KIRKWOOD_SOC
2 tristate "SoC Audio for the Marvell Kirkwood chip" 2 tristate "SoC Audio for the Marvell Kirkwood and Dove chips"
3 depends on ARCH_KIRKWOOD || COMPILE_TEST 3 depends on ARCH_KIRKWOOD || ARCH_DOVE || COMPILE_TEST
4 help 4 help
5 Say Y or M if you want to add support for codecs attached to 5 Say Y or M if you want to add support for codecs attached to
6 the Kirkwood I2S interface. You will also need to select the 6 the Kirkwood I2S interface. You will also need to select the
diff --git a/sound/soc/kirkwood/kirkwood-i2s.c b/sound/soc/kirkwood/kirkwood-i2s.c
index e5f3f7a9ea26..7fce340ab3ef 100644
--- a/sound/soc/kirkwood/kirkwood-i2s.c
+++ b/sound/soc/kirkwood/kirkwood-i2s.c
@@ -22,6 +22,8 @@
22#include <sound/pcm_params.h> 22#include <sound/pcm_params.h>
23#include <sound/soc.h> 23#include <sound/soc.h>
24#include <linux/platform_data/asoc-kirkwood.h> 24#include <linux/platform_data/asoc-kirkwood.h>
25#include <linux/of.h>
26
25#include "kirkwood.h" 27#include "kirkwood.h"
26 28
27#define DRV_NAME "mvebu-audio" 29#define DRV_NAME "mvebu-audio"
@@ -453,6 +455,7 @@ static int kirkwood_i2s_dev_probe(struct platform_device *pdev)
453 struct snd_soc_dai_driver *soc_dai = &kirkwood_i2s_dai; 455 struct snd_soc_dai_driver *soc_dai = &kirkwood_i2s_dai;
454 struct kirkwood_dma_data *priv; 456 struct kirkwood_dma_data *priv;
455 struct resource *mem; 457 struct resource *mem;
458 struct device_node *np = pdev->dev.of_node;
456 int err; 459 int err;
457 460
458 priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL); 461 priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
@@ -473,14 +476,16 @@ static int kirkwood_i2s_dev_probe(struct platform_device *pdev)
473 return -ENXIO; 476 return -ENXIO;
474 } 477 }
475 478
476 if (!data) { 479 if (np) {
477 dev_err(&pdev->dev, "no platform data ?!\n"); 480 priv->burst = 128; /* might be 32 or 128 */
481 } else if (data) {
482 priv->burst = data->burst;
483 } else {
484 dev_err(&pdev->dev, "no DT nor platform data ?!\n");
478 return -EINVAL; 485 return -EINVAL;
479 } 486 }
480 487
481 priv->burst = data->burst; 488 priv->clk = devm_clk_get(&pdev->dev, np ? "internal" : NULL);
482
483 priv->clk = devm_clk_get(&pdev->dev, NULL);
484 if (IS_ERR(priv->clk)) { 489 if (IS_ERR(priv->clk)) {
485 dev_err(&pdev->dev, "no clock\n"); 490 dev_err(&pdev->dev, "no clock\n");
486 return PTR_ERR(priv->clk); 491 return PTR_ERR(priv->clk);
@@ -507,7 +512,7 @@ static int kirkwood_i2s_dev_probe(struct platform_device *pdev)
507 priv->ctl_rec = KIRKWOOD_RECCTL_SIZE_24; 512 priv->ctl_rec = KIRKWOOD_RECCTL_SIZE_24;
508 513
509 /* Select the burst size */ 514 /* Select the burst size */
510 if (data->burst == 32) { 515 if (priv->burst == 32) {
511 priv->ctl_play |= KIRKWOOD_PLAYCTL_BURST_32; 516 priv->ctl_play |= KIRKWOOD_PLAYCTL_BURST_32;
512 priv->ctl_rec |= KIRKWOOD_RECCTL_BURST_32; 517 priv->ctl_rec |= KIRKWOOD_RECCTL_BURST_32;
513 } else { 518 } else {
@@ -552,12 +557,21 @@ static int kirkwood_i2s_dev_remove(struct platform_device *pdev)
552 return 0; 557 return 0;
553} 558}
554 559
560#ifdef CONFIG_OF
561static struct of_device_id mvebu_audio_of_match[] = {
562 { .compatible = "marvell,mvebu-audio" },
563 { }
564};
565MODULE_DEVICE_TABLE(of, mvebu_audio_of_match);
566#endif
567
555static struct platform_driver kirkwood_i2s_driver = { 568static struct platform_driver kirkwood_i2s_driver = {
556 .probe = kirkwood_i2s_dev_probe, 569 .probe = kirkwood_i2s_dev_probe,
557 .remove = kirkwood_i2s_dev_remove, 570 .remove = kirkwood_i2s_dev_remove,
558 .driver = { 571 .driver = {
559 .name = DRV_NAME, 572 .name = DRV_NAME,
560 .owner = THIS_MODULE, 573 .owner = THIS_MODULE,
574 .of_match_table = of_match_ptr(mvebu_audio_of_match),
561 }, 575 },
562}; 576};
563 577