From patchwork Sat May 16 00:23:38 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Hesselbarth X-Patchwork-Id: 6418531 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.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 319DA9F318 for ; Sat, 16 May 2015 00:28:35 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4B8A620573 for ; Sat, 16 May 2015 00:28:34 +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 6382F20567 for ; Sat, 16 May 2015 00:28:33 +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 1YtPvi-00087T-9M; Sat, 16 May 2015 00:26:14 +0000 Received: from mail-wg0-x233.google.com ([2a00:1450:400c:c00::233]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YtPtn-0006Dn-1M for linux-arm-kernel@lists.infradead.org; Sat, 16 May 2015 00:24:19 +0000 Received: by wgkx2 with SMTP id x2so10416407wgk.2 for ; Fri, 15 May 2015 17:23:53 -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:in-reply-to:references; bh=L0YujshxjD9tvjTygjrjfFsvmUb2xgSXC5ihXDl7nw8=; b=EiwMipwnnuFxHSiKLx8ONsbRAMQAW2SNXWcUiARMn/jhbU+PmNXXlmR32df7TV3XZB Z+5DPXwV7/W0SAaMcc7xxH+NUEG6AvkHjTnhOTlS90XdsbFluClrrPLefTsVWzieWcDa G2ltDqexFTFYEw3s/CpB4T53i0uI+qRgs8w7qQ39ic36beBvqt2vCEQTNJy2OO/tuPOo LMdzvGoob+QWXgnDAG3OBNNDtYUI678I1Rb1J4KDt3NG6EATvoGwhWiUWZM0W6YNY4nb dDhZhht2649QPJyebpsT4KOpQNYBNddpaBHevVG69A5uMyLf7rCm2GCo9/N2dffDomSb WlqQ== X-Received: by 10.194.200.228 with SMTP id jv4mr22462725wjc.157.1431735832983; Fri, 15 May 2015 17:23:52 -0700 (PDT) Received: from topkick.lan (x5ce62600.dyn.telefonica.de. [92.230.38.0]) by mx.google.com with ESMTPSA id yr1sm4841060wjc.37.2015.05.15.17.23.51 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 15 May 2015 17:23:52 -0700 (PDT) From: Sebastian Hesselbarth To: Sebastian Hesselbarth Subject: [PATCH 09/14] clk: berlin: prepare simple-mfd conversion Date: Sat, 16 May 2015 02:23:38 +0200 Message-Id: <1431735823-28006-10-git-send-email-sebastian.hesselbarth@gmail.com> In-Reply-To: <1431735823-28006-1-git-send-email-sebastian.hesselbarth@gmail.com> References: <1431735823-28006-1-git-send-email-sebastian.hesselbarth@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150515_172415_268107_E5D1E6CF X-CRM114-Status: UNSURE ( 9.02 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.8 (/) Cc: Antoine Ternart , Stephen Boyd , linux-arm-kernel@lists.infradead.org, Arnd Bergmann 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=-4.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_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 From: Antoine Tenart Prepare conversion of berlin clk drivers to a simple-mfd sub-node by checking for parent node compatible. If parent node is "syscon" compatible use it for of_iomap instead of the own node. Signed-off-by: Antoine Tenart Acked-by: Stephen Boyd Signed-off-by: Sebastian Hesselbarth --- Cc: Stephen Boyd --- drivers/clk/berlin/bg2.c | 6 ++++++ drivers/clk/berlin/bg2q.c | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/drivers/clk/berlin/bg2.c b/drivers/clk/berlin/bg2.c index 515fb133495c..d8e57097518b 100644 --- a/drivers/clk/berlin/bg2.c +++ b/drivers/clk/berlin/bg2.c @@ -502,11 +502,15 @@ static const struct berlin2_gate_data bg2_gates[] __initconst = { static void __init berlin2_clock_setup(struct device_node *np) { + struct device_node *parent_np = of_get_parent(np); const char *parent_names[9]; struct clk *clk; u8 avpll_flags = 0; int n; + if (of_device_is_compatible(parent_np, "syscon")) + np = parent_np; + gbase = of_iomap(np, 0); if (!gbase) return; @@ -689,3 +693,5 @@ CLK_OF_DECLARE(berlin2_clock, "marvell,berlin2-chip-ctrl", berlin2_clock_setup); CLK_OF_DECLARE(berlin2cd_clock, "marvell,berlin2cd-chip-ctrl", berlin2_clock_setup); +CLK_OF_DECLARE(berlin2_clk, "marvell,berlin2-clk", + berlin2_clock_setup); diff --git a/drivers/clk/berlin/bg2q.c b/drivers/clk/berlin/bg2q.c index 440ef81ab15c..638a649ebed7 100644 --- a/drivers/clk/berlin/bg2q.c +++ b/drivers/clk/berlin/bg2q.c @@ -290,10 +290,14 @@ static const struct berlin2_gate_data bg2q_gates[] __initconst = { static void __init berlin2q_clock_setup(struct device_node *np) { + struct device_node *parent_np = of_get_parent(np); const char *parent_names[9]; struct clk *clk; int n; + if (of_device_is_compatible(parent_np, "syscon")) + np = parent_np; + gbase = of_iomap(np, 0); if (!gbase) { pr_err("%s: Unable to map global base\n", np->full_name); @@ -386,3 +390,5 @@ bg2q_fail: } CLK_OF_DECLARE(berlin2q_clock, "marvell,berlin2q-chip-ctrl", berlin2q_clock_setup); +CLK_OF_DECLARE(berlin2q_clk, "marvell,berlin2q-clk", + berlin2q_clock_setup);