linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: sboyd@codeaurora.org (Stephen Boyd)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 17/22] msm: Migrate to clock rate voting
Date: Thu, 16 Dec 2010 16:50:01 -0800	[thread overview]
Message-ID: <1292547006-19741-18-git-send-email-sboyd@codeaurora.org> (raw)
In-Reply-To: <1292547006-19741-1-git-send-email-sboyd@codeaurora.org>

Add the appropriate clock voters and integrate clock.c with the
voting driver so that voting works appropriately.

Reviewed-by: Saravana Kannan <skannan@codeaurora.org>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
---
 arch/arm/mach-msm/clock.c           |   23 +++++++++++++----------
 arch/arm/mach-msm/devices-msm7x30.c |   10 ++++++++++
 arch/arm/mach-msm/devices-qsd8x50.c |    9 +++++++++
 3 files changed, 32 insertions(+), 10 deletions(-)

diff --git a/arch/arm/mach-msm/clock.c b/arch/arm/mach-msm/clock.c
index b6b7e7c..c505e30 100644
--- a/arch/arm/mach-msm/clock.c
+++ b/arch/arm/mach-msm/clock.c
@@ -18,7 +18,10 @@
 #include <linux/list.h>
 #include <linux/err.h>
 #include <linux/spinlock.h>
-#include <linux/pm_qos_params.h>
+#include <linux/mutex.h>
+#include <linux/clk.h>
+#include <linux/string.h>
+#include <linux/module.h>
 
 #include "clock.h"
 
@@ -139,16 +142,10 @@ int clk_set_flags(struct clk *clk, unsigned long flags)
 }
 EXPORT_SYMBOL(clk_set_flags);
 
-/* EBI1 is the only shared clock that several clients want to vote on as of
- * this commit. If this changes in the future, then it might be better to
- * make clk_min_rate handle the voting or make ebi1_clk_set_min_rate more
- * generic to support different clocks.
- */
-static struct clk *ebi1_clk;
-
 void __init msm_clock_init(struct clk *clock_tbl, unsigned num_clocks)
 {
 	unsigned n;
+	struct clk *clk;
 
 	/* Do SoC-speficic clock init operations. */
 	msm_clk_soc_init();
@@ -160,9 +157,15 @@ void __init msm_clock_init(struct clk *clock_tbl, unsigned num_clocks)
 	}
 	mutex_unlock(&clocks_mutex);
 
-	ebi1_clk = clk_get(NULL, "ebi1_clk");
-	BUG_ON(ebi1_clk == NULL);
+	for (n = 0; n < num_clocks; n++) {
+		clk = &clock_tbl[n];
+		if (clk->flags & CLKFLAG_HANDLE) {
+			struct clk *agg_clk = clk_get(NULL, clk->aggregator);
+			BUG_ON(IS_ERR(agg_clk));
 
+			clk_set_parent(clk, agg_clk);
+		}
+	}
 }
 
 /* The bootloader and/or AMSS may have left various clocks enabled.
diff --git a/arch/arm/mach-msm/devices-msm7x30.c b/arch/arm/mach-msm/devices-msm7x30.c
index 72da7cc..f18d86b 100644
--- a/arch/arm/mach-msm/devices-msm7x30.c
+++ b/arch/arm/mach-msm/devices-msm7x30.c
@@ -23,6 +23,7 @@
 #include <mach/board.h>
 
 #include "devices.h"
+#include "clock-voter.h"
 #include "smd_private.h"
 
 #include <asm/mach/flash.h>
@@ -156,6 +157,15 @@ struct clk msm_clocks_7x30[] = {
 	CLK_7X30("vfe_pclk",	VFE_P_CLK,	NULL, OFF),
 	CLK_7X30("vpe_clk",	VPE_CLK,	NULL, 0),
 
+	CLK_VOTER("ebi1_dtv_clk", EBI_DTV, "pbus_clk", NULL, 0),
+	CLK_VOTER("ebi1_kgsl_clk", EBI_KGSL, "pbus_clk", NULL, 0),
+	CLK_VOTER("ebi1_lcdc_clk", EBI_LCDC, "pbus_clk", NULL, 0),
+	CLK_VOTER("ebi1_mddi_clk", EBI_MDDI, "pbus_clk", NULL, 0),
+	CLK_VOTER("ebi1_tv_clk", EBI_TV, "pbus_clk", NULL, 0),
+	CLK_VOTER("ebi1_usb_clk", EBI_USB, "pbus_clk", NULL, 0),
+	CLK_VOTER("ebi1_vcd_clk", EBI_VCD, "pbus_clk", NULL, 0),
+	CLK_VOTER("ebi1_vfe_clk", EBI_VFE, "pbus_clk", NULL, 0),
+
 	/* 7x30 v2 hardware only. */
 	CLK_7X30("csi_clk",	CSI0_CLK,	NULL, 0),
 	CLK_7X30("csi_pclk",	CSI0_P_CLK,	NULL, 0),
