aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/kirkwood
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-01-12 11:00:30 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2012-01-12 11:00:30 -0500
commita429638cac1e5c656818a45aaff78df7b743004e (patch)
tree0465e0d7a431bff97a3dd5a1f91d9b30c69ae0d8 /sound/soc/kirkwood
parent5cf9a4e69c1ff0ccdd1d2b7404f95c0531355274 (diff)
parent9e4ce164ee3a1d07580f017069c25d180b0aa785 (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (526 commits) ASoC: twl6040 - Add method to query optimum PDM_DL1 gain ALSA: hda - Fix the lost power-setup of seconary pins after PM resume ALSA: usb-audio: add Yamaha MOX6/MOX8 support ALSA: virtuoso: add S/PDIF input support for all Xonars ALSA: ice1724 - Support for ooAoo SQ210a ALSA: ice1724 - Allow card info based on model only ALSA: ice1724 - Create capture pcm only for ADC-enabled configurations ALSA: hdspm - Provide unique driver id based on card serial ASoC: Dynamically allocate the rtd device for a non-empty release() ASoC: Fix recursive dependency due to select ATMEL_SSC in SND_ATMEL_SOC_SSC ALSA: hda - Fix the detection of "Loopback Mixing" control for VIA codecs ALSA: hda - Return the error from get_wcaps_type() for invalid NIDs ALSA: hda - Use auto-parser for HP laptops with cx20459 codec ALSA: asihpi - Fix potential Oops in snd_asihpi_cmode_info() ALSA: hdsp - Fix potential Oops in snd_hdsp_info_pref_sync_ref() ALSA: hda/cirrus - support for iMac12,2 model ASoC: cx20442: add bias control over a platform provided regulator ALSA: usb-audio - Avoid flood of frame-active debug messages ALSA: snd-usb-us122l: Delete calls to preempt_disable mfd: Put WM8994 into cache only mode when suspending ... Fix up trivial conflicts in: - arch/arm/mach-s3c64xx/mach-crag6410.c: renamed speyside_wm8962 to tobermory, added littlemill right next to it - drivers/base/regmap/{regcache.c,regmap.c}: duplicate diff that had already come in with other changes in the regmap tree
Diffstat (limited to 'sound/soc/kirkwood')
-rw-r--r--sound/soc/kirkwood/kirkwood-dma.c17
-rw-r--r--sound/soc/kirkwood/kirkwood-i2s.c17
-rw-r--r--sound/soc/kirkwood/kirkwood-openrd.c15
-rw-r--r--sound/soc/kirkwood/kirkwood-t5325.c25
-rw-r--r--sound/soc/kirkwood/kirkwood.h1
5 files changed, 17 insertions, 58 deletions
diff --git a/sound/soc/kirkwood/kirkwood-dma.c b/sound/soc/kirkwood/kirkwood-dma.c
index df12e0993f5a..d03854027128 100644
--- a/sound/soc/kirkwood/kirkwood-dma.c
+++ b/sound/soc/kirkwood/kirkwood-dma.c
@@ -318,7 +318,6 @@ static int kirkwood_dma_preallocate_dma_buffer(struct snd_pcm *pcm,
318static int kirkwood_dma_new(struct snd_soc_pcm_runtime *rtd) 318static int kirkwood_dma_new(struct snd_soc_pcm_runtime *rtd)
319{ 319{
320 struct snd_card *card = rtd->card->snd_card; 320 struct snd_card *card = rtd->card->snd_card;
321 struct snd_soc_dai *dai = rtd->cpu_dai;
322 struct snd_pcm *pcm = rtd->pcm; 321 struct snd_pcm *pcm = rtd->pcm;
323 int ret; 322 int ret;
324 323
@@ -327,14 +326,14 @@ static int kirkwood_dma_new(struct snd_soc_pcm_runtime *rtd)
327 if (!card->dev->coherent_dma_mask) 326 if (!card->dev->coherent_dma_mask)
328 card->dev->coherent_dma_mask = 0xffffffff; 327 card->dev->coherent_dma_mask = 0xffffffff;
329 328
330 if (dai->driver->playback.channels_min) { 329 if (pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream) {
331 ret = kirkwood_dma_preallocate_dma_buffer(pcm, 330 ret = kirkwood_dma_preallocate_dma_buffer(pcm,
332 SNDRV_PCM_STREAM_PLAYBACK); 331 SNDRV_PCM_STREAM_PLAYBACK);
333 if (ret) 332 if (ret)
334 return ret; 333 return ret;
335 } 334 }
336 335
337 if (dai->driver->capture.channels_min) { 336 if (pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream) {
338 ret = kirkwood_dma_preallocate_dma_buffer(pcm, 337 ret = kirkwood_dma_preallocate_dma_buffer(pcm,
339 SNDRV_PCM_STREAM_CAPTURE); 338 SNDRV_PCM_STREAM_CAPTURE);
340 if (ret) 339 if (ret)
@@ -391,17 +390,7 @@ static struct platform_driver kirkwood_pcm_driver = {
391 .remove = __devexit_p(kirkwood_soc_platform_remove), 390 .remove = __devexit_p(kirkwood_soc_platform_remove),
392}; 391};
393 392
394static int __init kirkwood_pcm_init(void) 393module_platform_driver(kirkwood_pcm_driver);
395{
396 return platform_driver_register(&kirkwood_pcm_driver);
397}
398module_init(kirkwood_pcm_init);
399
400static void __exit kirkwood_pcm_exit(void)
401{
402 platform_driver_unregister(&kirkwood_pcm_driver);
403}
404module_exit(kirkwood_pcm_exit);
405 394
406MODULE_AUTHOR("Arnaud Patard <arnaud.patard@rtp-net.org>"); 395MODULE_AUTHOR("Arnaud Patard <arnaud.patard@rtp-net.org>");
407MODULE_DESCRIPTION("Marvell Kirkwood Audio DMA module"); 396MODULE_DESCRIPTION("Marvell Kirkwood Audio DMA module");
diff --git a/sound/soc/kirkwood/kirkwood-i2s.c b/sound/soc/kirkwood/kirkwood-i2s.c
index 715e841c0507..3cb9aa4299d3 100644
--- a/sound/soc/kirkwood/kirkwood-i2s.c
+++ b/sound/soc/kirkwood/kirkwood-i2s.c
@@ -373,7 +373,7 @@ static int kirkwood_i2s_remove(struct snd_soc_dai *dai)
373 return 0; 373 return 0;
374} 374}
375 375
376static struct snd_soc_dai_ops kirkwood_i2s_dai_ops = { 376static const struct snd_soc_dai_ops kirkwood_i2s_dai_ops = {
377 .startup = kirkwood_i2s_startup, 377 .startup = kirkwood_i2s_startup,
378 .trigger = kirkwood_i2s_trigger, 378 .trigger = kirkwood_i2s_trigger,
379 .hw_params = kirkwood_i2s_hw_params, 379 .hw_params = kirkwood_i2s_hw_params,
@@ -441,13 +441,12 @@ static __devinit int kirkwood_i2s_dev_probe(struct platform_device *pdev)
441 goto err_ioremap; 441 goto err_ioremap;
442 } 442 }
443 443
444 if (!data || !data->dram) { 444 if (!data) {
445 dev_err(&pdev->dev, "no platform data ?!\n"); 445 dev_err(&pdev->dev, "no platform data ?!\n");
446 err = -EINVAL; 446 err = -EINVAL;
447 goto err_ioremap; 447 goto err_ioremap;
448 } 448 }
449 449
450 priv->dram = data->dram;
451 priv->burst = data->burst; 450 priv->burst = data->burst;
452 451
453 return snd_soc_register_dai(&pdev->dev, &kirkwood_i2s_dai); 452 return snd_soc_register_dai(&pdev->dev, &kirkwood_i2s_dai);
@@ -483,17 +482,7 @@ static struct platform_driver kirkwood_i2s_driver = {
483 }, 482 },
484}; 483};
485 484
486static int __init kirkwood_i2s_init(void) 485module_platform_driver(kirkwood_i2s_driver);
487{
488 return platform_driver_register(&kirkwood_i2s_driver);
489}
490module_init(kirkwood_i2s_init);
491
492static void __exit kirkwood_i2s_exit(void)
493{
494 platform_driver_unregister(&kirkwood_i2s_driver);
495}
496module_exit(kirkwood_i2s_exit);
497 486
498/* Module information */ 487/* Module information */
499MODULE_AUTHOR("Arnaud Patard, <arnaud.patard@rtp-net.org>"); 488MODULE_AUTHOR("Arnaud Patard, <arnaud.patard@rtp-net.org>");
diff --git a/sound/soc/kirkwood/kirkwood-openrd.c b/sound/soc/kirkwood/kirkwood-openrd.c
index d863afb3ee52..55d2ed3df30d 100644
--- a/sound/soc/kirkwood/kirkwood-openrd.c
+++ b/sound/soc/kirkwood/kirkwood-openrd.c
@@ -26,18 +26,7 @@ static int openrd_client_hw_params(struct snd_pcm_substream *substream,
26{ 26{
27 struct snd_soc_pcm_runtime *rtd = substream->private_data; 27 struct snd_soc_pcm_runtime *rtd = substream->private_data;
28 struct snd_soc_dai *codec_dai = rtd->codec_dai; 28 struct snd_soc_dai *codec_dai = rtd->codec_dai;
29 struct snd_soc_dai *cpu_dai = rtd->cpu_dai; 29 unsigned int freq;
30 int ret;
31 unsigned int freq, fmt;
32
33 fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_CBS_CFS;
34 ret = snd_soc_dai_set_fmt(cpu_dai, fmt);
35 if (ret < 0)
36 return ret;
37
38 ret = snd_soc_dai_set_fmt(codec_dai, fmt);
39 if (ret < 0)
40 return ret;
41 30
42 switch (params_rate(params)) { 31 switch (params_rate(params)) {
43 default: 32 default:
@@ -69,6 +58,7 @@ static struct snd_soc_dai_link openrd_client_dai[] = {
69 .platform_name = "kirkwood-pcm-audio", 58 .platform_name = "kirkwood-pcm-audio",
70 .codec_dai_name = "cs42l51-hifi", 59 .codec_dai_name = "cs42l51-hifi",
71 .codec_name = "cs42l51-codec.0-004a", 60 .codec_name = "cs42l51-codec.0-004a",
61 .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_CBS_CFS,
72 .ops = &openrd_client_ops, 62 .ops = &openrd_client_ops,
73}, 63},
74}; 64};
@@ -76,6 +66,7 @@ static struct snd_soc_dai_link openrd_client_dai[] = {
76 66
77static struct snd_soc_card openrd_client = { 67static struct snd_soc_card openrd_client = {
78 .name = "OpenRD Client", 68 .name = "OpenRD Client",
69 .owner = THIS_MODULE,
79 .dai_link = openrd_client_dai, 70 .dai_link = openrd_client_dai,
80 .num_links = ARRAY_SIZE(openrd_client_dai), 71 .num_links = ARRAY_SIZE(openrd_client_dai),
81}; 72};
diff --git a/sound/soc/kirkwood/kirkwood-t5325.c b/sound/soc/kirkwood/kirkwood-t5325.c
index c772b3cf4039..b47cc4e9b746 100644
--- a/sound/soc/kirkwood/kirkwood-t5325.c
+++ b/sound/soc/kirkwood/kirkwood-t5325.c
@@ -25,18 +25,7 @@ static int t5325_hw_params(struct snd_pcm_substream *substream,
25{ 25{
26 struct snd_soc_pcm_runtime *rtd = substream->private_data; 26 struct snd_soc_pcm_runtime *rtd = substream->private_data;
27 struct snd_soc_dai *codec_dai = rtd->codec_dai; 27 struct snd_soc_dai *codec_dai = rtd->codec_dai;
28 struct snd_soc_dai *cpu_dai = rtd->cpu_dai; 28 unsigned int freq;
29 int ret;
30 unsigned int freq, fmt;
31
32 fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_CBS_CFS;
33 ret = snd_soc_dai_set_fmt(cpu_dai, fmt);
34 if (ret < 0)
35 return ret;
36
37 ret = snd_soc_dai_set_fmt(codec_dai, fmt);
38 if (ret < 0)
39 return ret;
40 29
41 freq = params_rate(params) * 256; 30 freq = params_rate(params) * 256;
42 31
@@ -70,11 +59,6 @@ static int t5325_dai_init(struct snd_soc_pcm_runtime *rtd)
70 struct snd_soc_codec *codec = rtd->codec; 59 struct snd_soc_codec *codec = rtd->codec;
71 struct snd_soc_dapm_context *dapm = &codec->dapm; 60 struct snd_soc_dapm_context *dapm = &codec->dapm;
72 61
73 snd_soc_dapm_new_controls(dapm, t5325_dapm_widgets,
74 ARRAY_SIZE(t5325_dapm_widgets));
75
76 snd_soc_dapm_add_routes(dapm, t5325_route, ARRAY_SIZE(t5325_route));
77
78 snd_soc_dapm_enable_pin(dapm, "Mic Jack"); 62 snd_soc_dapm_enable_pin(dapm, "Mic Jack");
79 snd_soc_dapm_enable_pin(dapm, "Headphone Jack"); 63 snd_soc_dapm_enable_pin(dapm, "Headphone Jack");
80 snd_soc_dapm_enable_pin(dapm, "Speaker"); 64 snd_soc_dapm_enable_pin(dapm, "Speaker");
@@ -90,6 +74,7 @@ static struct snd_soc_dai_link t5325_dai[] = {
90 .platform_name = "kirkwood-pcm-audio", 74 .platform_name = "kirkwood-pcm-audio",
91 .codec_dai_name = "alc5621-hifi", 75 .codec_dai_name = "alc5621-hifi",
92 .codec_name = "alc562x-codec.0-001a", 76 .codec_name = "alc562x-codec.0-001a",
77 .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_CBS_CFS,
93 .ops = &t5325_ops, 78 .ops = &t5325_ops,
94 .init = t5325_dai_init, 79 .init = t5325_dai_init,
95}, 80},
@@ -98,8 +83,14 @@ static struct snd_soc_dai_link t5325_dai[] = {
98 83
99static struct snd_soc_card t5325 = { 84static struct snd_soc_card t5325 = {
100 .name = "t5325", 85 .name = "t5325",
86 .owner = THIS_MODULE,
101 .dai_link = t5325_dai, 87 .dai_link = t5325_dai,
102 .num_links = ARRAY_SIZE(t5325_dai), 88 .num_links = ARRAY_SIZE(t5325_dai),
89
90 .dapm_widgets = t5325_dapm_widgets,
91 .num_dapm_widgets = ARRAY_SIZE(t5325_dapm_widgets),
92 .dapm_routes = t5325_route,
93 .num_dapm_routes = ARRAY_SIZE(t5325_route),
103}; 94};
104 95
105static struct platform_device *t5325_snd_device; 96static struct platform_device *t5325_snd_device;
diff --git a/sound/soc/kirkwood/kirkwood.h b/sound/soc/kirkwood/kirkwood.h
index bb6e6a5648c9..9047436b3937 100644
--- a/sound/soc/kirkwood/kirkwood.h
+++ b/sound/soc/kirkwood/kirkwood.h
@@ -123,7 +123,6 @@ struct kirkwood_dma_data {
123 void __iomem *io; 123 void __iomem *io;
124 int irq; 124 int irq;
125 int burst; 125 int burst;
126 struct mbus_dram_target_info *dram;
127}; 126};
128 127
129#endif 128#endif