aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/plat-omap
diff options
context:
space:
mode:
authorJarkko Nikula <jhnikula@gmail.com>2011-09-26 03:45:44 -0400
committerTony Lindgren <tony@atomide.com>2011-09-26 20:48:27 -0400
commit1743d14fb6b428e52a9a0917d11d6eba9a110002 (patch)
tree88bdb1d289fff1da1dc6f1d4a76a971fa0db53c4 /arch/arm/plat-omap
parentac6747ca0d2e01ed55281d1cc95b5dc646735a20 (diff)
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>
Diffstat (limited to 'arch/arm/plat-omap')
-rw-r--r--arch/arm/plat-omap/include/plat/mcbsp.h1
-rw-r--r--arch/arm/plat-omap/mcbsp.c18
2 files changed, 5 insertions, 14 deletions
diff --git a/arch/arm/plat-omap/include/plat/mcbsp.h b/arch/arm/plat-omap/include/plat/mcbsp.h
index 648344a89a94..e451a6e8b065 100644
--- a/arch/arm/plat-omap/include/plat/mcbsp.h
+++ b/arch/arm/plat-omap/include/plat/mcbsp.h
@@ -321,6 +321,7 @@ struct omap_mcbsp_platform_data {
321 /* McBSP platform and instance specific features */ 321 /* McBSP platform and instance specific features */
322 bool has_wakeup; /* Wakeup capability */ 322 bool has_wakeup; /* Wakeup capability */
323 bool has_ccr; /* Transceiver has configuration control registers */ 323 bool has_ccr; /* Transceiver has configuration control registers */
324 int (*enable_st_clock)(unsigned int, bool);
324}; 325};
325 326
326struct omap_mcbsp_st_data { 327struct omap_mcbsp_st_data {
diff --git a/arch/arm/plat-omap/mcbsp.c b/arch/arm/plat-omap/mcbsp.c
index 3ad536ea6c37..e96d747fbd80 100644
--- a/arch/arm/plat-omap/mcbsp.c
+++ b/arch/arm/plat-omap/mcbsp.c
@@ -26,10 +26,6 @@
26#include <plat/mcbsp.h> 26#include <plat/mcbsp.h>
27#include <linux/pm_runtime.h> 27#include <linux/pm_runtime.h>
28 28
29/* XXX These "sideways" includes are a sign that something is wrong */
30#include "../mach-omap2/cm2xxx_3xxx.h"
31#include "../mach-omap2/cm-regbits-34xx.h"
32
33struct omap_mcbsp **mcbsp_ptr; 29struct omap_mcbsp **mcbsp_ptr;
34int omap_mcbsp_count; 30int omap_mcbsp_count;
35 31
@@ -257,13 +253,8 @@ static void omap_st_on(struct omap_mcbsp *mcbsp)
257{ 253{
258 unsigned int w; 254 unsigned int w;
259 255
260 /* 256 if (mcbsp->pdata->enable_st_clock)
261 * Sidetone uses McBSP ICLK - which must not idle when sidetones 257 mcbsp->pdata->enable_st_clock(mcbsp->id, 1);
262 * are enabled or sidetones start sounding ugly.
263 */
264 w = omap2_cm_read_mod_reg(OMAP3430_PER_MOD, CM_AUTOIDLE);
265 w &= ~(1 << (mcbsp->id - 2));
266 omap2_cm_write_mod_reg(w, OMAP3430_PER_MOD, CM_AUTOIDLE);
267 258
268 /* Enable McBSP Sidetone */ 259 /* Enable McBSP Sidetone */
269 w = MCBSP_READ(mcbsp, SSELCR); 260 w = MCBSP_READ(mcbsp, SSELCR);
@@ -284,9 +275,8 @@ static void omap_st_off(struct omap_mcbsp *mcbsp)
284 w = MCBSP_READ(mcbsp, SSELCR); 275 w = MCBSP_READ(mcbsp, SSELCR);
285 MCBSP_WRITE(mcbsp, SSELCR, w & ~(SIDETONEEN)); 276 MCBSP_WRITE(mcbsp, SSELCR, w & ~(SIDETONEEN));
286 277
287 w = omap2_cm_read_mod_reg(OMAP3430_PER_MOD, CM_AUTOIDLE); 278 if (mcbsp->pdata->enable_st_clock)
288 w |= 1 << (mcbsp->id - 2); 279 mcbsp->pdata->enable_st_clock(mcbsp->id, 0);
289 omap2_cm_write_mod_reg(w, OMAP3430_PER_MOD, CM_AUTOIDLE);
290} 280}
291 281
292static void omap_st_fir_write(struct omap_mcbsp *mcbsp, s16 *fir) 282static void omap_st_fir_write(struct omap_mcbsp *mcbsp, s16 *fir)