summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTarun Kanti DebBarma <tarun.kanti@ti.com>2012-04-18 16:14:49 +0530
committerXavier Boudet <x-boudet@ti.com>2012-07-10 17:26:53 +0200
commit0dc70cd67684df22705f6601ec39add64cd8637d (patch)
treebdadd1630672291b4086138d73cc97afaa26e000
parent36adf146af3b5b926e1028e48111f3e6a02e8943 (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.c15
-rw-r--r--arch/arm/plat-omap/include/plat/omap_hwmod.h2
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