[PATCH 3/7] msm: update clk rate to use min/max values

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Some clocks are set with a min and max values as opposed to one
set value. I've added this as a setting for the MSM framebuffer
driver and updated the platform data.

Signed-off-by: Daniel Walker <dwalker@xxxxxxxxxxxxxx>
---
 arch/arm/mach-msm/board-trout-panel.c   |    3 ++-
 arch/arm/mach-msm/include/mach/msm_fb.h |    3 ++-
 drivers/video/msm/mddi.c                |   12 +++++++++---
 3 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/arch/arm/mach-msm/board-trout-panel.c b/arch/arm/mach-msm/board-trout-panel.c
index 0fa5a35..8f07b8c 100644
--- a/arch/arm/mach-msm/board-trout-panel.c
+++ b/arch/arm/mach-msm/board-trout-panel.c
@@ -565,7 +565,8 @@ struct msm_mddi_bridge_platform_data toshiba_client_data = {
 };
 
 static struct msm_mddi_platform_data mddi_pdata = {
-	.clk_rate = 122880000,
+	.min_clk_rate = 122880000,
+	.min_clk_rate = 98304000,
 	.power_client = trout_mddi_power_client,
 	.fb_resource = resources_msm_fb,
 	.num_clients = 1,
diff --git a/arch/arm/mach-msm/include/mach/msm_fb.h b/arch/arm/mach-msm/include/mach/msm_fb.h
index 1f4fc81..9d15d7a 100644
--- a/arch/arm/mach-msm/include/mach/msm_fb.h
+++ b/arch/arm/mach-msm/include/mach/msm_fb.h
@@ -79,7 +79,8 @@ struct msm_mddi_client_data {
 };
 
 struct msm_mddi_platform_data {
-	unsigned int clk_rate;
+	unsigned int max_clk_rate;
+	unsigned int min_clk_rate;
 	void (*power_client)(struct msm_mddi_client_data *, int on);
 
 	/* fixup the mfr name, product id */
diff --git a/drivers/video/msm/mddi.c b/drivers/video/msm/mddi.c
index 844eff3..1192365 100644
--- a/drivers/video/msm/mddi.c
+++ b/drivers/video/msm/mddi.c
@@ -30,6 +30,8 @@
 #include <mach/irqs.h>
 #include <mach/board.h>
 #include <mach/msm_fb.h>
+#include <mach/clk.h>
+
 #include "mddi_hw.h"
 
 #define FLAG_DISABLE_HIBERNATION 0x0001
@@ -625,7 +627,8 @@ static struct mddi_info mddi_info[2];
 
 static int __init mddi_clk_setup(struct platform_device *pdev,
 				 struct mddi_info *mddi,
-				 unsigned long clk_rate)
+				 unsigned long max_clk_rate,
+				 unsigned long min_clk_rate)
 {
 	int ret;
 
@@ -638,7 +641,10 @@ static int __init mddi_clk_setup(struct platform_device *pdev,
 	ret =  clk_enable(mddi->clk);
 	if (ret)
 		goto fail;
-	ret = clk_set_rate(mddi->clk, clk_rate);
+	ret = clk_set_max_rate(mddi->clk, max_clk_rate);
+	if (ret)
+		goto fail;
+	ret = clk_set_min_rate(mddi->clk, min_clk_rate);
 	if (ret)
 		goto fail;
 	return 0;
@@ -702,7 +708,7 @@ static int __init mddi_probe(struct platform_device *pdev)
 	spin_lock_init(&mddi->int_lock);
 	init_waitqueue_head(&mddi->int_wait);
 
-	ret = mddi_clk_setup(pdev, mddi, pdata->clk_rate);
+	ret = mddi_clk_setup(pdev, mddi, pdata->max_clk_rate, pdata->min_clk_rate);
 	if (ret) {
 		printk(KERN_ERR "mddi: failed to setup clock!\n");
 		goto error_clk_setup;
-- 
1.7.0.4

-- 
Sent by a consultant of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
--
To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [Linux for Sparc]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux