diff options
author | Tarun Kanti DebBarma <tarun.kanti@ti.com> | 2012-04-18 16:14:49 +0530 |
---|---|---|
committer | Guillaume Aubertin <g-aubertin@ti.com> | 2012-06-26 12:21:14 +0200 |
commit | 4b4f02323ca835e4a6e5b9de8b8b09e782c36ab7 (patch) | |
tree | c58379c2fb80ec1aedcc9cdb67e38dbb47110cd2 | |
parent | e4d3eb4fa12c9a302f697dd962bdd38cc40deaf4 (diff) |
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().
Cc: Cousson, Benoit <b-cousson@ti.com>
Cc: Paul Walmsley <paul@pwsan.com>
Cc: Tony Lindgren <tony@atomide.com>
Cc: Kevin Hilman <khilman@ti.com>
Cc: Rajendra Nayak <rnayak@ti.com>
Cc: Santosh Shilimkar <santosh.shilimkar@ti.com>
Signed-off-by: Tarun Kanti DebBarma <tarun.kanti@ti.com>
-rw-r--r-- | arch/arm/mach-omap2/omap_hwmod.c | 15 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/plat/omap_hwmod.h | 2 |
2 files changed, 17 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c index bfbf11328bec..3e260ef46a3e 100644 --- a/arch/arm/mach-omap2/omap_hwmod.c +++ b/arch/arm/mach-omap2/omap_hwmod.c @@ -2950,3 +2950,18 @@ struct device *omap_hwmod_name_get_dev(const char *oh_name) return &oh->od->pdev->dev; } EXPORT_SYMBOL(omap_hwmod_name_get_dev); + +/** + * 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 4e4c041faf40..739188e03cf6 100644 --- a/arch/arm/plat-omap/include/plat/omap_hwmod.h +++ b/arch/arm/plat-omap/include/plat/omap_hwmod.h @@ -637,6 +637,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 |