All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ricardo Neri <ricardo.neri@ti.com>
To: Peter Ujfalusi <peter.ujfalusi@ti.com>,
	Benoit Cousson <b-cousson@ti.com>
Cc: alsa-devel@alsa-project.org, Tony Lindgren <tony@atomide.com>,
	devicetree-discuss@lists.ozlabs.org,
	Mark Brown <broonie@opensource.wolfsonmicro.com>,
	linux-arm-kernel@lists.infradead.org, linux-omap@vger.kernel.org,
	Liam Girdwood <lrg@ti.com>,
	Jarkko Nikula <jarkko.nikula@bitmer.com>
Subject: Re: [PATCH 07/11] ASoC: omap-mcbsp: Sidetone: Use SIDLE bits in SYSCONFIG register to select noidle mode
Date: Wed, 8 Aug 2012 17:12:58 -0500	[thread overview]
Message-ID: <5022E46A.4010909@ti.com> (raw)
In-Reply-To: <1344417101-5015-8-git-send-email-peter.ujfalusi@ti.com>

On 08/08/2012 04:11 AM, Peter Ujfalusi wrote:
> Instead of the callback (which modifies control module register) use the
> McBSP module's SYSCONFIG register to disable smart-idle mode when the
> sidetone is enabled.
> Store the original SIDLEMODE configuration and restore it when the sidetone
> has been disabled.

Is this another case in which it is required to change the idle-mode on 
a per-use-case basis? In the past I was trying to do the same with HDMI 
[1]. In that case it was decided to add the HWMOD_SWSUP_SIDLE to hwmod 
data with the drawback of using no-idle/force-idle rather than 
smart-idle[2][3].

