diff options
Diffstat (limited to 'arch/arm/plat-omap/dmtimer.c')
-rw-r--r-- | arch/arm/plat-omap/dmtimer.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/arch/arm/plat-omap/dmtimer.c b/arch/arm/plat-omap/dmtimer.c index a05205c12f7b..55bb99631292 100644 --- a/arch/arm/plat-omap/dmtimer.c +++ b/arch/arm/plat-omap/dmtimer.c | |||
@@ -509,7 +509,7 @@ EXPORT_SYMBOL_GPL(omap_dm_timer_stop); | |||
509 | 509 | ||
510 | #ifdef CONFIG_ARCH_OMAP1 | 510 | #ifdef CONFIG_ARCH_OMAP1 |
511 | 511 | ||
512 | void omap_dm_timer_set_source(struct omap_dm_timer *timer, int source) | 512 | int omap_dm_timer_set_source(struct omap_dm_timer *timer, int source) |
513 | { | 513 | { |
514 | int n = (timer - dm_timers) << 1; | 514 | int n = (timer - dm_timers) << 1; |
515 | u32 l; | 515 | u32 l; |
@@ -517,23 +517,31 @@ void omap_dm_timer_set_source(struct omap_dm_timer *timer, int source) | |||
517 | l = omap_readl(MOD_CONF_CTRL_1) & ~(0x03 << n); | 517 | l = omap_readl(MOD_CONF_CTRL_1) & ~(0x03 << n); |
518 | l |= source << n; | 518 | l |= source << n; |
519 | omap_writel(l, MOD_CONF_CTRL_1); | 519 | omap_writel(l, MOD_CONF_CTRL_1); |
520 | |||
521 | return 0; | ||
520 | } | 522 | } |
521 | EXPORT_SYMBOL_GPL(omap_dm_timer_set_source); | 523 | EXPORT_SYMBOL_GPL(omap_dm_timer_set_source); |
522 | 524 | ||
523 | #else | 525 | #else |
524 | 526 | ||
525 | void omap_dm_timer_set_source(struct omap_dm_timer *timer, int source) | 527 | int omap_dm_timer_set_source(struct omap_dm_timer *timer, int source) |
526 | { | 528 | { |
529 | int ret = -EINVAL; | ||
530 | |||
527 | if (source < 0 || source >= 3) | 531 | if (source < 0 || source >= 3) |
528 | return; | 532 | return -EINVAL; |
529 | 533 | ||
530 | clk_disable(timer->fclk); | 534 | clk_disable(timer->fclk); |
531 | clk_set_parent(timer->fclk, dm_source_clocks[source]); | 535 | ret = clk_set_parent(timer->fclk, dm_source_clocks[source]); |
532 | clk_enable(timer->fclk); | 536 | clk_enable(timer->fclk); |
533 | 537 | ||
534 | /* When the functional clock disappears, too quick writes seem to | 538 | /* |
535 | * cause an abort. */ | 539 | * When the functional clock disappears, too quick writes seem |
540 | * to cause an abort. XXX Is this still necessary? | ||
541 | */ | ||
536 | __delay(150000); | 542 | __delay(150000); |
543 | |||
544 | return ret; | ||
537 | } | 545 | } |
538 | EXPORT_SYMBOL_GPL(omap_dm_timer_set_source); | 546 | EXPORT_SYMBOL_GPL(omap_dm_timer_set_source); |
539 | 547 | ||