diff options
author | Peter Ujfalusi <peter.ujfalusi@ti.com> | 2012-03-08 06:34:16 -0500 |
---|---|---|
committer | Liam Girdwood <lrg@ti.com> | 2012-03-12 09:34:23 -0400 |
commit | 5788c62e72b8484836ae6587c7fb65757a777a3a (patch) | |
tree | b0d943dd164abc2a58c3da43342615cf62609be4 /sound/soc | |
parent | cd1f08c7f64ce2093877ecafd21ee784c8ca2389 (diff) |
ASoC: omap-mcbsp: Correct clock muxing for CLKR/FSR signals
Remove the no longer valid check for McBSP1 regarding to signal mux
selection (on OMAP4 McBSP4 has 6 pin setup).
Only clear the srgr2, pcr0 register configuration if the requested clock
configuration will actually going to touch it. In this way we can avoid
issues if the CLKR/FSR mux has been configured after the clock selection.
We are going to check for the valid McBSP port in the
omap_mcbsp_6pin_src_mux() function based on the validity of the mux_signal
callback (which is only valid for ports having 6 pin setup).
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@ti.com>
Diffstat (limited to 'sound/soc')
-rw-r--r-- | sound/soc/omap/mcbsp.c | 9 | ||||
-rw-r--r-- | sound/soc/omap/omap-mcbsp.c | 34 |
2 files changed, 19 insertions, 24 deletions
diff --git a/sound/soc/omap/mcbsp.c b/sound/soc/omap/mcbsp.c index 95413a168087..e5f44440d1b9 100644 --- a/sound/soc/omap/mcbsp.c +++ b/sound/soc/omap/mcbsp.c | |||
@@ -690,7 +690,9 @@ int omap2_mcbsp_set_clks_src(struct omap_mcbsp *mcbsp, u8 fck_src_id) | |||
690 | int omap_mcbsp_6pin_src_mux(struct omap_mcbsp *mcbsp, u8 mux) | 690 | int omap_mcbsp_6pin_src_mux(struct omap_mcbsp *mcbsp, u8 mux) |
691 | { | 691 | { |
692 | const char *signal, *src; | 692 | const char *signal, *src; |
693 | int ret = 0; | 693 | |
694 | if (mcbsp->pdata->mux_signal) | ||
695 | return -EINVAL; | ||
694 | 696 | ||
695 | switch (mux) { | 697 | switch (mux) { |
696 | case CLKR_SRC_CLKR: | 698 | case CLKR_SRC_CLKR: |
@@ -713,10 +715,7 @@ int omap_mcbsp_6pin_src_mux(struct omap_mcbsp *mcbsp, u8 mux) | |||
713 | return -EINVAL; | 715 | return -EINVAL; |
714 | } | 716 | } |
715 | 717 | ||
716 | if (mcbsp->pdata->mux_signal) | 718 | return mcbsp->pdata->mux_signal(mcbsp->dev, signal, src); |
717 | ret = mcbsp->pdata->mux_signal(mcbsp->dev, signal, src); | ||
718 | |||
719 | return ret; | ||
720 | } | 719 | } |
721 | 720 | ||
722 | #define max_thres(m) (mcbsp->pdata->buffer_size) | 721 | #define max_thres(m) (mcbsp->pdata->buffer_size) |
diff --git a/sound/soc/omap/omap-mcbsp.c b/sound/soc/omap/omap-mcbsp.c index d8409b008431..626e2d6db20e 100644 --- a/sound/soc/omap/omap-mcbsp.c +++ b/sound/soc/omap/omap-mcbsp.c | |||
@@ -511,17 +511,21 @@ static int omap_mcbsp_dai_set_dai_sysclk(struct snd_soc_dai *cpu_dai, | |||
511 | return -EBUSY; | 511 | return -EBUSY; |
512 | } | 512 | } |
513 | 513 | ||
514 | /* The McBSP signal muxing functions are only available on McBSP1 */ | 514 | if (clk_id == OMAP_MCBSP_SYSCLK_CLK || |
515 | if (clk_id == OMAP_MCBSP_CLKR_SRC_CLKR || | 515 | clk_id == OMAP_MCBSP_SYSCLK_CLKS_FCLK || |
516 | clk_id == OMAP_MCBSP_CLKR_SRC_CLKX || | 516 | clk_id == OMAP_MCBSP_SYSCLK_CLKS_EXT || |
517 | clk_id == OMAP_MCBSP_FSR_SRC_FSR || | 517 | clk_id == OMAP_MCBSP_SYSCLK_CLKX_EXT || |
518 | clk_id == OMAP_MCBSP_FSR_SRC_FSX) | 518 | clk_id == OMAP_MCBSP_SYSCLK_CLKR_EXT) { |
519 | if (cpu_class_is_omap1() || cpu_dai->id != 1) | 519 | mcbsp->in_freq = freq; |
520 | return -EINVAL; | 520 | regs->srgr2 &= ~CLKSM; |
521 | 521 | regs->pcr0 &= ~SCLKME; | |
522 | mcbsp->in_freq = freq; | 522 | } else if (cpu_class_is_omap1()) { |
523 | regs->srgr2 &= ~CLKSM; | 523 | /* |
524 | regs->pcr0 &= ~SCLKME; | 524 | * McBSP CLKR/FSR signal muxing functions are only available on |
525 | * OMAP2 or newer versions | ||
526 | */ | ||
527 | return -EINVAL; | ||
528 | } | ||
525 | 529 | ||
526 | switch (clk_id) { | 530 | switch (clk_id) { |
527 | case OMAP_MCBSP_SYSCLK_CLK: | 531 | case OMAP_MCBSP_SYSCLK_CLK: |
@@ -552,23 +556,15 @@ static int omap_mcbsp_dai_set_dai_sysclk(struct snd_soc_dai *cpu_dai, | |||
552 | 556 | ||
553 | 557 | ||
554 | case OMAP_MCBSP_CLKR_SRC_CLKR: | 558 | case OMAP_MCBSP_CLKR_SRC_CLKR: |
555 | if (cpu_class_is_omap1()) | ||
556 | break; | ||
557 | err = omap_mcbsp_6pin_src_mux(mcbsp, CLKR_SRC_CLKR); | 559 | err = omap_mcbsp_6pin_src_mux(mcbsp, CLKR_SRC_CLKR); |
558 | break; | 560 | break; |
559 | case OMAP_MCBSP_CLKR_SRC_CLKX: | 561 | case OMAP_MCBSP_CLKR_SRC_CLKX: |
560 | if (cpu_class_is_omap1()) | ||
561 | break; | ||
562 | err = omap_mcbsp_6pin_src_mux(mcbsp, CLKR_SRC_CLKX); | 562 | err = omap_mcbsp_6pin_src_mux(mcbsp, CLKR_SRC_CLKX); |
563 | break; | 563 | break; |
564 | case OMAP_MCBSP_FSR_SRC_FSR: | 564 | case OMAP_MCBSP_FSR_SRC_FSR: |
565 | if (cpu_class_is_omap1()) | ||
566 | break; | ||
567 | err = omap_mcbsp_6pin_src_mux(mcbsp, FSR_SRC_FSR); | 565 | err = omap_mcbsp_6pin_src_mux(mcbsp, FSR_SRC_FSR); |
568 | break; | 566 | break; |
569 | case OMAP_MCBSP_FSR_SRC_FSX: | 567 | case OMAP_MCBSP_FSR_SRC_FSX: |
570 | if (cpu_class_is_omap1()) | ||
571 | break; | ||
572 | err = omap_mcbsp_6pin_src_mux(mcbsp, FSR_SRC_FSX); | 568 | err = omap_mcbsp_6pin_src_mux(mcbsp, FSR_SRC_FSX); |
573 | break; | 569 | break; |
574 | default: | 570 | default: |