aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/timer.c
diff options
context:
space:
mode:
authorOlof Johansson <olof@lixom.net>2018-05-25 18:23:25 -0400
committerOlof Johansson <olof@lixom.net>2018-05-25 18:23:25 -0400
commitbd6cc4f2d2700fb0a1b0251a95113f0fb517a9b9 (patch)
tree588bd62d6147e9bd0807fc91d370152756ad2713 /arch/arm/mach-omap2/timer.c
parent320b85794724554ee0890726b511b1973ddcf650 (diff)
parent759c27bdc77577aaecb6f31768e5951a858f97a9 (diff)
Merge tag 'omap-for-v4.18/soc-late-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into next/soc
Late omap soc changes for v4.18 merge window This series contains two omap1 ams-delta GPIO clean-up patches to get started with removal of hard-coded GPIO numbers from drivers. And then the removal of board mach includes from drivers. The second patch mostly touches the ams-delta audio driver but is included here because of the removal of the latch gpios and is acked by Mark Brown. And there are two more am437x related PM patches to save and restore control module and timer registers for RTC only suspend mode. Looks like the patch title for the timer changes is a bit misleading, not all the timer code is yet living under drivers/clocksource. But I had already pushed out the branch before I noticed this. * tag 'omap-for-v4.18/soc-late-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap: OMAP: CLK: CLKSRC: Add suspend resume hooks ARM: AM43XX: Add functions to save/restore am43xx control registers ASoC: ams_delta: use GPIO lookup table ARM: OMAP1: ams-delta: add GPIO lookup tables Signed-off-by: Olof Johansson <olof@lixom.net>
Diffstat (limited to 'arch/arm/mach-omap2/timer.c')
-rw-r--r--arch/arm/mach-omap2/timer.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/timer.c b/arch/arm/mach-omap2/timer.c
index 5a70ab67af8e..98ed5ac073bc 100644
--- a/arch/arm/mach-omap2/timer.c
+++ b/arch/arm/mach-omap2/timer.c
@@ -70,6 +70,9 @@ static struct clock_event_device clockevent_gpt;
70/* Clockevent hwmod for am335x and am437x suspend */ 70/* Clockevent hwmod for am335x and am437x suspend */
71static struct omap_hwmod *clockevent_gpt_hwmod; 71static struct omap_hwmod *clockevent_gpt_hwmod;
72 72
73/* Clockesource hwmod for am437x suspend */
74static struct omap_hwmod *clocksource_gpt_hwmod;
75
73#ifdef CONFIG_SOC_HAS_REALTIME_COUNTER 76#ifdef CONFIG_SOC_HAS_REALTIME_COUNTER
74static unsigned long arch_timer_freq; 77static unsigned long arch_timer_freq;
75 78
@@ -478,6 +481,26 @@ static int __init __maybe_unused omap2_sync32k_clocksource_init(void)
478 return ret; 481 return ret;
479} 482}
480 483
484static unsigned int omap2_gptimer_clksrc_load;
485
486static void omap2_gptimer_clksrc_suspend(struct clocksource *unused)
487{
488 omap2_gptimer_clksrc_load =
489 __omap_dm_timer_read_counter(&clksrc, OMAP_TIMER_NONPOSTED);
490
491 omap_hwmod_idle(clocksource_gpt_hwmod);
492}
493
494static void omap2_gptimer_clksrc_resume(struct clocksource *unused)
495{
496 omap_hwmod_enable(clocksource_gpt_hwmod);
497
498 __omap_dm_timer_load_start(&clksrc,
499 OMAP_TIMER_CTRL_ST | OMAP_TIMER_CTRL_AR,
500 omap2_gptimer_clksrc_load,
501 OMAP_TIMER_NONPOSTED);
502}
503
481static void __init omap2_gptimer_clocksource_init(int gptimer_id, 504static void __init omap2_gptimer_clocksource_init(int gptimer_id,
482 const char *fck_source, 505 const char *fck_source,
483 const char *property) 506 const char *property)
@@ -490,6 +513,15 @@ static void __init omap2_gptimer_clocksource_init(int gptimer_id,
490 res = omap_dm_timer_init_one(&clksrc, fck_source, property, 513 res = omap_dm_timer_init_one(&clksrc, fck_source, property,
491 &clocksource_gpt.name, 514 &clocksource_gpt.name,
492 OMAP_TIMER_NONPOSTED); 515 OMAP_TIMER_NONPOSTED);
516
517 if (soc_is_am43xx()) {
518 clocksource_gpt.suspend = omap2_gptimer_clksrc_suspend;
519 clocksource_gpt.resume = omap2_gptimer_clksrc_resume;
520
521 clocksource_gpt_hwmod =
522 omap_hwmod_lookup(clocksource_gpt.name);
523 }
524
493 BUG_ON(res); 525 BUG_ON(res);
494 526
495 __omap_dm_timer_load_start(&clksrc, 527 __omap_dm_timer_load_start(&clksrc,