Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1360508 > unrolled thread

[PATCH 3/3] ASoC: omap-mcbsp: Enable/disable sidetone block auto clock gating for omap3

Started byPeter Ujfalusi <peter.ujfalusi@ti.com>
First post2016-03-18 11:40 +0100
Last post2016-03-21 11:00 +0100
Articles 4 — 3 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 3/3] ASoC: omap-mcbsp: Enable/disable sidetone block auto clock gating for omap3 Peter Ujfalusi <peter.ujfalusi@ti.com> - 2016-03-18 11:40 +0100
    Re: [PATCH 3/3] ASoC: omap-mcbsp: Enable/disable sidetone block auto  clock gating for omap3 Paul Walmsley <paul@pwsan.com> - 2016-03-19 20:40 +0100
      Re: [PATCH 3/3] ASoC: omap-mcbsp: Enable/disable sidetone block auto  clock gating for omap3 Peter Ujfalusi <peter.ujfalusi@ti.com> - 2016-03-21 09:50 +0100
      Re: [PATCH 3/3] ASoC: omap-mcbsp: Enable/disable sidetone block auto  clock gating for omap3 Mark Brown <broonie@kernel.org> - 2016-03-21 11:00 +0100

#1360508 — [PATCH 3/3] ASoC: omap-mcbsp: Enable/disable sidetone block auto clock gating for omap3

FromPeter Ujfalusi <peter.ujfalusi@ti.com>
Date2016-03-18 11:40 +0100
Subject[PATCH 3/3] ASoC: omap-mcbsp: Enable/disable sidetone block auto clock gating for omap3
Message-ID<rdZZ0-4m6-19@gated-at.bofh.it>
OMAP3's McBSP2 and McBSP3 module have integrated sidetone block with
dedicated SYSCONFIG register. The sidetone is operating from the maain
McBSP module's ICLK. For normal operation the sidetone clock auto idle
support needs to be disabled when it is activated.
Note: This is not enough to avoid choppy sidetone because this AUTOIDLE
bit is controlling only the clock auto idle from the McBSP to the sidetone
block. If the McBSP_ICLK is idling, the sidetone clock is going to do the
same.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
---
 sound/soc/omap/mcbsp.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/sound/soc/omap/mcbsp.c b/sound/soc/omap/mcbsp.c
index c7563e230c7d..4a16e778966b 100644
--- a/sound/soc/omap/mcbsp.c
+++ b/sound/soc/omap/mcbsp.c
@@ -260,6 +260,10 @@ static void omap_st_on(struct omap_mcbsp *mcbsp)
 	if (mcbsp->pdata->enable_st_clock)
 		mcbsp->pdata->enable_st_clock(mcbsp->id, 1);
 
+	/* Disable Sidetone clock auto-gating for normal operation */
+	w = MCBSP_ST_READ(mcbsp, SYSCONFIG);
+	MCBSP_ST_WRITE(mcbsp, SYSCONFIG, w & ~(ST_AUTOIDLE));
+
 	/* Enable McBSP Sidetone */
 	w = MCBSP_READ(mcbsp, SSELCR);
 	MCBSP_WRITE(mcbsp, SSELCR, w | SIDETONEEN);
@@ -279,6 +283,10 @@ static void omap_st_off(struct omap_mcbsp *mcbsp)
 	w = MCBSP_READ(mcbsp, SSELCR);
 	MCBSP_WRITE(mcbsp, SSELCR, w & ~(SIDETONEEN));
 
+	/* Enable Sidetone clock auto-gating to reduce power consumption */
+	w = MCBSP_ST_READ(mcbsp, SYSCONFIG);
+	MCBSP_ST_WRITE(mcbsp, SYSCONFIG, w | ST_AUTOIDLE);
+
 	if (mcbsp->pdata->enable_st_clock)
 		mcbsp->pdata->enable_st_clock(mcbsp->id, 0);
 }
-- 
2.7.3

[toc] | [next] | [standalone]


#1361150 — Re: [PATCH 3/3] ASoC: omap-mcbsp: Enable/disable sidetone block auto clock gating for omap3

FromPaul Walmsley <paul@pwsan.com>
Date2016-03-19 20:40 +0100
SubjectRe: [PATCH 3/3] ASoC: omap-mcbsp: Enable/disable sidetone block auto clock gating for omap3
Message-ID<reuT8-4he-11@gated-at.bofh.it>
In reply to#1360508
On Fri, 18 Mar 2016, Peter Ujfalusi wrote:

