summaryrefslogtreecommitdiffstats
path: root/sound/soc/omap/mcbsp.c
diff options
context:
space:
mode:
authorPeter Ujfalusi <peter.ujfalusi@ti.com>2012-03-08 11:01:37 +0200
committerLiam Girdwood <lrg@ti.com>2012-03-12 13:34:23 +0000
commitcd1f08c7f64ce2093877ecafd21ee784c8ca2389 (patch)
treeb8d71627371435c1b5539311ddf0e1bef6b25dfe /sound/soc/omap/mcbsp.c
parent33cec399048545c64d9b9a1368b968acee8acb35 (diff)
ASoC: omap-mcbsp: Single function CLKR/FSR source mux configuration
Use single function for the CLKR/FSR mux configuration. OMAP2/3 has 6 pin configuration on McBSP1 instance, while on OMAP4 McBSP4 instance have the 6 pin configuration so the omap2_mcbsp1_mux_* is not correct name for all support OMAP versions Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Acked-by: Jarkko Nikula <jarkko.nikula@bitmer.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@ti.com>
Diffstat (limited to 'sound/soc/omap/mcbsp.c')
-rw-r--r--sound/soc/omap/mcbsp.c48
1 files changed, 22 insertions, 26 deletions
diff --git a/sound/soc/omap/mcbsp.c b/sound/soc/omap/mcbsp.c
index c3e31deafa0..95413a16808 100644
--- a/sound/soc/omap/mcbsp.c
+++ b/sound/soc/omap/mcbsp.c
@@ -687,40 +687,36 @@ int omap2_mcbsp_set_clks_src(struct omap_mcbsp *mcbsp, u8 fck_src_id)
return -EINVAL;
}
-void omap2_mcbsp1_mux_clkr_src(struct omap_mcbsp *mcbsp, u8 mux)
+int omap_mcbsp_6pin_src_mux(struct omap_mcbsp *mcbsp, u8 mux)
{
- const char *src;
-
- if (mcbsp->id != 1)
- return;
+ const char *signal, *src;
+ int ret = 0;
- if (mux == CLKR_SRC_CLKR)
+ switch (mux) {
+ case CLKR_SRC_CLKR:
+ signal = "clkr";
src = "clkr";
- else if (mux == CLKR_SRC_CLKX)
+ break;
+ case CLKR_SRC_CLKX:
+ signal = "clkr";
src = "clkx";
- else
- return;
-
- if (mcbsp->pdata->mux_signal)
- mcbsp->pdata->mux_signal(mcbsp->dev, "clkr", src);
-}
-
-void omap2_mcbsp1_mux_fsr_src(struct omap_mcbsp *mcbsp, u8 mux)
-{
- const char *src;
-
- if (mcbsp->id != 1)
- return;
-
- if (mux == FSR_SRC_FSR)
+ break;
+ case FSR_SRC_FSR:
+ signal = "fsr";
src = "fsr";
- else if (mux == FSR_SRC_FSX)
+ break;
+ case FSR_SRC_FSX:
+ signal = "fsr";
src = "fsx";
- else
- return;
+ break;
+ default:
+ return -EINVAL;
+ }
if (mcbsp->pdata->mux_signal)
- mcbsp->pdata->mux_signal(mcbsp->dev, "fsr", src);
+ ret = mcbsp->pdata->mux_signal(mcbsp->dev, signal, src);
+
+ return ret;
}
#define max_thres(m) (mcbsp->pdata->buffer_size)