diff mbox

[v2,1/2] OMAP2PLUS:DSS2: add opt_clock_available in pdata

Message ID 1298905363-28871-2-git-send-email-sumit.semwal@ti.com (mailing list archive)
State Superseded
Delegated to: Tomi Valkeinen
Headers show

Commit Message

Sumit Semwal Feb. 28, 2011, 3:02 p.m. UTC
None
diff mbox

Patch

diff --git a/arch/arm/mach-omap2/display.c b/arch/arm/mach-omap2/display.c
index 5ab6a74..9f4f862 100644
--- a/arch/arm/mach-omap2/display.c
+++ b/arch/arm/mach-omap2/display.c
@@ -42,6 +42,25 @@  static struct omap_device_pm_latency omap_dss_latency[] = {
 	},
 };
 
+static bool opt_clock_available(const char *clk_role)
+{
+	int i;
+	struct omap_hwmod *oh;
+
+	/* opt_clks are always associated with dss hwmod */
+	oh = omap_hwmod_lookup("dss_core");
+	if (!oh) {
+		pr_err("Could not look up dss_core.\n");
+		return -ENODEV;
+	}
+
+	for (i = 0; i < oh->opt_clks_cnt; i++) {
+		if (!strcmp(oh->opt_clks[i].role, clk_role))
+			return true;
+	}
+	return false;
+}
+
 int __init omap_display_init(struct omap_dss_board_info *board_data)
 {
 	int r = 0;
@@ -76,6 +95,7 @@  int __init omap_display_init(struct omap_dss_board_info *board_data)
 
 	pdata.board_data = board_data;
 	pdata.board_data->get_last_off_on_transaction_id = NULL;
+	pdata.opt_clock_available = opt_clock_available;
 
 	for (i = 0; i < oh_count; i++) {
 		oh = omap_hwmod_lookup(oh_name[i]);
diff --git a/arch/arm/plat-omap/include/plat/display.h b/arch/arm/plat-omap/include/plat/display.h
index 2fb057e..4101bcd 100644
--- a/arch/arm/plat-omap/include/plat/display.h
+++ b/arch/arm/plat-omap/include/plat/display.h
@@ -240,6 +240,8 @@  static inline int omap_display_init(struct omap_dss_board_info *board_data)
 struct omap_display_platform_data {
 	struct omap_dss_board_info *board_data;
 	/* TODO: Additional members to be added when PM is considered */
+
+	bool (*opt_clock_available)(const char *clk_role);
 };
 
 struct omap_video_timings {