> OMAP3's McBSP2 and McBSP3 module have integrated sidetone block with
> dedicated SYSCONFIG register. The sidetone is operating from the maain
> McBSP module's ICLK. For normal operation the sidetone clock auto idle
> support needs to be disabled when it is activated.
> Note: This is not enough to avoid choppy sidetone because this AUTOIDLE
> bit is controlling only the clock auto idle from the McBSP to the sidetone
> block. If the McBSP_ICLK is idling, the sidetone clock is going to do the
> same.
> 
> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>

Mark, please drop this patch for the time being, until the SoC integration 
issues can be sorted out first.  It's best to wait a little while before 
applying patches like these so folks have a chance to comment on their 
correctness first.

We used to handle this problem in the OMAP hwmod SoC integration layer 
with a flag that forced the interface clock to stay active as long as the 
underlying IP blocks were active.  However I can't find that flag right 
now in the current data, so maybe it got accidentally or inadvertently 
removed at some point in time in the past.  The right way to fix this 
would be to add that flag back in, rather than messing with the SoC 
integration registers from the McBSP drivers.


thanks


- Paul

[toc] | [prev] | [next] | [standalone]


#1361618 — Re: [PATCH 3/3] ASoC: omap-mcbsp: Enable/disable sidetone block auto clock gating for omap3

FromPeter Ujfalusi <peter.ujfalusi@ti.com>
Date2016-03-21 09:50 +0100
SubjectRe: [PATCH 3/3] ASoC: omap-mcbsp: Enable/disable sidetone block auto clock gating for omap3
Message-ID<rf3Hc-337-23@gated-at.bofh.it>
In reply to#1361150
Paul,

On 03/19/16 21:37, Paul Walmsley wrote:
> On Fri, 18 Mar 2016, Peter Ujfalusi wrote:
> 
>> OMAP3's McBSP2 and McBSP3 module have integrated sidetone block with
>> dedicated SYSCONFIG register. The sidetone is operating from the maain
>> McBSP module's ICLK. For normal operation the sidetone clock auto idle
>> support needs to be disabled when it is activated.
>> Note: This is not enough to avoid choppy sidetone because this AUTOIDLE
>> bit is controlling only the clock auto idle from the McBSP to the sidetone
>> block. If the McBSP_ICLK is idling, the sidetone clock is going to do the
>> same.
>>
>> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
> 
> Mark, please drop this patch for the time being, until the SoC integration 
> issues can be sorted out first.  It's best to wait a little while before 
> applying patches like these so folks have a chance to comment on their 
> correctness first.
> 
> We used to handle this problem in the OMAP hwmod SoC integration layer 
> with a flag that forced the interface clock to stay active as long as the 
> underlying IP blocks were active.  However I can't find that flag right 
> now in the current data, so maybe it got accidentally or inadvertently 
> removed at some point in time in the past.  The right way to fix this 
> would be to add that flag back in, rather than messing with the SoC 
> integration registers from the McBSP drivers.

I can not recall such a flag. We had both hwmods attached to the given McBSP
mkodule via dev_attr and we dealt with the McBSP_ICLK autoidle enable/disable
via callbacks provided to the driver via platform data.
arch/arm/mach-omap2/mcbsp.c: omap3_enable_st_clock() In there we use
omap2_clk_deny_idle()/omap2_clk_allow_idle() to make sure that the ICLK is not
gated when the ST is enabled in the given McBSP module.
But this only works when we boot in legacy mode. The DT boot is broken in this
regards as long we have first booted OMAP3 with DT.

-- 
Péter

[toc] | [prev] | [next] | [standalone]


#1361651 — Re: [PATCH 3/3] ASoC: omap-mcbsp: Enable/disable sidetone block auto clock gating for omap3

FromMark Brown <broonie@kernel.org>
Date2016-03-21 11:00 +0100
SubjectRe: [PATCH 3/3] ASoC: omap-mcbsp: Enable/disable sidetone block auto clock gating for omap3
Message-ID<rf4MW-3JE-11@gated-at.bofh.it>
In reply to#1361150

[Multipart message — attachments visible in raw view] — view raw

On Sat, Mar 19, 2016 at 07:37:33PM +0000, Paul Walmsley wrote:

> Mark, please drop this patch for the time being, until the SoC integration 
> issues can be sorted out first.  It's best to wait a little while before 
> applying patches like these so folks have a chance to comment on their 
> correctness first.

Nobody except Peter and Jarkko ever shows any interest in the OMAP code
- the amount of time I wait for review depends on who's sending the
patches and if I expect anyone else is going to respond.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web