diff options
author | Jon Hunter <jon-hunter@ti.com> | 2012-06-05 13:34:59 -0400 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2012-06-14 05:39:47 -0400 |
commit | 2b2d35230099613365ad6000f4d71086130b9e71 (patch) | |
tree | 6ac2f7db9822cb94949f6822ff327139d7c4f155 /arch/arm/mach-omap2/timer.c | |
parent | bca4580845cbffb455d77783fc7e58a94b3904e0 (diff) |
ARM: OMAP2+: Move dmtimer clock set function to dmtimer driver
OMAP1 uses an architecture specific function for setting the dmtimer clock
source, where as the OMAP2+ devices use the clock framework. Eventually OMAP1
device should also use the clock framework and hence we should not any
architecture specific functions.
For now move the OMAP2+ function for configuring the clock source into the
dmtimer driver. Therefore, we do no longer need to specify an architecture
specific function for setting the clock source for OMAP2+ devices. This will
simplify device tree migration of the dmtimers for OMAP2+ devices.
From now on, only OMAP1 devices should specify an architecture specific
function for setting the clock source via the platform data set_dmtimer_src()
function pointer.
Signed-off-by: Jon Hunter <jon-hunter@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm/mach-omap2/timer.c')
-rw-r--r-- | arch/arm/mach-omap2/timer.c | 55 |
1 files changed, 0 insertions, 55 deletions
diff --git a/arch/arm/mach-omap2/timer.c b/arch/arm/mach-omap2/timer.c index 0e17a0d9690b..8fe75a81e12d 100644 --- a/arch/arm/mach-omap2/timer.c +++ b/arch/arm/mach-omap2/timer.c | |||
@@ -390,59 +390,6 @@ OMAP_SYS_TIMER(4) | |||
390 | #endif | 390 | #endif |
391 | 391 | ||
392 | /** | 392 | /** |
393 | * omap2_dm_timer_set_src - change the timer input clock source | ||
394 | * @pdev: timer platform device pointer | ||
395 | * @source: array index of parent clock source | ||
396 | */ | ||
397 | static int omap2_dm_timer_set_src(struct platform_device *pdev, int source) | ||
398 | { | ||
399 | int ret; | ||
400 | struct clk *fclk, *parent; | ||
401 | char *parent_name = NULL; | ||
402 | |||
403 | fclk = clk_get(&pdev->dev, "fck"); | ||
404 | if (IS_ERR_OR_NULL(fclk)) { | ||
405 | dev_err(&pdev->dev, "%s: %d: clk_get() FAILED\n", | ||
406 | __func__, __LINE__); | ||
407 | return -EINVAL; | ||
408 | } | ||
409 | |||
410 | switch (source) { | ||
411 | case OMAP_TIMER_SRC_SYS_CLK: | ||
412 | parent_name = "sys_ck"; | ||
413 | break; | ||
414 | |||
415 | case OMAP_TIMER_SRC_32_KHZ: | ||
416 | parent_name = "32k_ck"; | ||
417 | break; | ||
418 | |||
419 | case OMAP_TIMER_SRC_EXT_CLK: | ||
420 | parent_name = "alt_ck"; | ||
421 | break; | ||
422 | } | ||
423 | |||
424 | parent = clk_get(&pdev->dev, parent_name); | ||
425 | if (IS_ERR_OR_NULL(parent)) { | ||
426 | dev_err(&pdev->dev, "%s: %d: clk_get() %s FAILED\n", | ||
427 | __func__, __LINE__, parent_name); | ||
428 | clk_put(fclk); | ||
429 | return -EINVAL; | ||
430 | } | ||
431 | |||
432 | ret = clk_set_parent(fclk, parent); | ||
433 | if (IS_ERR_VALUE(ret)) { | ||
434 | dev_err(&pdev->dev, "%s: clk_set_parent() to %s FAILED\n", | ||
435 | __func__, parent_name); | ||
436 | ret = -EINVAL; | ||
437 | } | ||
438 | |||
439 | clk_put(parent); | ||
440 | clk_put(fclk); | ||
441 | |||
442 | return ret; | ||
443 | } | ||
444 | |||
445 | /** | ||
446 | * omap_timer_init - build and register timer device with an | 393 | * omap_timer_init - build and register timer device with an |
447 | * associated timer hwmod | 394 | * associated timer hwmod |
448 | * @oh: timer hwmod pointer to be used to build timer device | 395 | * @oh: timer hwmod pointer to be used to build timer device |
@@ -489,8 +436,6 @@ static int __init omap_timer_init(struct omap_hwmod *oh, void *unused) | |||
489 | */ | 436 | */ |
490 | sscanf(oh->name, "timer%2d", &id); | 437 | sscanf(oh->name, "timer%2d", &id); |
491 | 438 | ||
492 | pdata->set_timer_src = omap2_dm_timer_set_src; | ||
493 | |||
494 | if (timer_dev_attr) | 439 | if (timer_dev_attr) |
495 | pdata->timer_capability = timer_dev_attr->timer_capability; | 440 | pdata->timer_capability = timer_dev_attr->timer_capability; |
496 | 441 | ||