* [PATCH] ASoC: omap-mcbsp: When closing the port select PRCM source for CLKS signal
@ 2012-03-05 9:38 Peter Ujfalusi
2012-03-05 11:58 ` Mark Brown
` (2 more replies)
0 siblings, 3 replies; 10+ messages in thread
From: Peter Ujfalusi @ 2012-03-05 9:38 UTC (permalink / raw)
To: Liam Girdwood, Mark Brown; +Cc: alsa-devel, Grazvydas Ignotas, Jarkko Nikula
If external source for the CLKS signal selection kept after the port is no
longer in use the system might refuse to go suspend.
There is also a chance that the external clock is not running when next
time the McBSP port is started which can result errors when we try to
access McBSP registers.
Reset the CLKS source back to PRCM source unconditionally.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
---
sound/soc/omap/mcbsp.c | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/sound/soc/omap/mcbsp.c b/sound/soc/omap/mcbsp.c
index d716793..21dbb05 100644
--- a/sound/soc/omap/mcbsp.c
+++ b/sound/soc/omap/mcbsp.c
@@ -548,6 +548,16 @@ void omap_mcbsp_free(struct omap_mcbsp *mcbsp)
reg_cache = mcbsp->reg_cache;
+ /*
+ * Select CLKS source from internal source unconditionally before
+ * marking the McBSP port as free.
+ * If the external clock source via MCBSP_CLKS pin has been selected the
+ * system will refuse to enter idle if the CLKS pin source is not reset
+ * back to internal source.
+ */
+ if (!cpu_class_is_omap1())
+ omap2_mcbsp_set_clks_src(mcbsp, MCBSP_CLKS_PRCM_SRC);
+
spin_lock(&mcbsp->lock);
if (mcbsp->free)
dev_err(mcbsp->dev, "McBSP%d was not reserved\n", mcbsp->id);
--
1.7.8.5
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH] ASoC: omap-mcbsp: When closing the port select PRCM source for CLKS signal
2012-03-05 9:38 [PATCH] ASoC: omap-mcbsp: When closing the port select PRCM source for CLKS signal Peter Ujfalusi
@ 2012-03-05 11:58 ` Mark Brown
2012-03-05 12:33 ` Peter Ujfalusi
2012-03-05 12:51 ` Grazvydas Ignotas
2012-03-08 22:48 ` Grazvydas Ignotas
2 siblings, 1 reply; 10+ messages in thread
From: Mark Brown @ 2012-03-05 11:58 UTC (permalink / raw)
To: Peter Ujfalusi
Cc: alsa-devel, Liam Girdwood, Jarkko Nikula, Grazvydas Ignotas
[-- Attachment #1.1: Type: text/plain, Size: 641 bytes --]
On Mon, Mar 05, 2012 at 11:38:52AM +0200, Peter Ujfalusi wrote:
> If external source for the CLKS signal selection kept after the port is no
> longer in use the system might refuse to go suspend.
> There is also a chance that the external clock is not running when next
> time the McBSP port is started which can result errors when we try to
> access McBSP registers.
> Reset the CLKS source back to PRCM source unconditionally.
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
though it'd be better if the driver could remember and restore the
setting when the device becomes active again so that machine drivers
don't need to.
[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
[-- Attachment #2: Type: text/plain, Size: 0 bytes --]
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] ASoC: omap-mcbsp: When closing the port select PRCM source for CLKS signal
2012-03-05 11:58 ` Mark Brown
@ 2012-03-05 12:33 ` Peter Ujfalusi
0 siblings, 0 replies; 10+ messages in thread
From: Peter Ujfalusi @ 2012-03-05 12:33 UTC (permalink / raw)
To: Mark Brown; +Cc: alsa-devel, Liam Girdwood, Jarkko Nikula, Grazvydas Ignotas
On 03/05/2012 01:58 PM, Mark Brown wrote:
> though it'd be better if the driver could remember and restore the
> setting when the device becomes active again so that machine drivers
> don't need to.
Yes, this is my long term plan regarding to the clock selection.
With this patch the omap3pandora can suspend after audio activity.
--
Péter
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] ASoC: omap-mcbsp: When closing the port select PRCM source for CLKS signal
2012-03-05 9:38 [PATCH] ASoC: omap-mcbsp: When closing the port select PRCM source for CLKS signal Peter Ujfalusi
2012-03-05 11:58 ` Mark Brown
@ 2012-03-05 12:51 ` Grazvydas Ignotas
2012-03-05 13:02 ` Peter Ujfalusi
2012-03-06 12:54 ` Peter Ujfalusi
2012-03-08 22:48 ` Grazvydas Ignotas
2 siblings, 2 replies; 10+ messages in thread
From: Grazvydas Ignotas @ 2012-03-05 12:51 UTC (permalink / raw)
To: Peter Ujfalusi; +Cc: alsa-devel, Mark Brown, Liam Girdwood, Jarkko Nikula
On Mon, Mar 5, 2012 at 11:38 AM, Peter Ujfalusi <peter.ujfalusi@ti.com> wrote:
> If external source for the CLKS signal selection kept after the port is no
> longer in use the system might refuse to go suspend.
> There is also a chance that the external clock is not running when next
> time the McBSP port is started which can result errors when we try to
> access McBSP registers.
> Reset the CLKS source back to PRCM source unconditionally.
>
> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
I guess this depends on mcbsp move series?
Do we have those queued somewhere, so I don't have to collect patches
from the list?
--
Gražvydas
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] ASoC: omap-mcbsp: When closing the port select PRCM source for CLKS signal
2012-03-05 12:51 ` Grazvydas Ignotas
@ 2012-03-05 13:02 ` Peter Ujfalusi
2012-03-06 12:54 ` Peter Ujfalusi
1 sibling, 0 replies; 10+ messages in thread
From: Peter Ujfalusi @ 2012-03-05 13:02 UTC (permalink / raw)
To: Grazvydas Ignotas; +Cc: alsa-devel, Mark Brown, Liam Girdwood, Jarkko Nikula
On 03/05/2012 02:51 PM, Grazvydas Ignotas wrote:
> I guess this depends on mcbsp move series?
Yes.
> Do we have those queued somewhere, so I don't have to collect patches
> from the list?
It is not queued as of now since it has dependency on some other
patches. I expect it will be in Liam's for-3.4 in a coming days.
--
Péter
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] ASoC: omap-mcbsp: When closing the port select PRCM source for CLKS signal
2012-03-05 12:51 ` Grazvydas Ignotas
2012-03-05 13:02 ` Peter Ujfalusi
@ 2012-03-06 12:54 ` Peter Ujfalusi
2012-03-06 14:44 ` Liam Girdwood
1 sibling, 1 reply; 10+ messages in thread
From: Peter Ujfalusi @ 2012-03-06 12:54 UTC (permalink / raw)
To: Grazvydas Ignotas; +Cc: alsa-devel, Mark Brown, Liam Girdwood, Jarkko Nikula
Hi,
On 03/05/2012 02:51 PM, Grazvydas Ignotas wrote:
> I guess this depends on mcbsp move series?
> Do we have those queued somewhere, so I don't have to collect patches
> from the list?
You can apply this patch on top of my for-3.4 branch which I have just
updated on top of Liam's for-3.4 branch:
git@gitorious.org:omap-audio/linux-audio.git peter/topic/for-3.4
--
Péter
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] ASoC: omap-mcbsp: When closing the port select PRCM source for CLKS signal
2012-03-06 12:54 ` Peter Ujfalusi
@ 2012-03-06 14:44 ` Liam Girdwood
2012-03-08 14:00 ` Grazvydas Ignotas
0 siblings, 1 reply; 10+ messages in thread
From: Liam Girdwood @ 2012-03-06 14:44 UTC (permalink / raw)
To: Peter Ujfalusi; +Cc: alsa-devel, Brown, Grazvydas Ignotas, Jarkko Nikula, Mark
On Tue, 2012-03-06 at 14:54 +0200, Peter Ujfalusi wrote:
> Hi,
>
> On 03/05/2012 02:51 PM, Grazvydas Ignotas wrote:
> > I guess this depends on mcbsp move series?
> > Do we have those queued somewhere, so I don't have to collect patches
> > from the list?
>
> You can apply this patch on top of my for-3.4 branch which I have just
> updated on top of Liam's for-3.4 branch:
>
> git@gitorious.org:omap-audio/linux-audio.git peter/topic/for-3.4
>
I've now applied these patches on top of my for-3.4.
Regards
Liam
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] ASoC: omap-mcbsp: When closing the port select PRCM source for CLKS signal
2012-03-06 14:44 ` Liam Girdwood
@ 2012-03-08 14:00 ` Grazvydas Ignotas
2012-03-08 14:30 ` Ujfalusi, Peter
0 siblings, 1 reply; 10+ messages in thread
From: Grazvydas Ignotas @ 2012-03-08 14:00 UTC (permalink / raw)
To: Peter Ujfalusi; +Cc: alsa-devel, Mark Brown, Liam Girdwood, Jarkko Nikula
On Tue, Mar 6, 2012 at 4:44 PM, Liam Girdwood <lrg@ti.com> wrote:
> I've now applied these patches on top of my for-3.4.
I pulled these on top of today's linux-next and it doesn't build as a module:
Building modules, stage 2.
MODPOST 36 modules
ERROR: "omap_mcbsp_start" [sound/soc/omap/snd-soc-omap-mcbsp.ko] undefined!
ERROR: "omap_mcbsp_get_tx_delay"
[sound/soc/omap/snd-soc-omap-mcbsp.ko] undefined!
ERROR: "omap_st_disable" [sound/soc/omap/snd-soc-omap-mcbsp.ko] undefined!
ERROR: "omap_mcbsp_init" [sound/soc/omap/snd-soc-omap-mcbsp.ko] undefined!
ERROR: "omap_st_set_chgain" [sound/soc/omap/snd-soc-omap-mcbsp.ko] undefined!
ERROR: "omap_mcbsp_set_rx_threshold"
[sound/soc/omap/snd-soc-omap-mcbsp.ko] undefined!
ERROR: "omap_st_get_chgain" [sound/soc/omap/snd-soc-omap-mcbsp.ko] undefined!
ERROR: "omap_mcbsp_free" [sound/soc/omap/snd-soc-omap-mcbsp.ko] undefined!
ERROR: "omap2_mcbsp_set_clks_src"
[sound/soc/omap/snd-soc-omap-mcbsp.ko] undefined!
ERROR: "omap_st_is_enabled" [sound/soc/omap/snd-soc-omap-mcbsp.ko] undefined!
ERROR: "omap_mcbsp_stop" [sound/soc/omap/snd-soc-omap-mcbsp.ko] undefined!
ERROR: "omap2_mcbsp1_mux_fsr_src"
[sound/soc/omap/snd-soc-omap-mcbsp.ko] undefined!
ERROR: "omap_mcbsp_request" [sound/soc/omap/snd-soc-omap-mcbsp.ko] undefined!
ERROR: "omap2_mcbsp1_mux_clkr_src"
[sound/soc/omap/snd-soc-omap-mcbsp.ko] undefined!
ERROR: "omap_mcbsp_config" [sound/soc/omap/snd-soc-omap-mcbsp.ko] undefined!
ERROR: "omap_mcbsp_get_rx_delay"
[sound/soc/omap/snd-soc-omap-mcbsp.ko] undefined!
ERROR: "omap_mcbsp_set_tx_threshold"
[sound/soc/omap/snd-soc-omap-mcbsp.ko] undefined!
ERROR: "omap_mcbsp_sysfs_remove"
[sound/soc/omap/snd-soc-omap-mcbsp.ko] undefined!
ERROR: "omap_st_enable" [sound/soc/omap/snd-soc-omap-mcbsp.ko] undefined!
--
Gražvydas
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] ASoC: omap-mcbsp: When closing the port select PRCM source for CLKS signal
2012-03-08 14:00 ` Grazvydas Ignotas
@ 2012-03-08 14:30 ` Ujfalusi, Peter
0 siblings, 0 replies; 10+ messages in thread
From: Ujfalusi, Peter @ 2012-03-08 14:30 UTC (permalink / raw)
To: Grazvydas Ignotas; +Cc: alsa-devel, Mark Brown, Liam Girdwood, Jarkko Nikula
Hi,
On Thu, Mar 8, 2012 at 4:00 PM, Grazvydas Ignotas <notasas@gmail.com> wrote:
> On Tue, Mar 6, 2012 at 4:44 PM, Liam Girdwood <lrg@ti.com> wrote:
>> I've now applied these patches on top of my for-3.4.
>
> I pulled these on top of today's linux-next and it doesn't build as a module:
Opps. I have not tried it as a module...
There seams to be an issue with the Kconfig/Makefile change.
Thanks for reporting it, I'll fix it.
--
Péter
>
> Building modules, stage 2.
> MODPOST 36 modules
> ERROR: "omap_mcbsp_start" [sound/soc/omap/snd-soc-omap-mcbsp.ko] undefined!
> ERROR: "omap_mcbsp_get_tx_delay"
> [sound/soc/omap/snd-soc-omap-mcbsp.ko] undefined!
> ERROR: "omap_st_disable" [sound/soc/omap/snd-soc-omap-mcbsp.ko] undefined!
> ERROR: "omap_mcbsp_init" [sound/soc/omap/snd-soc-omap-mcbsp.ko] undefined!
> ERROR: "omap_st_set_chgain" [sound/soc/omap/snd-soc-omap-mcbsp.ko] undefined!
> ERROR: "omap_mcbsp_set_rx_threshold"
> [sound/soc/omap/snd-soc-omap-mcbsp.ko] undefined!
> ERROR: "omap_st_get_chgain" [sound/soc/omap/snd-soc-omap-mcbsp.ko] undefined!
> ERROR: "omap_mcbsp_free" [sound/soc/omap/snd-soc-omap-mcbsp.ko] undefined!
> ERROR: "omap2_mcbsp_set_clks_src"
> [sound/soc/omap/snd-soc-omap-mcbsp.ko] undefined!
> ERROR: "omap_st_is_enabled" [sound/soc/omap/snd-soc-omap-mcbsp.ko] undefined!
> ERROR: "omap_mcbsp_stop" [sound/soc/omap/snd-soc-omap-mcbsp.ko] undefined!
> ERROR: "omap2_mcbsp1_mux_fsr_src"
> [sound/soc/omap/snd-soc-omap-mcbsp.ko] undefined!
> ERROR: "omap_mcbsp_request" [sound/soc/omap/snd-soc-omap-mcbsp.ko] undefined!
> ERROR: "omap2_mcbsp1_mux_clkr_src"
> [sound/soc/omap/snd-soc-omap-mcbsp.ko] undefined!
> ERROR: "omap_mcbsp_config" [sound/soc/omap/snd-soc-omap-mcbsp.ko] undefined!
> ERROR: "omap_mcbsp_get_rx_delay"
> [sound/soc/omap/snd-soc-omap-mcbsp.ko] undefined!
> ERROR: "omap_mcbsp_set_tx_threshold"
> [sound/soc/omap/snd-soc-omap-mcbsp.ko] undefined!
> ERROR: "omap_mcbsp_sysfs_remove"
> [sound/soc/omap/snd-soc-omap-mcbsp.ko] undefined!
> ERROR: "omap_st_enable" [sound/soc/omap/snd-soc-omap-mcbsp.ko] undefined!
>
>
> --
> Gražvydas
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] ASoC: omap-mcbsp: When closing the port select PRCM source for CLKS signal
2012-03-05 9:38 [PATCH] ASoC: omap-mcbsp: When closing the port select PRCM source for CLKS signal Peter Ujfalusi
2012-03-05 11:58 ` Mark Brown
2012-03-05 12:51 ` Grazvydas Ignotas
@ 2012-03-08 22:48 ` Grazvydas Ignotas
2 siblings, 0 replies; 10+ messages in thread
From: Grazvydas Ignotas @ 2012-03-08 22:48 UTC (permalink / raw)
To: Peter Ujfalusi; +Cc: alsa-devel, Mark Brown, Liam Girdwood, Jarkko Nikula
On Mon, Mar 5, 2012 at 11:38 AM, Peter Ujfalusi <peter.ujfalusi@ti.com> wrote:
> If external source for the CLKS signal selection kept after the port is no
> longer in use the system might refuse to go suspend.
> There is also a chance that the external clock is not running when next
> time the McBSP port is started which can result errors when we try to
> access McBSP registers.
> Reset the CLKS source back to PRCM source unconditionally.
>
> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Tested-by: Grazvydas Ignotas <notasas@gmail.com>
> ---
> sound/soc/omap/mcbsp.c | 10 ++++++++++
> 1 files changed, 10 insertions(+), 0 deletions(-)
>
> diff --git a/sound/soc/omap/mcbsp.c b/sound/soc/omap/mcbsp.c
> index d716793..21dbb05 100644
> --- a/sound/soc/omap/mcbsp.c
> +++ b/sound/soc/omap/mcbsp.c
> @@ -548,6 +548,16 @@ void omap_mcbsp_free(struct omap_mcbsp *mcbsp)
>
> reg_cache = mcbsp->reg_cache;
>
> + /*
> + * Select CLKS source from internal source unconditionally before
> + * marking the McBSP port as free.
> + * If the external clock source via MCBSP_CLKS pin has been selected the
> + * system will refuse to enter idle if the CLKS pin source is not reset
> + * back to internal source.
> + */
> + if (!cpu_class_is_omap1())
> + omap2_mcbsp_set_clks_src(mcbsp, MCBSP_CLKS_PRCM_SRC);
> +
> spin_lock(&mcbsp->lock);
> if (mcbsp->free)
> dev_err(mcbsp->dev, "McBSP%d was not reserved\n", mcbsp->id);
> --
> 1.7.8.5
>
--
Gražvydas
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2012-03-08 22:49 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-05 9:38 [PATCH] ASoC: omap-mcbsp: When closing the port select PRCM source for CLKS signal Peter Ujfalusi
2012-03-05 11:58 ` Mark Brown
2012-03-05 12:33 ` Peter Ujfalusi
2012-03-05 12:51 ` Grazvydas Ignotas
2012-03-05 13:02 ` Peter Ujfalusi
2012-03-06 12:54 ` Peter Ujfalusi
2012-03-06 14:44 ` Liam Girdwood
2012-03-08 14:00 ` Grazvydas Ignotas
2012-03-08 14:30 ` Ujfalusi, Peter
2012-03-08 22:48 ` Grazvydas Ignotas
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).