From mboxrd@z Thu Jan 1 00:00:00 1970 From: Russell King Subject: Re: ARM clock API to PowerPC Date: Sat, 15 Aug 2009 13:43:47 +0100 Message-ID: <20090815124347.GB16112@flint.arm.linux.org.uk> References: <1250063825.15143.43.camel@pasglop> <20090812111954.GB31596@zod.rchland.ibm.com> <4A90486C-8BF5-428C-9FD8-830D822C0D40@kernel.crashing.org> <1250112599.3587.21.camel@pasglop> <3A45394FD742FA419B760BB8D398F9ED59DE33@zch01exm26.fsl.freescale.net> <1250242149.24143.36.camel@pasglop> <1250251664.24143.39.camel@pasglop> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <1250251664.24143.39.camel@pasglop> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: devicetree-discuss-bounces+gldd-devicetree-discuss=m.gmane.org-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org Errors-To: devicetree-discuss-bounces+gldd-devicetree-discuss=m.gmane.org-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org To: Benjamin Herrenschmidt Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org, John Jacques , linuxppc-dev list , Torez Smith , Guennadi Liakhovetski List-Id: devicetree@vger.kernel.org On Fri, Aug 14, 2009 at 10:07:44PM +1000, Benjamin Herrenschmidt wrote: > My idea is that struct clock would contain function pointers for the > enable/disable/get_rate/ etc... methods If you look at OMAP, doing that gets very expensive, both in terms of number of lines of code, size of structure and maintainence thereof. Neither does a 'clk_ops' structure containing all of the function pointers work either for OMAP (OMAP has such a structure just for enable and disable methods, of which there are about two or three to chose from, but the rounding, set_rate and propagation methods are per-clk. This balance seems to work well for OMAP.) FYI, there are 140 struct clk definitions for OMAP24xx, and 215 for OMAP34xx, all statically initialized. See arch/arm/mach-omap2/clock?4xx.h -- Russell King