From: Jarkko Nikula <jhnikula@gmail.com>
To: Jane Wang <jwang@ti.com>
Cc: alsa-devel@alsa-project.org, linux-omap@vger.kernel.org,
peter.ujfalusi@nokia.com, broonie@opensource.wolfsonmicro.com
Subject: Re: [PATCH 1/2] OMAP3: MCBSP: Suspend/resume failure fix
Date: Sat, 14 Nov 2009 10:20:24 +0200 [thread overview]
Message-ID: <20091114102024.b5c302bb.jhnikula@gmail.com> (raw)
In-Reply-To: <1258133987-20488-1-git-send-email-jwang@ti.com>
Hi
On Fri, 13 Nov 2009 11:39:47 -0600
Jane Wang <jwang@ti.com> wrote:
> McBSP fucntional clock is not disabled when suspend is triggerd which
> prevents PER domain entering target low-power state. To fix the problem:
>
> 1. Disable/enable McBSP functional clock for suspend/resume.
>
> 2. In addition, reconfigure McBSP, this is needed when systerm comes out of OFF state.
>
...
> --- a/arch/arm/plat-omap/include/mach/mcbsp.h
> +++ b/arch/arm/plat-omap/include/mach/mcbsp.h
> @@ -440,6 +440,8 @@ static inline int omap_mcbsp_get_dma_op_mode(unsigned int id) { return 0; }
> #endif
> int omap_mcbsp_request(unsigned int id);
> void omap_mcbsp_free(unsigned int id);
> +void omap_mcbsp_disable_fclk(unsigned int id);
> +void omap_mcbsp_enable_fclk(unsigned int id);
...
> --- a/sound/soc/omap/omap-mcbsp.c
> +++ b/sound/soc/omap/omap-mcbsp.c
> @@ -229,18 +229,28 @@ static int omap_mcbsp_dai_trigger(struct snd_pcm_substream *substream, int cmd,
>
> switch (cmd) {
> case SNDRV_PCM_TRIGGER_START:
> - case SNDRV_PCM_TRIGGER_RESUME:
> case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
> mcbsp_data->active++;
> omap_mcbsp_start(mcbsp_data->bus_id, play, !play);
> break;
> + case SNDRV_PCM_TRIGGER_RESUME:
> + mcbsp_data->active++;
> + omap_mcbsp_enable_fclk(mcbsp_data->bus_id);
> + omap_mcbsp_config(mcbsp_data->bus_id,
> + &mcbsp_data->regs);
> + omap_mcbsp_start(mcbsp_data->bus_id, play, !play);
> + break;
>
For me this looks more like a simple workaround for the audio case than
comprehensive implementation to McBSP OFF mode context save/restore. My
thoughts:
1. McBSP clock management partially moved out of low-level driver
2. McBSP client must do the context restore
I do know that arch/arm/plat-omap/mcbsp.c enables the clocks in
omap_mcbsp_request, I don't know do some API or feature there really
require clocks (or McBSP itself) to be active just after the request
time but I would look that path instead (even it is more complicated).
If no API or feature would require active McBSP block before the
omap_mcbsp_start call, then the clock management could be done inside
the omap_mcbsp_start/-stop functions.
Also context save/restore operations belongs more to PM callbacks
of .../plat-omap/mcbsp.c. Or probably that can be done also dynamically
inside the omap_mcbsp_start/-stop for keeping the whole McBSP shutdown
whenever it is idle.
I think it's worth to look McBSP register cache concept [1] from Janusz
Krzysztofik would it help all of this context save/restore operations.
--
Jarkko
1. http://www.spinics.net/lists/linux-omap/msg16720.html
next prev parent reply other threads:[~2009-11-14 8:20 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-13 17:39 [PATCH 1/2] OMAP3: MCBSP: Suspend/resume failure fix Jane Wang
2009-11-13 17:49 ` Mark Brown
2009-11-13 17:52 ` Wang, Jane
2009-11-13 18:10 ` [alsa-devel] " Mark Brown
2009-11-14 8:20 ` Jarkko Nikula [this message]
2009-11-18 18:28 ` Aggarwal, Anuj
2009-11-18 18:49 ` Wang, Jane
2009-11-19 7:34 ` Jarkko Nikula
2009-11-19 19:48 ` Anuj Aggarwal
2009-11-20 7:51 ` Peter Ujfalusi
2009-11-20 13:53 ` Jarkko Nikula
2009-11-20 14:09 ` Eero Nurkkala
2009-11-20 14:47 ` [alsa-devel] " Anuj Aggarwal
2009-11-30 11:50 ` Aggarwal, Anuj
2009-12-24 13:16 ` Aggarwal, Anuj
2009-12-28 6:10 ` Aggarwal, Anuj
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=20091114102024.b5c302bb.jhnikula@gmail.com \
--to=jhnikula@gmail.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=jwang@ti.com \
--cc=linux-omap@vger.kernel.org \
--cc=peter.ujfalusi@nokia.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.