aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/kirkwood/kirkwood-i2s.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/kirkwood/kirkwood-i2s.c')
-rw-r--r--sound/soc/kirkwood/kirkwood-i2s.c46
1 files changed, 25 insertions, 21 deletions
diff --git a/sound/soc/kirkwood/kirkwood-i2s.c b/sound/soc/kirkwood/kirkwood-i2s.c
index d34d91743e3f..3920a5e8125f 100644
--- a/sound/soc/kirkwood/kirkwood-i2s.c
+++ b/sound/soc/kirkwood/kirkwood-i2s.c
@@ -33,6 +33,10 @@
33 SNDRV_PCM_FMTBIT_S24_LE | \ 33 SNDRV_PCM_FMTBIT_S24_LE | \
34 SNDRV_PCM_FMTBIT_S32_LE) 34 SNDRV_PCM_FMTBIT_S32_LE)
35 35
36#define KIRKWOOD_SPDIF_FORMATS \
37 (SNDRV_PCM_FMTBIT_S16_LE | \
38 SNDRV_PCM_FMTBIT_S24_LE)
39
36static int kirkwood_i2s_set_fmt(struct snd_soc_dai *cpu_dai, 40static int kirkwood_i2s_set_fmt(struct snd_soc_dai *cpu_dai,
37 unsigned int fmt) 41 unsigned int fmt)
38{ 42{
@@ -244,15 +248,15 @@ static int kirkwood_i2s_play_trigger(struct snd_pcm_substream *substream,
244 ctl); 248 ctl);
245 } 249 }
246 250
247 if (dai->id == 0)
248 ctl &= ~KIRKWOOD_PLAYCTL_SPDIF_EN; /* i2s */
249 else
250 ctl &= ~KIRKWOOD_PLAYCTL_I2S_EN; /* spdif */
251
252 switch (cmd) { 251 switch (cmd) {
253 case SNDRV_PCM_TRIGGER_START: 252 case SNDRV_PCM_TRIGGER_START:
254 /* configure */ 253 /* configure */
255 ctl = priv->ctl_play; 254 ctl = priv->ctl_play;
255 if (dai->id == 0)
256 ctl &= ~KIRKWOOD_PLAYCTL_SPDIF_EN; /* i2s */
257 else
258 ctl &= ~KIRKWOOD_PLAYCTL_I2S_EN; /* spdif */
259
256 value = ctl & ~KIRKWOOD_PLAYCTL_ENABLE_MASK; 260 value = ctl & ~KIRKWOOD_PLAYCTL_ENABLE_MASK;
257 writel(value, priv->io + KIRKWOOD_PLAYCTL); 261 writel(value, priv->io + KIRKWOOD_PLAYCTL);
258 262
@@ -449,14 +453,14 @@ static struct snd_soc_dai_driver kirkwood_i2s_dai[2] = {
449 .channels_max = 2, 453 .channels_max = 2,
450 .rates = SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000 | 454 .rates = SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000 |
451 SNDRV_PCM_RATE_96000, 455 SNDRV_PCM_RATE_96000,
452 .formats = KIRKWOOD_I2S_FORMATS, 456 .formats = KIRKWOOD_SPDIF_FORMATS,
453 }, 457 },
454 .capture = { 458 .capture = {
455 .channels_min = 1, 459 .channels_min = 1,
456 .channels_max = 2, 460 .channels_max = 2,
457 .rates = SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000 | 461 .rates = SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000 |
458 SNDRV_PCM_RATE_96000, 462 SNDRV_PCM_RATE_96000,
459 .formats = KIRKWOOD_I2S_FORMATS, 463 .formats = KIRKWOOD_SPDIF_FORMATS,
460 }, 464 },
461 .ops = &kirkwood_i2s_dai_ops, 465 .ops = &kirkwood_i2s_dai_ops,
462 }, 466 },
@@ -469,17 +473,17 @@ static struct snd_soc_dai_driver kirkwood_i2s_dai_extclk[2] = {
469 .playback = { 473 .playback = {
470 .channels_min = 1, 474 .channels_min = 1,
471 .channels_max = 2, 475 .channels_max = 2,
472 .rates = SNDRV_PCM_RATE_8000_192000 | 476 .rates = SNDRV_PCM_RATE_CONTINUOUS,
473 SNDRV_PCM_RATE_CONTINUOUS | 477 .rate_min = 5512,
474 SNDRV_PCM_RATE_KNOT, 478 .rate_max = 192000,
475 .formats = KIRKWOOD_I2S_FORMATS, 479 .formats = KIRKWOOD_I2S_FORMATS,
476 }, 480 },
477 .capture = { 481 .capture = {
478 .channels_min = 1, 482 .channels_min = 1,
479 .channels_max = 2, 483 .channels_max = 2,
480 .rates = SNDRV_PCM_RATE_8000_192000 | 484 .rates = SNDRV_PCM_RATE_CONTINUOUS,
481 SNDRV_PCM_RATE_CONTINUOUS | 485 .rate_min = 5512,
482 SNDRV_PCM_RATE_KNOT, 486 .rate_max = 192000,
483 .formats = KIRKWOOD_I2S_FORMATS, 487 .formats = KIRKWOOD_I2S_FORMATS,
484 }, 488 },
485 .ops = &kirkwood_i2s_dai_ops, 489 .ops = &kirkwood_i2s_dai_ops,
@@ -490,18 +494,18 @@ static struct snd_soc_dai_driver kirkwood_i2s_dai_extclk[2] = {
490 .playback = { 494 .playback = {
491 .channels_min = 1, 495 .channels_min = 1,
492 .channels_max = 2, 496 .channels_max = 2,
493 .rates = SNDRV_PCM_RATE_8000_192000 | 497 .rates = SNDRV_PCM_RATE_CONTINUOUS,
494 SNDRV_PCM_RATE_CONTINUOUS | 498 .rate_min = 5512,
495 SNDRV_PCM_RATE_KNOT, 499 .rate_max = 192000,
496 .formats = KIRKWOOD_I2S_FORMATS, 500 .formats = KIRKWOOD_SPDIF_FORMATS,
497 }, 501 },
498 .capture = { 502 .capture = {
499 .channels_min = 1, 503 .channels_min = 1,
500 .channels_max = 2, 504 .channels_max = 2,
501 .rates = SNDRV_PCM_RATE_8000_192000 | 505 .rates = SNDRV_PCM_RATE_CONTINUOUS,
502 SNDRV_PCM_RATE_CONTINUOUS | 506 .rate_min = 5512,
503 SNDRV_PCM_RATE_KNOT, 507 .rate_max = 192000,
504 .formats = KIRKWOOD_I2S_FORMATS, 508 .formats = KIRKWOOD_SPDIF_FORMATS,
505 }, 509 },
506 .ops = &kirkwood_i2s_dai_ops, 510 .ops = &kirkwood_i2s_dai_ops,
507 }, 511 },