From patchwork Thu Jun 20 22:12:50 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Figa X-Patchwork-Id: 2759001 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 736859F472 for ; Thu, 20 Jun 2013 22:17:32 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 905BB201C0 for ; Thu, 20 Jun 2013 22:17:31 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 855F3201BC for ; Thu, 20 Jun 2013 22:17:30 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Upn8s-0004et-So; Thu, 20 Jun 2013 22:15:49 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Upn8R-0002wA-3T; Thu, 20 Jun 2013 22:15:19 +0000 Received: from mail-bk0-x22d.google.com ([2a00:1450:4008:c01::22d]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Upn7b-0002oT-4I for linux-arm-kernel@lists.infradead.org; Thu, 20 Jun 2013 22:14:28 +0000 Received: by mail-bk0-f45.google.com with SMTP id je9so3105333bkc.18 for ; Thu, 20 Jun 2013 15:14:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=3LxNU19cpHDS1rI3d89CgcOrGbbjY7R9SW1e5+UiHHo=; b=QwBvhLFIumIlFPnLdclCFNxk0xwA6FSgnqbV/HCJpLj/Eyfcd4s1OPjk8nqP559USJ DuP0oQmkJDC8Exha05ZLGzEZw8PbwnFxXrVrQGpo3TxTMMLLS/ivb/kET0Z+Dkd75ePu xBcxjvcf177El9qX0x0Zp7EutfIDJKtMKgLJE/O82SX+VNAsnQ/QJFeQ42upBlv5wWnj CKMSUXLfaxahg0YMLIpVViT9ahtbo6uLIGTJWTVcnAW7E5SADZm3yqmVUxn1tJAdTZ9v hGrnLoekSynV/H0wXvZEXa/NnEEVdeQHC8aZAV9jaqHRgqqBSagICl6WnXXOdZppgUiJ vnSg== X-Received: by 10.204.228.76 with SMTP id jd12mr383434bkb.133.1371766449411; Thu, 20 Jun 2013 15:14:09 -0700 (PDT) Received: from flatron.tomeq (87-207-52-162.dynamic.chello.pl. [87.207.52.162]) by mx.google.com with ESMTPSA id fc7sm864232bkc.3.2013.06.20.15.14.07 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 20 Jun 2013 15:14:08 -0700 (PDT) From: Tomasz Figa To: linux-samsung-soc@vger.kernel.org Subject: [PATCH v2 05/18] clocksource: samsung_pwm_timer: Do not use clocksource_mmio Date: Fri, 21 Jun 2013 00:12:50 +0200 Message-Id: <1371766383-29077-6-git-send-email-tomasz.figa@gmail.com> X-Mailer: git-send-email 1.8.2.1 In-Reply-To: <1371766383-29077-1-git-send-email-tomasz.figa@gmail.com> References: <1371766383-29077-1-git-send-email-tomasz.figa@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130620_181427_340997_1A96E7E0 X-CRM114-Status: GOOD ( 11.86 ) X-Spam-Score: -2.0 (--) Cc: linux-pwm@vger.kernel.org, Kukjin Kim , =?UTF-8?q?Heiko=20St=C3=BCbner?= , Arnd Bergmann , Tomasz Figa , Mark Brown , Thomas Abraham , Olof Johansson , Thierry Reding , Sylwester Nawrocki , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 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=-5.4 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, 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 case of Samsung PWM timer, clocksource MMIO can not be used, because custom suspend/resume callbacks are required. Signed-off-by: Tomasz Figa --- drivers/clocksource/samsung_pwm_timer.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/drivers/clocksource/samsung_pwm_timer.c b/drivers/clocksource/samsung_pwm_timer.c index d361b5e..ff150d1 100644 --- a/drivers/clocksource/samsung_pwm_timer.c +++ b/drivers/clocksource/samsung_pwm_timer.c @@ -287,6 +287,18 @@ static void __init samsung_clockevent_init(void) } } +static cycle_t samsung_clocksource_read(struct clocksource *c) +{ + return ~readl_relaxed(pwm.source_reg); +} + +static struct clocksource samsung_clocksource = { + .name = "samsung_clocksource_timer", + .rating = 250, + .read = samsung_clocksource_read, + .flags = CLOCK_SOURCE_IS_CONTINUOUS, +}; + /* * Override the global weak sched_clock symbol with this * local implementation which uses the clocksource to get some @@ -296,7 +308,7 @@ static void __init samsung_clockevent_init(void) */ static u32 notrace samsung_read_sched_clock(void) { - return ~__raw_readl(pwm.source_reg); + return samsung_clocksource_read(NULL); } static void __init samsung_clocksource_init(void) @@ -323,9 +335,8 @@ static void __init samsung_clocksource_init(void) setup_sched_clock(samsung_read_sched_clock, pwm.variant.bits, clock_rate); - ret = clocksource_mmio_init(pwm.source_reg, "samsung_clocksource_timer", - clock_rate, 250, pwm.variant.bits, - clocksource_mmio_readl_down); + samsung_clocksource.mask = CLOCKSOURCE_MASK(pwm.variant.bits); + ret = clocksource_register_hz(&samsung_clocksource, clock_rate); if (ret) panic("samsung_clocksource_timer: can't register clocksource\n"); }