From mboxrd@z Thu Jan 1 00:00:00 1970 From: Arnd Bergmann Subject: Re: [PATCH v4 2/6] clk: sunxi: Add H3 clocks support Date: Fri, 30 Oct 2015 09:28:55 +0100 Message-ID: <3751073.AWmm18dvKK@wuerfel> References: <1445964626-6484-1-git-send-email-jenskuske@gmail.com> <1445964626-6484-3-git-send-email-jenskuske@gmail.com> Reply-To: arnd-r2nGTMty4D4@public.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Return-path: In-Reply-To: <1445964626-6484-3-git-send-email-jenskuske-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , To: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org Cc: Jens Kuske , Maxime Ripard , Chen-Yu Tsai , Michael Turquette , Linus Walleij , Rob Herring , Philipp Zabel , Emilio =?ISO-8859-1?Q?L=F3pez?= , 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 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. Arnd