diff --git a/arch/arm/mach-msm/devices-qsd8x50.c b/arch/arm/mach-msm/devices-qsd8x50.c
index 271c8bb..3b11d28 100644
--- a/arch/arm/mach-msm/devices-qsd8x50.c
+++ b/arch/arm/mach-msm/devices-qsd8x50.c
@@ -28,6 +28,7 @@
 
 #include <mach/mmc.h>
 #include "clock-pcom.h"
+#include "clock-voter.h"
 
 static struct resource resources_uart3[] = {
 	{
@@ -106,6 +107,14 @@ struct clk msm_clocks_8x50[] = {
 	CLK_PCOM("usb_hs3_clk",	USB_HS3_CLK,	NULL, OFF),
 	CLK_PCOM("usb_hs3_pclk",	USB_HS3_P_CLK,	NULL, OFF),
 	CLK_PCOM("usb_phy_clk",	USB_PHY_CLK,	NULL, 0),
+
+	CLK_VOTER("ebi1_acpu_clk", EBI_ACPU, "ebi1_clk", NULL, 0),
+	CLK_VOTER("ebi1_kgsl_clk", EBI_KGSL, "ebi1_clk", NULL, 0),
+	CLK_VOTER("ebi1_lcdc_clk", EBI_LCDC, "ebi1_clk", NULL, 0),
+	CLK_VOTER("ebi1_mddi_clk", EBI_MDDI, "ebi1_clk", NULL, 0),
+	CLK_VOTER("ebi1_tv_clk", EBI_TV, "ebi1_clk", NULL, 0),
+	CLK_VOTER("ebi1_usb_clk", EBI_USB, "ebi1_clk", NULL, 0),
+	CLK_VOTER("ebi1_vfe_clk", EBI_VFE, "ebi1_clk", NULL, 0),
 };
 
 unsigned msm_num_clocks_8x50 = ARRAY_SIZE(msm_clocks_8x50);
-- 
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.

  parent reply	other threads:[~2010-12-17  0:50 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-17  0:49 [PATCH 00/22] MSM clock driver updates Stephen Boyd
2010-12-17  0:49 ` [PATCH 01/22] msm: clock: Remove unused code and definitions Stephen Boyd
2010-12-17  0:49 ` [PATCH 02/22] msm: clock: Move debugfs code from clock.c to clock-debug.c Stephen Boyd
2010-12-17  0:49 ` [PATCH 03/22] msm: clock: Invert debugfs directory layout Stephen Boyd
2010-12-17  0:49 ` [PATCH 04/22] msm: clock: Add support for more proc_comm clocks Stephen Boyd
2010-12-17  0:49 ` [PATCH 05/22] msm: clock-7x30: Add 7x30 local clock driver Stephen Boyd
2010-12-17  0:49 ` [PATCH 06/22] msm: clock-7x30: Update clock table Stephen Boyd
2010-12-17  0:49 ` [PATCH 07/22] msm: clock: Refactor clock-7x30 into generic clock-local driver Stephen Boyd
2010-12-17  0:49 ` [PATCH 08/22] msm: clock-8x60: Add msm8x60 local clock driver Stephen Boyd
2010-12-17  0:49 ` [PATCH 09/22] msm: clock: Remove references to clk_ops_pcom Stephen Boyd
2010-12-17  0:49 ` [PATCH 10/22] msm: Move 8x60 to the real clock driver Stephen Boyd
2010-12-17  0:49 ` [PATCH 11/22] msm: clock Add debugfs interface to measure clock rates Stephen Boyd
2010-12-17  0:49 ` [PATCH 12/22] msm: clock: Add list_rate debugfs nodes for locally-controlled clocks Stephen Boyd
2010-12-17  0:49 ` [PATCH 13/22] msm: clock: Push down clock count and locking into sub drivers Stephen Boyd
2010-12-17  0:49 ` [PATCH 14/22] msm: clock: Support clk_set_parent() clk_ops Stephen Boyd
2010-12-17  0:49 ` [PATCH 15/22] msm: clock-pcom: Add pbus specific clock ops Stephen Boyd
2010-12-17  0:50 ` [PATCH 16/22] msm: clock: Implement rate voting Stephen Boyd
2010-12-17  0:50 ` Stephen Boyd [this message]
2010-12-17  0:50 ` [PATCH 18/22] msm: clock: Migrate to clkdev Stephen Boyd
2010-12-17  0:50 ` [PATCH 19/22] msm: iommu: Add bus clocks to platform data Stephen Boyd
2010-12-17  0:50 ` [PATCH 20/22] msm: iommu: Clock control for the IOMMU driver Stephen Boyd
2010-12-17  0:50 ` [PATCH 21/22] msm: iommu: Rework clock logic and add IOMMU bus clock control Stephen Boyd
2010-12-17  0:50 ` [PATCH 22/22] msm: clock-8x60: Don't keep IOMMU clocks on at boot Stephen Boyd

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=1292547006-19741-18-git-send-email-sboyd@codeaurora.org \
    --to=sboyd@codeaurora.org \
    --cc=linux-arm-kernel@lists.infradead.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).