From mboxrd@z Thu Jan 1 00:00:00 1970 From: jenskuske@gmail.com (Jens Kuske) Date: Sun, 1 Nov 2015 14:40:38 +0100 Subject: [PATCH v4 2/6] clk: sunxi: Add H3 clocks support In-Reply-To: <3751073.AWmm18dvKK@wuerfel> References: <1445964626-6484-1-git-send-email-jenskuske@gmail.com> <1445964626-6484-3-git-send-email-jenskuske@gmail.com> <3751073.AWmm18dvKK@wuerfel> Message-ID: <56361656.2040100@gmail.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org Hi, On 30/10/15 09:28, Arnd Bergmann wrote: > On Tuesday 27 October 2015 17:50:22 Jens Kuske wrote: >> + of_property_read_string_index(node, "clock-output-names", >> + i, &clk_name); >> + >> + if (index == 17 || (index >= 29 && index <= 31)) >> + clk_parent = AHB2; >> + else if (index <= 63 || index >= 128) >> + clk_parent = AHB1; >> + else if (index >= 64 && index <= 95) >> + clk_parent = APB1; >> + else if (index >= 96 && index <= 127) >> + clk_parent = APB2; >> + >> + clk_reg = reg + 4 * (index / 32); >> > > Same as for the reset driver, this probably means you should have one > cell to indicate which bus it is for, and another cell for the > index. > This is what Maxime suggested in an earlier version: http://lists.infradead.org/pipermail/linux-arm-kernel/2015-May/344213.html In between I had another version with the parents in DT, but he didn't like that too. Jens From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jens Kuske Subject: Re: [PATCH v4 2/6] clk: sunxi: Add H3 clocks support Date: Sun, 1 Nov 2015 14:40:38 +0100 Message-ID: <56361656.2040100@gmail.com> References: <1445964626-6484-1-git-send-email-jenskuske@gmail.com> <1445964626-6484-3-git-send-email-jenskuske@gmail.com> <3751073.AWmm18dvKK@wuerfel> Reply-To: jenskuske-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Return-path: In-Reply-To: <3751073.AWmm18dvKK@wuerfel> List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , To: Arnd Bergmann , linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org Cc: Maxime Ripard , Chen-Yu Tsai , Michael Turquette , Linus Walleij , Rob Herring , Philipp Zabel , =?UTF-8?Q?Emilio_L=c3=b3pez?= , devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Vishnu Patekar , linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Hans de Goede , linux-sunxi-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org List-Id: devicetree@vger.kernel.org Hi, On 30/10/15 09:28, Arnd Bergmann wrote: > On Tuesday 27 October 2015 17:50:22 Jens Kuske wrote: >> + of_property_read_string_index(node, "clock-output-names", >> + i, &clk_name); >> + >> + if (index == 17 || (index >= 29 && index <= 31)) >> + clk_parent = AHB2; >> + else if (index <= 63 || index >= 128) >> + clk_parent = AHB1; >> + else if (index >= 64 && index <= 95) >> + clk_parent = APB1; >> + else if (index >= 96 && index <= 127) >> + clk_parent = APB2; >> + >> + clk_reg = reg + 4 * (index / 32); >> > > Same as for the reset driver, this probably means you should have one > cell to indicate which bus it is for, and another cell for the > index. > This is what Maxime suggested in an earlier version: http://lists.infradead.org/pipermail/linux-arm-kernel/2015-May/344213.html In between I had another version with the parents in DT, but he didn't like that too. Jens From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752525AbbKANkp (ORCPT ); Sun, 1 Nov 2015 08:40:45 -0500 Received: from mail-wi0-f171.google.com ([209.85.212.171]:37821 "EHLO mail-wi0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751270AbbKANkm (ORCPT ); Sun, 1 Nov 2015 08:40:42 -0500 Subject: Re: [PATCH v4 2/6] clk: sunxi: Add H3 clocks support To: Arnd Bergmann , linux-arm-kernel@lists.infradead.org References: <1445964626-6484-1-git-send-email-jenskuske@gmail.com> <1445964626-6484-3-git-send-email-jenskuske@gmail.com> <3751073.AWmm18dvKK@wuerfel> Cc: Maxime Ripard , Chen-Yu Tsai , Michael Turquette , Linus Walleij , Rob Herring , Philipp Zabel , =?UTF-8?Q?Emilio_L=c3=b3pez?= , devicetree@vger.kernel.org, Vishnu Patekar , linux-kernel@vger.kernel.org, Hans de Goede , linux-sunxi@googlegroups.com From: Jens Kuske Message-ID: <56361656.2040100@gmail.com> Date: Sun, 1 Nov 2015 14:40:38 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <3751073.AWmm18dvKK@wuerfel> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 30/10/15 09:28, Arnd Bergmann wrote: > On Tuesday 27 October 2015 17:50:22 Jens Kuske wrote: >> + of_property_read_string_index(node, "clock-output-names", >> + i, &clk_name); >> + >> + if (index == 17 || (index >= 29 && index <= 31)) >> + clk_parent = AHB2; >> + else if (index <= 63 || index >= 128) >> + clk_parent = AHB1; >> + else if (index >= 64 && index <= 95) >> + clk_parent = APB1; >> + else if (index >= 96 && index <= 127) >> + clk_parent = APB2; >> + >> + clk_reg = reg + 4 * (index / 32); >> > > Same as for the reset driver, this probably means you should have one > cell to indicate which bus it is for, and another cell for the > index. > This is what Maxime suggested in an earlier version: http://lists.infradead.org/pipermail/linux-arm-kernel/2015-May/344213.html In between I had another version with the parents in DT, but he didn't like that too. Jens