Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933167Ab1FBJfs (ORCPT ); Thu, 2 Jun 2011 05:35:48 -0400 Received: from eu1sys200aog102.obsmtp.com ([207.126.144.113]:47910 "EHLO eu1sys200aog102.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932795Ab1FBJfq (ORCPT ); Thu, 2 Jun 2011 05:35:46 -0400 From: Mattias Wallin To: Thomas Gleixner , , Cc: Lee Jones , Mattias Wallin Subject: [PATCHv2 1/3] plat-nomadik: MTU sched_clock as a config option Date: Thu, 2 Jun 2011 11:35:14 +0200 Message-ID: <1307007314-1061-1-git-send-email-mattias.wallin@stericsson.com> X-Mailer: git-send-email 1.7.5.1 MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2426 Lines: 74 To make room for another sched_clk implementation a config option is added around the sched_clk part of the MTU timer. This makes it possible to configure away the sched_clk part. An alternate sched_clk and clocksource is needed for the db8500 chip because the MTU is placed in a none always on power domain and will loose power in some cpuidle sleep states. Signed-off-by: Mattias Wallin Acked-by: Linus Walleij --- arch/arm/plat-nomadik/Kconfig | 8 +++++++- arch/arm/plat-nomadik/timer.c | 4 ++++ 2 files changed, 11 insertions(+), 1 deletions(-) diff --git a/arch/arm/plat-nomadik/Kconfig b/arch/arm/plat-nomadik/Kconfig index ce65901..bca4914 100644 --- a/arch/arm/plat-nomadik/Kconfig +++ b/arch/arm/plat-nomadik/Kconfig @@ -15,10 +15,16 @@ if PLAT_NOMADIK config HAS_MTU bool - select HAVE_SCHED_CLOCK help Support for Multi Timer Unit. MTU provides access to multiple interrupt generating programmable 32-bit free running decrementing counters. +config NOMADIK_MTU_SCHED_CLOCK + bool + depends on HAS_MTU + select HAVE_SCHED_CLOCK + help + Use the Multi Timer Unit as the sched_clock. + endif diff --git a/arch/arm/plat-nomadik/timer.c b/arch/arm/plat-nomadik/timer.c index ef74e15..b55c4ec 100644 --- a/arch/arm/plat-nomadik/timer.c +++ b/arch/arm/plat-nomadik/timer.c @@ -25,6 +25,7 @@ void __iomem *mtu_base; /* Assigned by machine code */ +#ifdef CONFIG_NOMADIK_MTU_SCHED_CLOCK /* * Override the global weak sched_clock symbol with this * local implementation which uses the clocksource to get some @@ -48,6 +49,7 @@ static void notrace nomadik_update_sched_clock(void) u32 cyc = -readl(mtu_base + MTU_VAL(0)); update_sched_clock(&cd, cyc, (u32)~0); } +#endif /* Clockevent device: use one-shot mode */ static void nmdk_clkevt_mode(enum clock_event_mode mode, @@ -154,7 +156,9 @@ void __init nmdk_timer_init(void) pr_err("timer: failed to initialize clock source %s\n", "mtu_0"); +#ifdef CONFIG_NOMADIK_MTU_SCHED_CLOCK init_sched_clock(&cd, nomadik_update_sched_clock, 32, rate); +#endif /* Timer 1 is used for events */ -- 1.7.4.3 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/