ARM: OMAP: mcbsp: Start generalize signal muxing functions
This generalizes the omap2_mcbsp1_mux_clkr_src and omap2_mcbsp1_mux_fsr_src implementation between generic McBSP and OMAP2 specific McBSP code. These functions are used to select source for CLKR and FSR signals on OMAP2+. Start generalizing the code by implementing an optional mux_signal function pointer in platform data that will implement the actual muxing and which is called now from omap2_mcbsp1_mux_clkr_src and omap2_mcbsp1_mux_fsr_src. These functions are to be removed later and cleanup the API so that mux_signal gets its arguments directly from client code. Signed-off-by: Jarkko Nikula <jarkko.nikula@bitmer.com> Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Tested-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl> Signed-off-by: Tony Lindgren <tony@atomide.com>
This commit is contained in:
committed by
Tony Lindgren
parent
09d28d2c19
commit
7bc0c4bac7
@ -922,21 +922,41 @@ int omap2_mcbsp_set_clks_src(u8 id, u8 fck_src_id)
|
||||
}
|
||||
EXPORT_SYMBOL(omap2_mcbsp_set_clks_src);
|
||||
|
||||
#ifndef CONFIG_ARCH_OMAP2PLUS
|
||||
void omap2_mcbsp1_mux_clkr_src(u8 mux)
|
||||
{
|
||||
WARN(1, "%s: should never be called on an OMAP1-only kernel\n",
|
||||
__func__);
|
||||
return;
|
||||
struct omap_mcbsp *mcbsp;
|
||||
const char *src;
|
||||
|
||||
if (mux == CLKR_SRC_CLKR)
|
||||
src = "clkr";
|
||||
else if (mux == CLKR_SRC_CLKX)
|
||||
src = "clkx";
|
||||
else
|
||||
return;
|
||||
|
||||
mcbsp = id_to_mcbsp_ptr(0);
|
||||
if (mcbsp->pdata->mux_signal)
|
||||
mcbsp->pdata->mux_signal(mcbsp->dev, "clkr", src);
|
||||
}
|
||||
EXPORT_SYMBOL(omap2_mcbsp1_mux_clkr_src);
|
||||
|
||||
void omap2_mcbsp1_mux_fsr_src(u8 mux)
|
||||
{
|
||||
WARN(1, "%s: should never be called on an OMAP1-only kernel\n",
|
||||
__func__);
|
||||
return;
|
||||
struct omap_mcbsp *mcbsp;
|
||||
const char *src;
|
||||
|
||||
if (mux == FSR_SRC_FSR)
|
||||
src = "fsr";
|
||||
else if (mux == FSR_SRC_FSX)
|
||||
src = "fsx";
|
||||
else
|
||||
return;
|
||||
|
||||
mcbsp = id_to_mcbsp_ptr(0);
|
||||
if (mcbsp->pdata->mux_signal)
|
||||
mcbsp->pdata->mux_signal(mcbsp->dev, "fsr", src);
|
||||
}
|
||||
#endif
|
||||
EXPORT_SYMBOL(omap2_mcbsp1_mux_fsr_src);
|
||||
|
||||
#define max_thres(m) (mcbsp->pdata->buffer_size)
|
||||
#define valid_threshold(m, val) ((val) <= max_thres(m))
|
||||
|
Reference in New Issue
Block a user