From patchwork Tue Apr 23 15:46:27 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Figa X-Patchwork-Id: 2478491 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) by patchwork2.kernel.org (Postfix) with ESMTP id 81FCEDF2E5 for ; Tue, 23 Apr 2013 15:51:34 +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 1UUfTN-00078w-6x; Tue, 23 Apr 2013 15:49:38 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UUfSV-0004Ks-IX; Tue, 23 Apr 2013 15:48:43 +0000 Received: from mailout4.samsung.com ([203.254.224.34]) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UUfSM-0004KR-RJ for linux-arm-kernel@lists.infradead.org; Tue, 23 Apr 2013 15:48:36 +0000 Received: from epcpsbgm1.samsung.com (epcpsbgm1 [203.254.230.26]) by mailout4.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MLP00KP8T8X4980@mailout4.samsung.com> for linux-arm-kernel@lists.infradead.org; Wed, 24 Apr 2013 00:48:34 +0900 (KST) X-AuditID: cbfee61a-b7f156d000002a55-c7-5176ad514074 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id F3.D2.10837.15DA6715; Wed, 24 Apr 2013 00:48:33 +0900 (KST) Received: from mcdsrvbld02.digital.local ([106.116.37.23]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MLP0032TT5SFQ80@mmp1.samsung.com>; Wed, 24 Apr 2013 00:48:33 +0900 (KST) From: Tomasz Figa To: linux-arm-kernel@lists.infradead.org Subject: [PATCH v3 06/13] clocksource: samsung_pwm_timer: Add support for non-DT platforms Date: Tue, 23 Apr 2013 17:46:27 +0200 Message-id: <1366731994-7478-7-git-send-email-t.figa@samsung.com> X-Mailer: git-send-email 1.7.10 In-reply-to: <1366731994-7478-1-git-send-email-t.figa@samsung.com> References: <1366731994-7478-1-git-send-email-t.figa@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrHLMWRmVeSWpSXmKPExsVy+t9jAd3AtWWBBu+mmFn8nXSM3WLSugNM FgdmP2S1OPNb16J3wVU2i7NNb9gtNj2+xmox4/w+Jou1R+6yW5y6/pnNYv2M1ywWmzdNZbY4 NmMJo8WqXX8YHfg8fv+axOjxd9ULZo+ds+6ye9y5tofN4925c+wem5fUe5yfsZDR48qJJlaP vi2rGD0+b5IL4IrisklJzcksSy3St0vgyvjVtoal4KhYxZfXT1gbGFuEuxg5OSQETCRuvd3H CGGLSVy4t54NxBYSWMQocf0BbxcjF5DdxSTRMLsZLMEmoCbxueERmC0ioCExpesxO0gRs8Al Jon5uzaxgiSEBWIkVl78ywJiswioSixe8J0JxOYVcJRYtuEzM8Q2eYmn9/vABnEKOEnsPPoQ arOjxNG/7UwTGHkXMDKsYhRNLUguKE5KzzXUK07MLS7NS9dLzs/dxAgO5WdSOxhXNlgcYhTg YFTi4X0xqyxQiDWxrLgy9xCjBAezkgiv9WygEG9KYmVValF+fFFpTmrxIUZpDhYlcd4DrdaB QgLpiSWp2ampBalFMFkmDk6pBsb+C8yZsaHZHEcY6mKO6H77ObFIO1fYR+B489dH84M2bGBV Fnf+9GbBu+lHj2x497Il9GqAeKVuwQPpK352HRfPfL8XtV118qoqmTjfDNX9DF62mnzMLz6d 3mWkqGu8P6D27SbXc7m7zBetebju3P79y2znKjEor7LK3iJaJq9+zvxfnIFBUZ0SS3FGoqEW c1FxIgDE6UnLYQIAAA== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130423_114835_171978_94BC9060 X-CRM114-Status: GOOD ( 14.52 ) X-Spam-Score: -6.9 (------) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-6.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high trust [203.254.224.34 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: kgene.kim@samsung.com, arnd@arndb.de, devicetree-discuss@lists.ozlabs.org, tomasz.figa@gmail.com, kyungmin.park@samsung.com, linux-samsung-soc@vger.kernel.org, john.stultz@linaro.org, ben-linux@fluff.org, olof@lixom.net, thomas.abraham@linaro.org, tglx@linutronix.de, Tomasz Figa , m.szyprowski@samsung.com 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 This patch extends the driver to support platforms that still use legacy ATAGS-based boot, without device tree, by providing an exported function that can be used from platform code to initialize the clocksource. Signed-off-by: Tomasz Figa Signed-off-by: Kyungmin Park --- drivers/clocksource/Kconfig | 1 - drivers/clocksource/samsung_pwm_timer.c | 16 ++++++++++++++-- include/clocksource/samsung_pwm.h | 3 +++ 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig index 4700305..f151c6c 100644 --- a/drivers/clocksource/Kconfig +++ b/drivers/clocksource/Kconfig @@ -79,7 +79,6 @@ config CLKSRC_EXYNOS_MCT config CLKSRC_SAMSUNG_PWM bool - depends on OF select CLKSRC_MMIO help This is a new clocksource driver for the PWM timer found in diff --git a/drivers/clocksource/samsung_pwm_timer.c b/drivers/clocksource/samsung_pwm_timer.c index e3257fa..9f4bd6a 100644 --- a/drivers/clocksource/samsung_pwm_timer.c +++ b/drivers/clocksource/samsung_pwm_timer.c @@ -356,7 +356,7 @@ static void __init samsung_timer_resources(void) /* * PWM master driver */ -static void __init samsung_pwm_clocksource_init(void) +static void __init _samsung_pwm_clocksource_init(void) { u8 mask; int channel; @@ -378,6 +378,17 @@ static void __init samsung_pwm_clocksource_init(void) samsung_clocksource_init(); } +void __init samsung_pwm_clocksource_init(void __iomem *base, + unsigned int *irqs, struct samsung_pwm_variant *variant) +{ + pwm.base = base; + memcpy(&pwm.variant, variant, sizeof(pwm.variant)); + memcpy(pwm.irq, irqs, SAMSUNG_PWM_NUM * sizeof(*irqs)); + + _samsung_pwm_clocksource_init(); +} + +#ifdef CONFIG_CLKSRC_OF static void __init samsung_pwm_alloc(struct device_node *np, const struct samsung_pwm_variant *variant) { @@ -414,7 +425,7 @@ static void __init samsung_pwm_alloc(struct device_node *np, return; } - samsung_pwm_clocksource_init(); + _samsung_pwm_clocksource_init(); } static const struct samsung_pwm_variant s3c24xx_variant = { @@ -468,3 +479,4 @@ static void __init s5p_pwm_clocksource_init(struct device_node *np) samsung_pwm_alloc(np, &s5p_variant); } CLOCKSOURCE_OF_DECLARE(s5pc100_pwm, "samsung,s5pc100-pwm", s5p_pwm_clocksource_init); +#endif diff --git a/include/clocksource/samsung_pwm.h b/include/clocksource/samsung_pwm.h index b1d8fe7..5c449c8 100644 --- a/include/clocksource/samsung_pwm.h +++ b/include/clocksource/samsung_pwm.h @@ -30,4 +30,7 @@ struct samsung_pwm_variant { bool has_tint_cstat; }; +void samsung_pwm_clocksource_init(void __iomem *base, + unsigned int *irqs, struct samsung_pwm_variant *variant); + #endif /* __CLOCKSOURCE_SAMSUNG_PWM_H */