ARM: OMAP: mcbsp: Move sidetone clock management to mach-omap2/mcbsp.c
Active sidetone requires that McBSP interface clock doesn't idle and there is no mechanism in hwmod to turn autoidling on/off in runtime. McBSP2 and 3 in OMAP34xx share their interface clock with McBSP sidetone module and that interface clock must be active when the sidetone is operating. Sidetone has its own autoidle bit which should keep the interface clock active but it is broken. Putting the McBSP core to no-idle mode when the sidetone is active is no good either since it results to higher power consumption when using the threshold based DMA transfers. For making the McBSP code more generic, move this sidetone clock management with fixme comments to mach-omap2/mcbsp.c and pass pointer to it via platform data. Signed-off-by: Jarkko Nikula <jhnikula@gmail.com> Cc: Paul Wamsley <paul@pwsan.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
ac6747ca0d
commit
1743d14fb6
@@ -26,10 +26,6 @@
|
||||
#include <plat/mcbsp.h>
|
||||
#include <linux/pm_runtime.h>
|
||||
|
||||
/* XXX These "sideways" includes are a sign that something is wrong */
|
||||
#include "../mach-omap2/cm2xxx_3xxx.h"
|
||||
#include "../mach-omap2/cm-regbits-34xx.h"
|
||||
|
||||
struct omap_mcbsp **mcbsp_ptr;
|
||||
int omap_mcbsp_count;
|
||||
|
||||
@@ -257,13 +253,8 @@ static void omap_st_on(struct omap_mcbsp *mcbsp)
|
||||
{
|
||||
unsigned int w;
|
||||
|
||||
/*
|
||||
* Sidetone uses McBSP ICLK - which must not idle when sidetones
|
||||
* are enabled or sidetones start sounding ugly.
|
||||
*/
|
||||
w = omap2_cm_read_mod_reg(OMAP3430_PER_MOD, CM_AUTOIDLE);
|
||||
w &= ~(1 << (mcbsp->id - 2));
|
||||
omap2_cm_write_mod_reg(w, OMAP3430_PER_MOD, CM_AUTOIDLE);
|
||||
if (mcbsp->pdata->enable_st_clock)
|
||||
mcbsp->pdata->enable_st_clock(mcbsp->id, 1);
|
||||
|
||||
/* Enable McBSP Sidetone */
|
||||
w = MCBSP_READ(mcbsp, SSELCR);
|
||||
@@ -284,9 +275,8 @@ static void omap_st_off(struct omap_mcbsp *mcbsp)
|
||||
w = MCBSP_READ(mcbsp, SSELCR);
|
||||
MCBSP_WRITE(mcbsp, SSELCR, w & ~(SIDETONEEN));
|
||||
|
||||
w = omap2_cm_read_mod_reg(OMAP3430_PER_MOD, CM_AUTOIDLE);
|
||||
w |= 1 << (mcbsp->id - 2);
|
||||
omap2_cm_write_mod_reg(w, OMAP3430_PER_MOD, CM_AUTOIDLE);
|
||||
if (mcbsp->pdata->enable_st_clock)
|
||||
mcbsp->pdata->enable_st_clock(mcbsp->id, 0);
|
||||
}
|
||||
|
||||
static void omap_st_fir_write(struct omap_mcbsp *mcbsp, s16 *fir)
|
||||
|
Reference in New Issue
Block a user