From: David Brown Date: Thu, 11 Apr 2013 16:42:34 +0000 (-0700) Subject: Merge branch 'msm-core' into for-next X-Git-Tag: next-20130422~12^2~1 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=7b8f0b42ebcc468c268c1769b0599351e4849084;p=karo-tx-linux.git Merge branch 'msm-core' into for-next * msm-core: ARM: msm: Wait for timer clear to complete ARM: msm: Rework timer binding to be more general --- 7b8f0b42ebcc468c268c1769b0599351e4849084 diff --cc arch/arm/mach-msm/timer.c index f9fd77e8f1f5,b4b0d79476a8..284313f3e02c --- a/arch/arm/mach-msm/timer.c +++ b/arch/arm/mach-msm/timer.c @@@ -62,11 -65,13 +65,16 @@@ static int msm_timer_set_next_event(uns { u32 ctrl = readl_relaxed(event_base + TIMER_ENABLE); - writel_relaxed(0, event_base + TIMER_CLEAR); + ctrl &= ~TIMER_ENABLE_EN; + writel_relaxed(ctrl, event_base + TIMER_ENABLE); + + writel_relaxed(ctrl, event_base + TIMER_CLEAR); writel_relaxed(cycles, event_base + TIMER_MATCH_VAL); + + if (sts_base) + while (readl_relaxed(sts_base) & TIMER_STS_GPT0_CLR_PEND) + cpu_relax(); + writel_relaxed(ctrl | TIMER_ENABLE_EN, event_base + TIMER_ENABLE); return 0; }