aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-msm/clock.h
diff options
context:
space:
mode:
authorStephen Boyd <sboyd@codeaurora.org>2013-06-17 10:43:19 -0700
committerDavid Brown <davidb@codeaurora.org>2013-06-24 13:08:05 -0700
commit8cc7f5338e729b79194e6c22e3c794faaef974b8 (patch)
treed9fad83dcb3e260ad862907a80431ad70d51883e /arch/arm/mach-msm/clock.h
parentARM: msm: Make proc_comm clock control into a platform driver (diff)
downloadlinux-dev-8cc7f5338e729b79194e6c22e3c794faaef974b8.tar.xz
linux-dev-8cc7f5338e729b79194e6c22e3c794faaef974b8.zip
ARM: msm: Migrate to common clock framework
Move the existing clock code in mach-msm to the common clock framework. We lose our capability to set the rate of and enable a clock through debugfs. This is ok though because the debugfs features are mainly used for testing and development of new clock code. To maintain compatibility with the original MSM clock code we make a wrapper for clk_reset() that calls the struct msm_clk specific reset function. This is necessary for the usb and sdcc devices on MSM until a better suited API is made available. Cc: Saravana Kannan <skannan@codeaurora.org> Acked-by: Mike Turquette <mturquette@linaro.org> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org> Signed-off-by: David Brown <davidb@codeaurora.org>
Diffstat (limited to 'arch/arm/mach-msm/clock.h')
-rw-r--r--arch/arm/mach-msm/clock.h46
1 files changed, 10 insertions, 36 deletions
diff --git a/arch/arm/mach-msm/clock.h b/arch/arm/mach-msm/clock.h
index cc76bfe9ba46..42d29dd7aafc 100644
--- a/arch/arm/mach-msm/clock.h
+++ b/arch/arm/mach-msm/clock.h
@@ -1,7 +1,7 @@
/* arch/arm/mach-msm/clock.h
*
* Copyright (C) 2007 Google, Inc.
- * Copyright (c) 2007-2010, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2007-2012, The Linux Foundation. All rights reserved.
*
* This software is licensed under the terms of the GNU General Public
* License version 2, as published by the Free Software Foundation, and
@@ -17,8 +17,7 @@
#ifndef __ARCH_ARM_MACH_MSM_CLOCK_H
#define __ARCH_ARM_MACH_MSM_CLOCK_H
-#include <linux/init.h>
-#include <linux/list.h>
+#include <linux/clk-provider.h>
#include <mach/clk.h>
#define CLK_FIRST_AVAILABLE_FLAG 0x00000100
@@ -26,44 +25,19 @@
#define CLKFLAG_MIN 0x00000400
#define CLKFLAG_MAX 0x00000800
-struct clk_ops {
- int (*enable)(unsigned id);
- void (*disable)(unsigned id);
- void (*auto_off)(unsigned id);
- int (*reset)(unsigned id, enum clk_reset_action action);
- int (*set_rate)(unsigned id, unsigned rate);
- int (*set_min_rate)(unsigned id, unsigned rate);
- int (*set_max_rate)(unsigned id, unsigned rate);
- unsigned (*get_rate)(unsigned id);
- unsigned (*is_enabled)(unsigned id);
- long (*round_rate)(unsigned id, unsigned rate);
- bool (*is_local)(unsigned id);
-};
-
-struct clk {
- uint32_t id;
- uint32_t remote_id;
- uint32_t count;
- uint32_t flags;
- struct clk_ops *ops;
- const char *dbg_name;
- struct list_head list;
-};
-
#define OFF CLKFLAG_AUTO_OFF
#define CLK_MIN CLKFLAG_MIN
#define CLK_MAX CLKFLAG_MAX
#define CLK_MINMAX (CLK_MIN | CLK_MAX)
-#ifdef CONFIG_DEBUG_FS
-int __init clock_debug_init(void);
-int __init clock_debug_add(struct clk *clock);
-#else
-static inline int __init clock_debug_init(void) { return 0; }
-static inline int __init clock_debug_add(struct clk *clock) { return 0; }
-#endif
+struct msm_clk {
+ int (*reset)(struct clk_hw *hw, enum clk_reset_action action);
+ struct clk_hw hw;
+};
-struct clk_lookup;
-void msm_clock_init(struct clk_lookup *clock_tbl, size_t num_clocks);
+static inline struct msm_clk *to_msm_clk(struct clk_hw *hw)
+{
+ return container_of(hw, struct msm_clk, hw);
+}
#endif