From 832b763db235da8e62f7b6ab02bcb8ad6bcb7a01 Mon Sep 17 00:00:00 2001
From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
Date: Thu, 2 Apr 2009 16:48:41 +0300
Subject: [PATCH] DSS2: Add function to get DSS logic clock rate

---
 drivers/video/omap2/dss/dispc.c |   15 +++++++++++++++
 drivers/video/omap2/dss/dss.h   |    1 +
 2 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
index 2480a03..1bc23f7 100644
--- a/drivers/video/omap2/dss/dispc.c
+++ b/drivers/video/omap2/dss/dispc.c
@@ -1850,6 +1850,21 @@ unsigned long dispc_fclk_rate(void)
 	return r;
 }
 
+unsigned long dispc_lclk_rate(void)
+{
+	int lcd;
+	unsigned long r;
+	u32 l;
+
+	l = dispc_read_reg(DISPC_DIVISOR);
+
+	lcd = FLD_GET(l, 23, 16);
+
+	r = dispc_fclk_rate();
+
+	return r / lcd;
+}
+
 unsigned long dispc_pclk_rate(void)
 {
 	int lcd, pcd;
diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h
index bac5ece..0be42b6 100644
--- a/drivers/video/omap2/dss/dss.h
+++ b/drivers/video/omap2/dss/dss.h
@@ -294,6 +294,7 @@ bool dispc_trans_key_enabled(enum omap_channel ch);
 
 void dispc_set_lcd_timings(struct omap_video_timings *timings);
 unsigned long dispc_fclk_rate(void);
+unsigned long dispc_lclk_rate(void);
 unsigned long dispc_pclk_rate(void);
 void dispc_set_pol_freq(struct omap_panel *panel);
 void find_lck_pck_divs(bool is_tft, unsigned long req_pck, unsigned long fck,
-- 
1.5.6.5

