linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Walker <dwalker@codeaurora.org>
To: linux-arm-msm@vger.kernel.org
Cc: Daniel Walker <dwalker@codeaurora.org>
Subject: [PATCH 3/7] msm: update clk rate to use min/max values
Date: Tue, 27 Jul 2010 14:04:28 -0700	[thread overview]
Message-ID: <1280264672-19364-3-git-send-email-dwalker@codeaurora.org> (raw)
In-Reply-To: <1280264672-19364-1-git-send-email-dwalker@codeaurora.org>

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@codeaurora.org>
---
 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.

  parent reply	other threads:[~2010-07-27 21:04 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-27 21:04 [PATCH 1/7] msm: fb: initial framebuffer support Daniel Walker
2010-07-27 21:04 ` [PATCH 2/7] msm: gpio support for trout Daniel Walker
2010-07-27 21:04 ` Daniel Walker [this message]
2010-07-28 16:22   ` [PATCH 3/7] msm: update clk rate to use min/max values Neil Leeder
2010-07-28 16:41     ` Daniel Walker
2010-07-27 21:04 ` [PATCH 4/7] msm: add CLK_MINMAX to pmdh_clk Daniel Walker
2010-07-27 21:04 ` [PATCH 5/7] drivers: video: msm: fix hang on disable_irq Daniel Walker
2010-07-27 21:04 ` [PATCH 6/7] drivers: msm: video: add dev_set_name call Daniel Walker
2010-07-27 21:04 ` [PATCH 7/7] driver: video: msm: change mddi clock name to pmdh_clk Daniel Walker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1280264672-19364-3-git-send-email-dwalker@codeaurora.org \
    --to=dwalker@codeaurora.org \
    --cc=linux-arm-msm@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).