From: Tarun Kanti DebBarma Date: Wed, 4 Jul 2012 11:00:48 +0000 (-0600) Subject: ARM: OMAP2+: hwmod: add omap_hwmod_get_main_clk() API X-Git-Tag: v3.6-rc1~134^2~1^2~7^2^3~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bed9d1bb4ed8c9bdaca77d31a2562c3a9dae43a7;p=profile%2Fivi%2Fkernel-adaptation-intel-automotive.git ARM: OMAP2+: hwmod: add omap_hwmod_get_main_clk() API Add an API to get main clock name associated with a given @oh. This will avoid the need to construct fclk names during early initialization in order to get fclk handle using clk_get(). Signed-off-by: Tarun Kanti DebBarma Cc: Benoit Cousson Cc: Paul Walmsley Cc: Tony Lindgren Cc: Kevin Hilman Cc: Rajendra Nayak Cc: Santosh Shilimkar Acked-by: Benoit Cousson Signed-off-by: Paul Walmsley --- diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c index 7731936..a89214e 100644 --- a/arch/arm/mach-omap2/omap_hwmod.c +++ b/arch/arm/mach-omap2/omap_hwmod.c @@ -3401,3 +3401,18 @@ int omap_hwmod_pad_route_irq(struct omap_hwmod *oh, int pad_idx, int irq_idx) return 0; } + +/** + * omap_hwmod_get_main_clk - get pointer to main clock name + * @oh: struct omap_hwmod * + * + * Returns the main clock name assocated with @oh upon success, + * or NULL if @oh is NULL. + */ +const char *omap_hwmod_get_main_clk(struct omap_hwmod *oh) +{ + if (!oh) + return NULL; + + return oh->main_clk; +} diff --git a/arch/arm/plat-omap/include/plat/omap_hwmod.h b/arch/arm/plat-omap/include/plat/omap_hwmod.h index c835b71..da22acd 100644 --- a/arch/arm/plat-omap/include/plat/omap_hwmod.h +++ b/arch/arm/plat-omap/include/plat/omap_hwmod.h @@ -629,6 +629,8 @@ int omap_hwmod_no_setup_reset(struct omap_hwmod *oh); int omap_hwmod_pad_route_irq(struct omap_hwmod *oh, int pad_idx, int irq_idx); +const char *omap_hwmod_get_main_clk(struct omap_hwmod *oh); + /* * Chip variant-specific hwmod init routines - XXX should be converted * to use initcalls once the initial boot ordering is straightened out