[1] http://www.mail-archive.com/linux-omap@vger.kernel.org/msg60226.html
[2] http://www.mail-archive.com/linux-omap@vger.kernel.org/msg70463.html
[3] http://www.mail-archive.com/linux-omap@vger.kernel.org/msg70653.html
>
> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
> ---
>   sound/soc/omap/mcbsp.c |   18 ++++++++++++++----
>   sound/soc/omap/mcbsp.h |    1 +
>   2 files changed, 15 insertions(+), 4 deletions(-)
>
> diff --git a/sound/soc/omap/mcbsp.c b/sound/soc/omap/mcbsp.c
> index c870023..e008898 100644
> --- a/sound/soc/omap/mcbsp.c
> +++ b/sound/soc/omap/mcbsp.c
> @@ -257,8 +257,15 @@ static void omap_st_on(struct omap_mcbsp *mcbsp)
>   {
>   	unsigned int w;
>
> -	if (mcbsp->pdata->enable_st_clock)
> -		mcbsp->pdata->enable_st_clock(mcbsp->id, 1);
> +	/*
> +	 * Sidetone uses McBSP ICLK - which must not idle when sidetones
> +	 * are enabled or sidetones start sounding ugly.
> +	 */
> +	w = MCBSP_READ(mcbsp, SYSCON);
> +	mcbsp->st_data->mcbsp_sidle = (w >> 3) & 0x3;
> +	w &= ~SIDLEMODE(0x3);
> +	w |= SIDLEMODE(0x1);
> +	MCBSP_WRITE(mcbsp, SYSCON, w);

Wouldn't this create a mismatch between the SYSCONFIG register and McBSP 
omap_hwmod._sysc_cache? Perhaps this could be done with a future 
omap_hwmod API?

Ricardo
>
>   	/* Enable McBSP Sidetone */
>   	w = MCBSP_READ(mcbsp, SSELCR);
> @@ -279,8 +286,11 @@ static void omap_st_off(struct omap_mcbsp *mcbsp)
>   	w = MCBSP_READ(mcbsp, SSELCR);
>   	MCBSP_WRITE(mcbsp, SSELCR, w & ~(SIDETONEEN));
>
> -	if (mcbsp->pdata->enable_st_clock)
> -		mcbsp->pdata->enable_st_clock(mcbsp->id, 0);
> +	/* Restore the SIDLEMODE as it was before the ST has been started */
> +	w = MCBSP_READ(mcbsp, SYSCON);
> +	w &= ~SIDLEMODE(0x3);
> +	w |= SIDLEMODE(mcbsp->st_data->mcbsp_sidle);
> +	MCBSP_WRITE(mcbsp, SYSCON, w);
>   }
>
>   static void omap_st_fir_write(struct omap_mcbsp *mcbsp, s16 *fir)
> diff --git a/sound/soc/omap/mcbsp.h b/sound/soc/omap/mcbsp.h
> index 49a6725..ba82846 100644
> --- a/sound/soc/omap/mcbsp.h
> +++ b/sound/soc/omap/mcbsp.h
> @@ -280,6 +280,7 @@ struct omap_mcbsp_st_data {
>   	int nr_taps;	/* Number of filter coefficients in use */
>   	s16 ch0gain;
>   	s16 ch1gain;
> +	unsigned int mcbsp_sidle;
>   };
>
>   struct omap_mcbsp {
>

WARNING: multiple messages have this Message-ID (diff)
From: ricardo.neri@ti.com (Ricardo Neri)
To: linux-arm-kernel@lists.infradead.org
Subject: [alsa-devel] [PATCH 07/11] ASoC: omap-mcbsp: Sidetone: Use SIDLE bits in SYSCONFIG register to select noidle mode
Date: Wed, 8 Aug 2012 17:12:58 -0500	[thread overview]
Message-ID: <5022E46A.4010909@ti.com> (raw)
In-Reply-To: <1344417101-5015-8-git-send-email-peter.ujfalusi@ti.com>

On 08/08/2012 04:11 AM, Peter Ujfalusi wrote:
> Instead of the callback (which modifies control module register) use the
> McBSP module's SYSCONFIG register to disable smart-idle mode when the
> sidetone is enabled.
> Store the original SIDLEMODE configuration and restore it when the sidetone
> has been disabled.

Is this another case in which it is required to change the idle-mode on 
a per-use-case basis? In the past I was trying to do the same with HDMI 
[1]. In that case it was decided to add the HWMOD_SWSUP_SIDLE to hwmod 
data with the drawback of using no-idle/force-idle rather than 
smart-idle[2][3].

[1] http://www.mail-archive.com/linux-omap at vger.kernel.org/msg60226.html
[2] http://www.mail-archive.com/linux-omap at vger.kernel.org/msg70463.html
[3] http://www.mail-archive.com/linux-omap at vger.kernel.org/msg70653.html
>
> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
> ---
>   sound/soc/omap/mcbsp.c |   18 ++++++++++++++----
>   sound/soc/omap/mcbsp.h |    1 +
>   2 files changed, 15 insertions(+), 4 deletions(-)
>
> diff --git a/sound/soc/omap/mcbsp.c b/sound/soc/omap/mcbsp.c
> index c870023..e008898 100644
> --- a/sound/soc/omap/mcbsp.c
> +++ b/sound/soc/omap/mcbsp.c
> @@ -257,8 +257,15 @@ static void omap_st_on(struct omap_mcbsp *mcbsp)
>   {
>   	unsigned int w;
>
> -	if (mcbsp->pdata->enable_st_clock)
> -		mcbsp->pdata->enable_st_clock(mcbsp->id, 1);
> +	/*
> +	 * Sidetone uses McBSP ICLK - which must not idle when sidetones
> +	 * are enabled or sidetones start sounding ugly.
> +	 */
> +	w = MCBSP_READ(mcbsp, SYSCON);
> +	mcbsp->st_data->mcbsp_sidle = (w >> 3) & 0x3;
> +	w &= ~SIDLEMODE(0x3);
> +	w |= SIDLEMODE(0x1);
> +	MCBSP_WRITE(mcbsp, SYSCON, w);

Wouldn't this create a mismatch between the SYSCONFIG register and McBSP 
omap_hwmod._sysc_cache? Perhaps this could be done with a future 
omap_hwmod API?

Ricardo
>
>   	/* Enable McBSP Sidetone */
>   	w = MCBSP_READ(mcbsp, SSELCR);
> @@ -279,8 +286,11 @@ static void omap_st_off(struct omap_mcbsp *mcbsp)
>   	w = MCBSP_READ(mcbsp, SSELCR);
>   	MCBSP_WRITE(mcbsp, SSELCR, w & ~(SIDETONEEN));
>
> -	if (mcbsp->pdata->enable_st_clock)
> -		mcbsp->pdata->enable_st_clock(mcbsp->id, 0);
> +	/* Restore the SIDLEMODE as it was before the ST has been started */
> +	w = MCBSP_READ(mcbsp, SYSCON);
> +	w &= ~SIDLEMODE(0x3);
> +	w |= SIDLEMODE(mcbsp->st_data->mcbsp_sidle);
> +	MCBSP_WRITE(mcbsp, SYSCON, w);
>   }
>
>   static void omap_st_fir_write(struct omap_mcbsp *mcbsp, s16 *fir)
> diff --git a/sound/soc/omap/mcbsp.h b/sound/soc/omap/mcbsp.h
> index 49a6725..ba82846 100644
> --- a/sound/soc/omap/mcbsp.h
> +++ b/sound/soc/omap/mcbsp.h
> @@ -280,6 +280,7 @@ struct omap_mcbsp_st_data {
>   	int nr_taps;	/* Number of filter coefficients in use */
>   	s16 ch0gain;
>   	s16 ch1gain;
> +	unsigned int mcbsp_sidle;
>   };
>
>   struct omap_mcbsp {
>

  reply	other threads:[~2012-08-08 21:44 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-08  9:11 [PATCH 00/11] ARM/ASoC: OMAP McBSP device tree support Peter Ujfalusi
2012-08-08  9:11 ` Peter Ujfalusi
2012-08-08  9:11 ` [PATCH 01/11] ARM/ASoC: omap-mcbsp: Move OMAP2+ clock parenting code to ASoC driver Peter Ujfalusi
2012-08-08  9:11   ` Peter Ujfalusi
2012-08-08  9:11 ` [PATCH 02/11] ARM: OMAP2+: McBSP: Do not create legacy devices when booting with DT data Peter Ujfalusi
2012-08-08  9:11   ` Peter Ujfalusi
2012-08-08  9:11 ` [PATCH 03/11] ARM: OMAP: mcbsp: Enable FIFO use for OMAP2430 Peter Ujfalusi
2012-08-08  9:11   ` Peter Ujfalusi
2012-08-08  9:11 ` [PATCH 04/11] ARM: OMAP: board-am3517evm: Configure McBSP1 CLKR/FSR signal source Peter Ujfalusi
2012-08-08  9:11   ` Peter Ujfalusi
2012-08-08  9:11 ` [PATCH 05/11] ASoC: am3517evm: Do not configure McBSP1 CLKR/FSR signal muxing Peter Ujfalusi
2012-08-08  9:11   ` Peter Ujfalusi
2012-08-08  9:11 ` [PATCH 06/11] ARM/ASoC: omap-mcbsp: Remove CLKR/FSR mux configuration code Peter Ujfalusi
2012-08-08  9:11   ` Peter Ujfalusi
2012-08-08  9:11 ` [PATCH 07/11] ASoC: omap-mcbsp: Sidetone: Use SIDLE bits in SYSCONFIG register to select noidle mode Peter Ujfalusi
2012-08-08  9:11   ` Peter Ujfalusi
2012-08-08 22:12   ` Ricardo Neri [this message]
2012-08-08 22:12     ` [alsa-devel] " Ricardo Neri
2012-08-09  7:05     ` Peter Ujfalusi
2012-08-09  7:05       ` Peter Ujfalusi
2012-08-09 15:15       ` Ricardo Neri
2012-08-09 15:15         ` [alsa-devel] " Ricardo Neri
2012-08-08  9:11 ` [PATCH 08/11] ARM: OMAP3: Remove callback for McBSP sidetone ICLK workaround Peter Ujfalusi
2012-08-08  9:11   ` Peter Ujfalusi
2012-08-08 13:25   ` Jarkko Nikula
2012-08-08 13:25     ` Jarkko Nikula
2012-08-08 14:00     ` Peter Ujfalusi
2012-08-08 14:00       ` [alsa-devel] " Peter Ujfalusi
2012-08-10 13:00       ` Jarkko Nikula
2012-08-10 13:00         ` [alsa-devel] " Jarkko Nikula
2012-08-10 15:39         ` Peter Ujfalusi
2012-08-10 15:39           ` [alsa-devel] " Peter Ujfalusi
2012-08-08  9:11 ` [PATCH 09/11] ASoC: omap-mcbsp: Remove unused defines Peter Ujfalusi
2012-08-08  9:11   ` Peter Ujfalusi
2012-08-08  9:11 ` [PATCH 10/11] ASoC: omap-mcbsp: Remove cpu_is_omap* checks from the code Peter Ujfalusi
2012-08-08  9:11   ` Peter Ujfalusi
2012-08-08  9:11 ` [PATCH 11/11] ASoC: omap-mcbsp: Add device tree bindings Peter Ujfalusi
2012-08-08  9:11   ` Peter Ujfalusi
2012-08-08 11:21 ` [PATCH 00/11] ARM/ASoC: OMAP McBSP device tree support Mark Brown
2012-08-08 11:21   ` Mark Brown
2012-08-10 13:15   ` Jarkko Nikula
2012-08-10 13:15     ` Jarkko Nikula

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5022E46A.4010909@ti.com \
    --to=ricardo.neri@ti.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=b-cousson@ti.com \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=jarkko.nikula@bitmer.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=lrg@ti.com \
    --cc=peter.ujfalusi@ti.com \
    --cc=tony@atomide.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.