From patchwork Thu Oct 22 07:58:56 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jean-Francois Moine X-Patchwork-Id: 7462891 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 35418BEEA4 for ; Thu, 22 Oct 2015 08:01:11 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4953B20921 for ; Thu, 22 Oct 2015 08:01:10 +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 5BC9E2082B for ; Thu, 22 Oct 2015 08:01:08 +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 1ZpAml-0001K3-RR; Thu, 22 Oct 2015 07:59:43 +0000 Received: from smtp3-g21.free.fr ([2a01:e0c:1:1599::12]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZpAmi-00018U-Qx for linux-arm-kernel@lists.infradead.org; Thu, 22 Oct 2015 07:59:42 +0000 Received: from OPI2 (unknown [IPv6:2a01:e35:2f5c:9de0:56e4:bdff:feb4:8c92]) by smtp3-g21.free.fr (Postfix) with ESMTPS id 2CA0EA61C6; Thu, 22 Oct 2015 09:58:59 +0200 (CEST) Date: Thu, 22 Oct 2015 09:58:56 +0200 From: Jean-Francois Moine To: Hans de Goede Subject: Re: [PATCH 0/6] ARM: sunxi: Introduce Allwinner H3 support Message-ID: <20151022095857.50e2330b@OPI2> In-Reply-To: <5627E515.6050505@redhat.com> References: <1445444007-4260-1-git-send-email-jenskuske@gmail.com> <5627E515.6050505@redhat.com> X-Mailer: Claws Mail 3.13.0 (GTK+ 2.24.28; arm-unknown-linux-gnueabihf) MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151022_005941_065272_B5B4AEEF X-CRM114-Status: GOOD ( 14.68 ) X-Spam-Score: -2.6 (--) 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: devicetree@vger.kernel.org, Vishnu Patekar , Mike Turquette , "Reinder E.N. de Haan" , Emilio =?UTF-8?B?TMOzcGV6?= , Linus Walleij , linux-sunxi@googlegroups.com, linux-kernel@vger.kernel.org, Chen-Yu Tsai , Rob Herring , Jens Kuske , Philipp Zabel , Maxime Ripard , linux-arm-kernel@lists.infradead.org, zhao_steven@263.net 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,FREEMAIL_FROM, 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 On Wed, 21 Oct 2015 21:18:45 +0200 Hans de Goede wrote: > Great to see that you've started working on this again. Last weekend I > ended up working on this too together with Reinder E.N. de Haan > (added to the Cc). > > We took a slightly different approach for the gates clocks, see: > > https://github.com/jwrdegoede/linux-sunxi/commits/sunxi-wip > > And specifically: > > https://github.com/jwrdegoede/linux-sunxi/commit/80a1afe319d5d1a0c426d42e75d37f0c64e8ea0b > > Combined with: > > https://github.com/jwrdegoede/linux-sunxi/commit/d508da5feb5048f6674d6b24b58ac9058fb9d877 > > This deals with the per gate parents the same way the rockchip > clock code does, and it seems to be quite a bit less code then your solution. Here is a simpler patch: diff --git a/drivers/clk/sunxi/clk-simple-gates.c b/drivers/clk/sunxi/clk-simple-gates.c index 6ce9118..8fecaeab 100644 --- a/drivers/clk/sunxi/clk-simple-gates.c +++ b/drivers/clk/sunxi/clk-simple-gates.c @@ -35,6 +35,7 @@ static void __init sunxi_simple_gates_setup(struct device_node *node, void __iomem *reg; const __be32 *p; int number, i = 0, j; + bool parent_per_gate; u8 clk_bit; u32 index; @@ -43,6 +44,7 @@ static void __init sunxi_simple_gates_setup(struct device_node *node, return; clk_parent = of_clk_get_parent_name(node, 0); + parent_per_gate = of_clk_get_parent_count(node) != 1; clk_data = kmalloc(sizeof(struct clk_onecell_data), GFP_KERNEL); if (!clk_data) @@ -58,6 +60,8 @@ static void __init sunxi_simple_gates_setup(struct device_node *node, of_property_for_each_u32(node, "clock-indices", prop, p, index) { of_property_read_string_index(node, "clock-output-names", i, &clk_name); + if (parent_per_gate) + clk_parent = of_clk_get_parent_name(node, i); clk_reg = reg + 4 * (index / 32); clk_bit = index % 32;