From patchwork Sun Oct 28 21:40:31 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tony Prisk X-Patchwork-Id: 1659191 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id 4FDD440135 for ; Sun, 28 Oct 2012 21:51:58 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TSakG-00078H-Jr; Sun, 28 Oct 2012 21:50:12 +0000 Received: from server.prisktech.co.nz ([115.188.14.127]) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TSakC-00077q-M5 for linux-arm-kernel@lists.infradead.org; Sun, 28 Oct 2012 21:50:09 +0000 Received: from localhost.localdomain (gitbox.prisktech.co.nz [192.168.0.103]) by server.prisktech.co.nz (Postfix) with ESMTP id D417C1300A79; Mon, 29 Oct 2012 10:40:35 +1300 (NZDT) From: Tony Prisk To: mturquette@ti.com, mturquette@linaro.org Subject: [PATCH 2/2] clk: vt8500: Remove dependancy on pmc_base Date: Mon, 29 Oct 2012 10:40:31 +1300 Message-Id: <1351460431-1048-2-git-send-email-linux@prisktech.co.nz> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1351460431-1048-1-git-send-email-linux@prisktech.co.nz> References: <1351460431-1048-1-git-send-email-linux@prisktech.co.nz> X-Spam-Note: CRM114 invocation failed X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 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: Tony Prisk , arm@kernel.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org This patch removes the requirement to pass a Power Management Controller base address to vtwm_clk_init(), in preparation of separating the power management code from arch-vt8500/vt8500.c. Signed-off-by: Tony Prisk --- Mike, Do you mind if this patch goes through arm-soc, given it is self-contained, so I can base the other PM changes off it? Regards Tony P arch/arm/mach-vt8500/common.h | 2 +- arch/arm/mach-vt8500/vt8500.c | 2 +- drivers/clk/clk-vt8500.c | 20 ++++++++++++++++---- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/arch/arm/mach-vt8500/common.h b/arch/arm/mach-vt8500/common.h index 2b24196..e38b17f 100644 --- a/arch/arm/mach-vt8500/common.h +++ b/arch/arm/mach-vt8500/common.h @@ -23,6 +23,6 @@ int __init vt8500_irq_init(struct device_node *node, struct device_node *parent); /* defined in drivers/clk/clk-vt8500.c */ -void __init vtwm_clk_init(void __iomem *pmc_base); +void __init vtwm_clk_init(void); #endif diff --git a/arch/arm/mach-vt8500/vt8500.c b/arch/arm/mach-vt8500/vt8500.c index 8d3871f..0ee2a16 100644 --- a/arch/arm/mach-vt8500/vt8500.c +++ b/arch/arm/mach-vt8500/vt8500.c @@ -162,7 +162,7 @@ void __init vt8500_init(void) else pr_err("%s: PMC Hibernation register could not be remapped, not enabling power off!\n", __func__); - vtwm_clk_init(pmc_base); + vtwm_clk_init(); of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); } diff --git a/drivers/clk/clk-vt8500.c b/drivers/clk/clk-vt8500.c index fe25570..820f39a 100644 --- a/drivers/clk/clk-vt8500.c +++ b/drivers/clk/clk-vt8500.c @@ -15,6 +15,7 @@ #include #include +#include #include #include #include @@ -517,12 +518,23 @@ static const __initconst struct of_device_id clk_match[] = { { /* sentinel */ } }; -void __init vtwm_clk_init(void __iomem *base) +void __init vtwm_clk_init(void) { - if (!base) - return; + struct device_node *np = + of_find_compatible_node(NULL, NULL, "via,vt8500-pmc"); + + if (!np) { + pr_err("%s: power management device node missing\n", __func__); + return -ENODEV; + } - pmc_base = base; + pmc_base = of_iomap(np, 0); + of_node_put(np); + + if (!pmc_base) { + pr_err("%s: of_iomap(pmc) failed\n", __func__); + return -ENOMEM; + } of_clk_init(clk_match); }