[PATCH 00/22] MSM clock driver updates

December 16th, 2010 - 08:00 pm ET by Stephen Boyd | Report spam
This series of patches syncs the MSM clock code in Linus' tree with
the MSM tree @ codeaurora.org. They're prepared against the msm-core
tree (git://codeaurora.org/quic/kernel/da...ux-msm.git msm-core).

* 1 - 4 are cleanups and minor additions to the existing clock driver

* 5 - 6 add support for the 7x30 local clock driver

* 7 - 10 add support for the 8x60 local clock driver; refactor the
7x30 driver into a generic driver and remove the dummy clock
driver in use by 8x60

* 11 - 12 add debugfs aides for locally controlled clocks

* 13 - 17 implement clock rate voting for clocks with multiple
consumers where each consumer requires different minimum rates

* 18 moves the clock driver to clkdev

* 19 - 22 moves the iommu driver to proper usage of the clock driver

I understand the diffstat is rather large, but please review. All feedback
is welcome.

Matt Wagantall (5):
msm: clock: Move debugfs code from clock.c to clock-debug.c
msm: clock: Refactor clock-7x30 into generic clock-local driver
msm: clock-8x60: Add msm8x60 local clock driver
msm: clock Add debugfs interface to measure clock rates
msm: clock: Add list_rate debugfs nodes for locally-controlled clocks

Saravana Kannan (1):
msm: clock-7x30: Add 7x30 local clock driver

Stepan Moskovchenko (3):
msm: iommu: Add bus clocks to platform data
msm: iommu: Clock control for the IOMMU driver
msm: iommu: Rework clock logic and add IOMMU bus clock control

Stephen Boyd (13):
msm: clock: Remove unused code and definitions
msm: clock: Invert debugfs directory layout
msm: clock: Add support for more proc_comm clocks
msm: clock-7x30: Update clock table
msm: clock: Remove references to clk_ops_pcom
msm: Move 8x60 to the real clock driver
msm: clock: Push down clock count and locking into sub drivers
msm: clock: Support clk_set_parent() clk_ops
msm: clock-pcom: Add pbus specific clock ops
msm: clock: Implement rate voting
msm: Migrate to clock rate voting
msm: clock: Migrate to clkdev
msm: clock-8x60: Don't keep IOMMU clocks on at boot

arch/arm/Kconfig | 1 +
arch/arm/mach-msm/Makefile | 10 +-
arch/arm/mach-msm/board-msm8x60.c | 8 +-
arch/arm/mach-msm/clock-7x30.c | 1166 ++++++++++++++
arch/arm/mach-msm/clock-7x30.h | 265 ++--
arch/arm/mach-msm/clock-8x60.c | 1896 +++++++++++++++++++++++
arch/arm/mach-msm/clock-8x60.h | 218 +++
arch/arm/mach-msm/clock-debug.c | 176 +++
arch/arm/mach-msm/clock-local.c | 696 +++++++++
arch/arm/mach-msm/clock-local.h | 233 +++
arch/arm/mach-msm/clock-pcom.c | 102 ++-
arch/arm/mach-msm/clock-pcom.h | 21 +-
arch/arm/mach-msm/clock-voter.c | 202 +++
arch/arm/mach-msm/clock-voter.h | 54 +
arch/arm/mach-msm/clock.c | 244 +
arch/arm/mach-msm/clock.h | 70 +-
arch/arm/mach-msm/devices-msm7x00.c | 32 +-
arch/arm/mach-msm/devices-msm7x30.c | 170 ++-
arch/arm/mach-msm/devices-msm8x60-iommu.c | 5 -
arch/arm/mach-msm/devices-msm8x60.c | 183 +++
arch/arm/mach-msm/devices-qsd8x50.c | 29 +-
arch/arm/mach-msm/devices.h | 9 +-
arch/arm/mach-msm/include/mach/board.h | 4 +-
arch/arm/mach-msm/include/mach/clkdev.h | 23 +
arch/arm/mach-msm/include/mach/iommu.h | 12 +-
arch/arm/mach-msm/include/mach/msm_iomap-8x60.h | 12 +
arch/arm/mach-msm/io.c | 3 +
arch/arm/mach-msm/iommu.c | 57 +-
arch/arm/mach-msm/iommu_dev.c | 204 ++-
arch/arm/mach-msm/proc_comm.h | 1 +
30 files changed, 5524 insertions(+), 582 deletions(-)
create mode 100644 arch/arm/mach-msm/clock-7x30.c
create mode 100644 arch/arm/mach-msm/clock-8x60.c
create mode 100644 arch/arm/mach-msm/clock-8x60.h
create mode 100644 arch/arm/mach-msm/clock-debug.c
create mode 100644 arch/arm/mach-msm/clock-local.c
create mode 100644 arch/arm/mach-msm/clock-local.h
create mode 100644 arch/arm/mach-msm/clock-voter.c
create mode 100644 arch/arm/mach-msm/clock-voter.h
create mode 100644 arch/arm/mach-msm/devices-msm8x60.c
create mode 100644 arch/arm/mach-msm/include/mach/clkdev.h

Sent by an employee 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-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
email Follow the discussionReplies 12 repliesReplies Make a reply

Replies

#1 Stephen Boyd
December 16th, 2010 - 08:00 pm ET | Report spam
From: Matt Wagantall

Add debugfs nodes to list all of the supported rates for rate-settable
locally-controlled clocks. This allows a clock's supported rates to
be queried from userspace, and allows more comprehensive userspace
clock tests to be developed.

Reviewed-by: Saravana Kannan
Signed-off-by: Matt Wagantall
Signed-off-by: Stephen Boyd

arch/arm/mach-msm/clock-7x30.c | 1 +
arch/arm/mach-msm/clock-8x60.c | 1 +
arch/arm/mach-msm/clock-debug.c | 31 +++++++++++++++++++++++++++++++
arch/arm/mach-msm/clock-local.c | 11 +++++++++++
arch/arm/mach-msm/clock-local.h | 1 +
arch/arm/mach-msm/clock.h | 1 +
6 files changed, 46 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-msm/clock-7x30.c b/arch/arm/mach-msm/clock-7x30.c
index e13de24..9e73d8a 100644
a/arch/arm/mach-msm/clock-7x30.c
+++ b/arch/arm/mach-msm/clock-7x30.c
@@ -1156,6 +1156,7 @@ struct clk_ops soc_clk_ops_7x30 = {
.set_min_rate = local_clk_set_min_rate,
.set_max_rate = local_clk_set_max_rate,
.get_rate = local_clk_get_rate,
+ .list_rate = local_clk_list_rate,
.is_enabled = local_clk_is_enabled,
.round_rate = local_clk_round_rate,
.reset = pc_clk_reset,
diff --git a/arch/arm/mach-msm/clock-8x60.c b/arch/arm/mach-msm/clock-8x60.c
index 6972001..28017b7 100644
a/arch/arm/mach-msm/clock-8x60.c
+++ b/arch/arm/mach-msm/clock-8x60.c
@@ -1895,6 +1895,7 @@ struct clk_ops soc_clk_ops_8x60 = {
.set_min_rate = local_clk_set_min_rate,
.set_max_rate = local_clk_set_max_rate,
.get_rate = local_clk_get_rate,
+ .list_rate = local_clk_list_rate,
.is_enabled = local_clk_is_enabled,
.round_rate = local_clk_round_rate,
.reset = soc_clk_reset,
diff --git a/arch/arm/mach-msm/clock-debug.c b/arch/arm/mach-msm/clock-debug.c
index 73ef9cc..354bc1e 100644
a/arch/arm/mach-msm/clock-debug.c
+++ b/arch/arm/mach-msm/clock-debug.c
@@ -17,6 +17,7 @@
#include <linux/module.h>
#include <linux/ctype.h>
#include <linux/debugfs.h>
+#include <linux/seq_file.h>
#include <linux/clk.h>
#include "clock.h"

@@ -106,6 +107,32 @@ int __init clock_debug_init(void)
return 0;
}

+static int list_rates_show(struct seq_file *m, void *unused)
+{
+ struct clk *clock = m->private;
+ int rate, i = 0;
+
+ if (clock->ops->list_rate == NULL)
+ return -EINVAL;
+
+ while ((rate = clock->ops->list_rate(clock->id, i++)) >= 0)
+ seq_printf(m, "%d", rate);
+
+ return 0;
+}
+
+static int list_rates_open(struct inode *inode, struct file *file)
+{
+ return single_open(file, list_rates_show, inode->i_private);
+}
+
+static const struct file_operations list_rates_fops = {
+ .open = list_rates_open,
+ .read = seq_read,
+ .llseek = seq_lseek,
+ .release = seq_release,
+};
+
int __init clock_debug_add(struct clk *clock)
{
char temp[50], *ptr;
@@ -138,6 +165,10 @@ int __init clock_debug_add(struct clk *clock)
clock, &clock_measure_fops))
goto error;

+ if (!debugfs_create_file("list_rates", S_IRUGO, clk_dir,
+ clock, &list_rates_fops))
+ goto error;
+
return 0;
error:
debugfs_remove_recursive(clk_dir);
diff --git a/arch/arm/mach-msm/clock-local.c b/arch/arm/mach-msm/clock-local.c
index 44e0778..f80efa6 100644
a/arch/arm/mach-msm/clock-local.c
+++ b/arch/arm/mach-msm/clock-local.c
@@ -682,3 +682,14 @@ bool local_clk_is_local(unsigned id)
{
return true;
}
+
+/* Return the nth supported frequency for a given clock. */
+int local_clk_list_rate(unsigned id, unsigned n)
+{
+ struct clk_local *clk = &soc_clk_local_tbl[id];
+
+ if (!clk->freq_tbl || clk->freq_tbl->freq_hz == FREQ_END)
+ return -ENXIO;
+
+ return (clk->freq_tbl + n)->freq_hz;
+}
diff --git a/arch/arm/mach-msm/clock-local.h b/arch/arm/mach-msm/clock-local.h
index 3083369..cf97219 100644
a/arch/arm/mach-msm/clock-local.h
+++ b/arch/arm/mach-msm/clock-local.h
@@ -209,6 +209,7 @@ int local_clk_set_rate(unsigned id, unsigned rate);
int local_clk_set_min_rate(unsigned id, unsigned rate);
int local_clk_set_max_rate(unsigned id, unsigned rate);
unsigned local_clk_get_rate(unsigned id);
+int local_clk_list_rate(unsigned id, unsigned n);
unsigned local_clk_is_enabled(unsigned id);
long local_clk_round_rate(unsigned id, unsigned rate);
bool local_clk_is_local(unsigned id);
diff --git a/arch/arm/mach-msm/clock.h b/arch/arm/mach-msm/clock.h
index f09e01b..67f9d9e 100644
a/arch/arm/mach-msm/clock.h
+++ b/arch/arm/mach-msm/clock.h
@@ -41,6 +41,7 @@ struct clk_ops {
int (*set_max_rate)(unsigned id, unsigned rate);
int (*set_flags)(unsigned id, unsigned flags);
unsigned (*get_rate)(unsigned id);
+ int (*list_rate)(unsigned id, unsigned n);
int (*measure_rate)(unsigned id);
unsigned (*is_enabled)(unsigned id);
long (*round_rate)(unsigned id, unsigned rate);
Sent by an employee 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-kernel" in
the body of a message to
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

Similar topics