aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/s3c24xx/s3c-i2s-v2.c
diff options
context:
space:
mode:
authorJassi Brar <jassi.brar@samsung.com>2010-03-10 02:48:51 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2010-03-10 09:12:58 -0500
commit51c6ab130642ed975681df843c772dda48a1d2ed (patch)
tree64eeaf24f4b3e38969e903ebc6209785cbfcf123 /sound/soc/s3c24xx/s3c-i2s-v2.c
parentfa6231e1738617a864869600f51c3feb9e1081c8 (diff)
ASoC: S3C: I2Sv2: Reject immidiate register value
Towards generalizing CPU driver interface, do not accept direct field values for the BCLK and RCLK. The machine driver should simply request the FS-multiple and not provide the value to be set in divide field of IISMOD. [Confirmed by Jassi that no existing machine drivers are affected -- broonie] Signed-off-by: Jassi Brar <jassi.brar@samsung.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/s3c24xx/s3c-i2s-v2.c')
-rw-r--r--sound/soc/s3c24xx/s3c-i2s-v2.c68
1 files changed, 30 insertions, 38 deletions
diff --git a/sound/soc/s3c24xx/s3c-i2s-v2.c b/sound/soc/s3c24xx/s3c-i2s-v2.c
index 65d1cddc4b3a..b846f563cb50 100644
--- a/sound/soc/s3c24xx/s3c-i2s-v2.c
+++ b/sound/soc/s3c24xx/s3c-i2s-v2.c
@@ -463,29 +463,25 @@ static int s3c2412_i2s_set_clkdiv(struct snd_soc_dai *cpu_dai,
463 463
464 switch (div_id) { 464 switch (div_id) {
465 case S3C_I2SV2_DIV_BCLK: 465 case S3C_I2SV2_DIV_BCLK:
466 if (div > 3) { 466 switch (div) {
467 /* convert value to bit field */ 467 case 16:
468 468 div = S3C2412_IISMOD_BCLK_16FS;
469 switch (div) { 469 break;
470 case 16:
471 div = S3C2412_IISMOD_BCLK_16FS;
472 break;
473 470
474 case 32: 471 case 32:
475 div = S3C2412_IISMOD_BCLK_32FS; 472 div = S3C2412_IISMOD_BCLK_32FS;
476 break; 473 break;
477 474
478 case 24: 475 case 24:
479 div = S3C2412_IISMOD_BCLK_24FS; 476 div = S3C2412_IISMOD_BCLK_24FS;
480 break; 477 break;
481 478
482 case 48: 479 case 48:
483 div = S3C2412_IISMOD_BCLK_48FS; 480 div = S3C2412_IISMOD_BCLK_48FS;
484 break; 481 break;
485 482
486 default: 483 default:
487 return -EINVAL; 484 return -EINVAL;
488 }
489 } 485 }
490 486
491 reg = readl(i2s->regs + S3C2412_IISMOD); 487 reg = readl(i2s->regs + S3C2412_IISMOD);
@@ -496,29 +492,25 @@ static int s3c2412_i2s_set_clkdiv(struct snd_soc_dai *cpu_dai,
496 break; 492 break;
497 493
498 case S3C_I2SV2_DIV_RCLK: 494 case S3C_I2SV2_DIV_RCLK:
499 if (div > 3) { 495 switch (div) {
500 /* convert value to bit field */ 496 case 256:
501 497 div = S3C2412_IISMOD_RCLK_256FS;
502 switch (div) { 498 break;
503 case 256:
504 div = S3C2412_IISMOD_RCLK_256FS;
505 break;
506 499
507 case 384: 500 case 384:
508 div = S3C2412_IISMOD_RCLK_384FS; 501 div = S3C2412_IISMOD_RCLK_384FS;
509 break; 502 break;
510 503
511 case 512: 504 case 512:
512 div = S3C2412_IISMOD_RCLK_512FS; 505 div = S3C2412_IISMOD_RCLK_512FS;
513 break; 506 break;
514 507
515 case 768: 508 case 768:
516 div = S3C2412_IISMOD_RCLK_768FS; 509 div = S3C2412_IISMOD_RCLK_768FS;
517 break; 510 break;
518 511
519 default: 512 default:
520 return -EINVAL; 513 return -EINVAL;
521 }
522 } 514 }
523 515
524 reg = readl(i2s->regs + S3C2412_IISMOD); 516 reg = readl(i2s->regs + S3C2412_IISMOD);