From patchwork Wed Sep 24 16:20:08 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Agner X-Patchwork-Id: 4968011 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id BB3819F2F0 for ; Wed, 24 Sep 2014 16:22:47 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 756C52028D for ; Wed, 24 Sep 2014 16:22:46 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id CEC7220274 for ; Wed, 24 Sep 2014 16:22:44 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XWpJ8-00075f-EN; Wed, 24 Sep 2014 16:20:46 +0000 Received: from mail.kmu-office.ch ([178.209.48.102]) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XWpIy-0006qH-LQ for linux-arm-kernel@lists.infradead.org; Wed, 24 Sep 2014 16:20:37 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.kmu-office.ch (Postfix) with ESMTP id D8E454D52C for ; Wed, 24 Sep 2014 18:18:51 +0200 (CEST) X-Virus-Scanned: by amavisd-new at kmu-office.ch Received: from mail.kmu-office.ch ([127.0.0.1]) by localhost (mail.kmu-office.ch [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id AEIsE9h9A28c for ; Wed, 24 Sep 2014 18:18:51 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mail.kmu-office.ch (Postfix) with ESMTP id 827DA4D52D for ; Wed, 24 Sep 2014 18:18:50 +0200 (CEST) Received: from trochilidae.toradex.int (unknown [46.140.72.82]) (Authenticated sender: stefan@agner.ch) by mail.kmu-office.ch (Postfix) with ESMTPSA id D01FE4D4DB; Wed, 24 Sep 2014 18:18:49 +0200 (CEST) From: Stefan Agner To: shawn.guo@freescale.com, kernel@pengutronix.de, daniel.lezcano@linaro.org, tglx@linutronix.de Subject: [PATCH v2 1/3] clocksource: vf_pit_timer: Support shutdown mode Date: Wed, 24 Sep 2014 18:20:08 +0200 Message-Id: <1411575610-20895-2-git-send-email-stefan@agner.ch> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1411575610-20895-1-git-send-email-stefan@agner.ch> References: <1411575610-20895-1-git-send-email-stefan@agner.ch> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140924_092036_881354_BF90E5F1 X-CRM114-Status: UNSURE ( 9.09 ) X-CRM114-Notice: Please train this message. X-Spam-Score: 0.0 (/) Cc: bpringlemeir@nbsps.com, linux-kernel@vger.kernel.org, Stefan Agner , jingchang.lu@freescale.com, festevam@gmail.com, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP In order to avoid waking up the system in a low power mode, the clocksource should not generate interrupts anymore. Disable the PIT timer interrupt when changing into the CLOCK_EVT_MODE_SHUTDOWN mode. Signed-off-by: Stefan Agner --- drivers/clocksource/vf_pit_timer.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/clocksource/vf_pit_timer.c b/drivers/clocksource/vf_pit_timer.c index a918bc4..eb354b4 100644 --- a/drivers/clocksource/vf_pit_timer.c +++ b/drivers/clocksource/vf_pit_timer.c @@ -89,10 +89,15 @@ static int pit_set_next_event(unsigned long delta, static void pit_set_mode(enum clock_event_mode mode, struct clock_event_device *evt) { + switch (mode) { case CLOCK_EVT_MODE_PERIODIC: pit_set_next_event(cycle_per_jiffy, evt); break; + case CLOCK_EVT_MODE_SHUTDOWN: + case CLOCK_EVT_MODE_UNUSED: + pit_timer_disable(); + break; default: break; }