* [PATCH] staging: tidspbridge: request dmtimer clocks on init
@ 2011-11-18 21:54 Omar Ramirez Luna
2011-11-18 22:16 ` Ramirez Luna, Omar
0 siblings, 1 reply; 2+ messages in thread
From: Omar Ramirez Luna @ 2011-11-18 21:54 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: Omar Ramirez Luna, devel, linux-omap
Given that dm timer framework doesn't support request of clocks
by soft | hard irqs because some recent changes, tidspbridge needs
to request its clocks on init and enable/disable them on demand.
This was first seen on 3.2-rc1.
Signed-off-by: Omar Ramirez Luna <omar.ramirez@ti.com>
---
drivers/staging/tidspbridge/core/dsp-clock.c | 15 ++++++++++++---
1 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/tidspbridge/core/dsp-clock.c b/drivers/staging/tidspbridge/core/dsp-clock.c
index 3d1279c..1ba10ae 100644
--- a/drivers/staging/tidspbridge/core/dsp-clock.c
+++ b/drivers/staging/tidspbridge/core/dsp-clock.c
@@ -54,6 +54,7 @@
/* Bridge GPT id (1 - 4), DM Timer id (5 - 8) */
#define DMT_ID(id) ((id) + 4)
+#define DM_TIMER_CLOCKS 5
/* Bridge MCBSP id (6 - 10), OMAP Mcbsp id (0 - 4) */
#define MCBSP_ID(id) ((id) - 6)
@@ -114,8 +115,13 @@ static s8 get_clk_type(u8 id)
*/
void dsp_clk_exit(void)
{
+ int i;
+
dsp_clock_disable_all(dsp_clocks);
+ for (i = 0; i < DM_TIMER_CLOCKS; i++)
+ omap_dm_timer_free(timer[i]);
+
clk_put(iva2_clk);
clk_put(ssi.sst_fck);
clk_put(ssi.ssr_fck);
@@ -130,9 +136,13 @@ void dsp_clk_exit(void)
void dsp_clk_init(void)
{
static struct platform_device dspbridge_device;
+ int i, id;
dspbridge_device.dev.bus = &platform_bus_type;
+ for (i = 0, id = 5; i < DM_TIMER_CLOCKS; i++, id++)
+ timer[i] = omap_dm_timer_request_specific(id);
+
iva2_clk = clk_get(&dspbridge_device.dev, "iva2_ck");
if (IS_ERR(iva2_clk))
dev_err(bridge, "failed to get iva2 clock %p\n", iva2_clk);
@@ -204,8 +214,7 @@ int dsp_clk_enable(enum dsp_clk_id clk_id)
clk_enable(iva2_clk);
break;
case GPT_CLK:
- timer[clk_id - 1] =
- omap_dm_timer_request_specific(DMT_ID(clk_id));
+ status = omap_dm_timer_start(timer[clk_id - 1]);
break;
#ifdef CONFIG_OMAP_MCBSP
case MCBSP_CLK:
@@ -281,7 +290,7 @@ int dsp_clk_disable(enum dsp_clk_id clk_id)
clk_disable(iva2_clk);
break;
case GPT_CLK:
- omap_dm_timer_free(timer[clk_id - 1]);
+ status = omap_dm_timer_stop(timer[clk_id - 1]);
break;
#ifdef CONFIG_OMAP_MCBSP
case MCBSP_CLK:
--
1.7.0.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] staging: tidspbridge: request dmtimer clocks on init
2011-11-18 21:54 [PATCH] staging: tidspbridge: request dmtimer clocks on init Omar Ramirez Luna
@ 2011-11-18 22:16 ` Ramirez Luna, Omar
0 siblings, 0 replies; 2+ messages in thread
From: Ramirez Luna, Omar @ 2011-11-18 22:16 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: Omar Ramirez Luna, devel, linux-omap
Hi Greg,
On Fri, Nov 18, 2011 at 3:54 PM, Omar Ramirez Luna <omar.ramirez@ti.com> wrote:
> diff --git a/drivers/staging/tidspbridge/core/dsp-clock.c b/drivers/staging/tidspbridge/core/dsp-clock.c
> index 3d1279c..1ba10ae 100644
> --- a/drivers/staging/tidspbridge/core/dsp-clock.c
> +++ b/drivers/staging/tidspbridge/core/dsp-clock.c
> @@ -54,6 +54,7 @@
>
> /* Bridge GPT id (1 - 4), DM Timer id (5 - 8) */
> #define DMT_ID(id) ((id) + 4)
> +#define DM_TIMER_CLOCKS 5
:/ typo, please ignore this patch there are only 4 clocks for the dsp.
I'll send v2 instead.
Thanks,
Omar
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-11-18 22:16 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-18 21:54 [PATCH] staging: tidspbridge: request dmtimer clocks on init Omar Ramirez Luna
2011-11-18 22:16 ` Ramirez Luna, Omar
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.