Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

staging: tidspbridge: request dmtimer clocks on init

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

authored by

Omar Ramirez Luna and committed by
Greg Kroah-Hartman
3b9cd5d1 9b0a3f98

+12 -3
+12 -3
drivers/staging/tidspbridge/core/dsp-clock.c
··· 54 54 55 55 /* Bridge GPT id (1 - 4), DM Timer id (5 - 8) */ 56 56 #define DMT_ID(id) ((id) + 4) 57 + #define DM_TIMER_CLOCKS 4 57 58 58 59 /* Bridge MCBSP id (6 - 10), OMAP Mcbsp id (0 - 4) */ 59 60 #define MCBSP_ID(id) ((id) - 6) ··· 115 114 */ 116 115 void dsp_clk_exit(void) 117 116 { 117 + int i; 118 + 118 119 dsp_clock_disable_all(dsp_clocks); 120 + 121 + for (i = 0; i < DM_TIMER_CLOCKS; i++) 122 + omap_dm_timer_free(timer[i]); 119 123 120 124 clk_put(iva2_clk); 121 125 clk_put(ssi.sst_fck); ··· 136 130 void dsp_clk_init(void) 137 131 { 138 132 static struct platform_device dspbridge_device; 133 + int i, id; 139 134 140 135 dspbridge_device.dev.bus = &platform_bus_type; 136 + 137 + for (i = 0, id = 5; i < DM_TIMER_CLOCKS; i++, id++) 138 + timer[i] = omap_dm_timer_request_specific(id); 141 139 142 140 iva2_clk = clk_get(&dspbridge_device.dev, "iva2_ck"); 143 141 if (IS_ERR(iva2_clk)) ··· 214 204 clk_enable(iva2_clk); 215 205 break; 216 206 case GPT_CLK: 217 - timer[clk_id - 1] = 218 - omap_dm_timer_request_specific(DMT_ID(clk_id)); 207 + status = omap_dm_timer_start(timer[clk_id - 1]); 219 208 break; 220 209 #ifdef CONFIG_OMAP_MCBSP 221 210 case MCBSP_CLK: ··· 290 281 clk_disable(iva2_clk); 291 282 break; 292 283 case GPT_CLK: 293 - omap_dm_timer_free(timer[clk_id - 1]); 284 + status = omap_dm_timer_stop(timer[clk_id - 1]); 294 285 break; 295 286 #ifdef CONFIG_OMAP_MCBSP 296 287 case MCBSP_CLK: