From patchwork Mon Feb 22 18:20:46 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andre Przywara X-Patchwork-Id: 8381631 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 8927A9F2F0 for ; Mon, 22 Feb 2016 18:23:17 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B5AB520527 for ; Mon, 22 Feb 2016 18:23:16 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id DAF7220520 for ; Mon, 22 Feb 2016 18:23:15 +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 1aXv72-0001kf-3e; Mon, 22 Feb 2016 18:21:36 +0000 Received: from foss.arm.com ([217.140.101.70]) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1aXv6p-0001g7-B7 for linux-arm-kernel@lists.infradead.org; Mon, 22 Feb 2016 18:21:24 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 155623A8; Mon, 22 Feb 2016 10:20:11 -0800 (PST) Received: from e104803-lin.lan (unknown [10.1.203.153]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 5CD733F213; Mon, 22 Feb 2016 10:21:01 -0800 (PST) From: Andre Przywara To: Maxime Ripard , Chen-Yu Tsai , linux-sunxi@googlegroups.com Subject: [PATCH v3 00/10] arm64: Introduce Allwinner A64 and Pine64 support Date: Mon, 22 Feb 2016 18:20:46 +0000 Message-Id: <1456165255-31013-2-git-send-email-andre.przywara@arm.com> X-Mailer: git-send-email 2.6.4 In-Reply-To: <1456165255-31013-1-git-send-email-andre.przywara@arm.com> References: <1456165255-31013-1-git-send-email-andre.przywara@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160222_102123_417528_E0B168C1 X-CRM114-Status: GOOD ( 13.44 ) X-Spam-Score: -6.9 (------) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Arnd Bergmann , =?UTF-8?q?Emilio=20L=C3=B3pez?= , Michael Turquette , Stephen Boyd , linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org 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.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, 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 Subject: [PATCH v3 01/10] clk: sunxi: allow PLL6 clock to be reused Currently we hard-code the base name for the PLL6 clock for both the sun4i and sun6i variants in the driver (pll6 and pll6x2, respectively). This unfortunately denies reusing this clock for the H3 and A64 PLL8 clock, which is the same otherwise. Remove the hard-coded name in the source code and replace it with an appropriate index into the clock-output-names array in the DT. This is compatible with all current device trees, since they all carry the hard-coded base name in there. Signed-off-by: Andre Przywara --- drivers/clk/sunxi/clk-factors.c | 3 ++- drivers/clk/sunxi/clk-factors.h | 1 + drivers/clk/sunxi/clk-sunxi.c | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/clk/sunxi/clk-factors.c b/drivers/clk/sunxi/clk-factors.c index ddefe96..7daf01d 100644 --- a/drivers/clk/sunxi/clk-factors.c +++ b/drivers/clk/sunxi/clk-factors.c @@ -202,7 +202,8 @@ struct clk *sunxi_factors_register(struct device_node *node, if (data->name) clk_name = data->name; else - of_property_read_string(node, "clock-output-names", &clk_name); + of_property_read_string_index(node, "clock-output-names", + data->name_idx, &clk_name); factors = kzalloc(sizeof(struct clk_factors), GFP_KERNEL); if (!factors) diff --git a/drivers/clk/sunxi/clk-factors.h b/drivers/clk/sunxi/clk-factors.h index 1e63c5b..3a7da86 100644 --- a/drivers/clk/sunxi/clk-factors.h +++ b/drivers/clk/sunxi/clk-factors.h @@ -36,6 +36,7 @@ struct factors_data { void (*getter)(struct factors_request *req); void (*recalc)(struct factors_request *req); const char *name; + int name_idx; }; struct clk_factors { diff --git a/drivers/clk/sunxi/clk-sunxi.c b/drivers/clk/sunxi/clk-sunxi.c index 99f60ef..53f5927 100644 --- a/drivers/clk/sunxi/clk-sunxi.c +++ b/drivers/clk/sunxi/clk-sunxi.c @@ -530,14 +530,14 @@ static const struct factors_data sun4i_pll6_data __initconst = { .enable = 31, .table = &sun4i_pll5_config, .getter = sun4i_get_pll5_factors, - .name = "pll6", + .name_idx = 2, }; static const struct factors_data sun6i_a31_pll6_data __initconst = { .enable = 31, .table = &sun6i_a31_pll6_config, .getter = sun6i_a31_get_pll6_factors, - .name = "pll6x2", + .name_idx = 1, }; static const struct factors_data sun5i_a13_ahb_data __initconst = {