aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap1
diff options
context:
space:
mode:
authorPaul Walmsley <paul@pwsan.com>2012-09-27 12:33:34 -0400
committerTony Lindgren <tony@atomide.com>2012-10-18 19:23:20 -0400
commita135eaae524acba1509a3b19c97fae556e4da7cd (patch)
tree275d3c326c45152e7c8fc24d79db5ff3b9f8f338 /arch/arm/mach-omap1
parent1fe9be8248ae9a04a09fcec7fed486d31e7f0897 (diff)
ARM: OMAP: remove plat/clock.h
Remove arch/arm/plat-omap/include/plat/clock.h by merging it into arch/arm/mach-omap1/clock.h and arch/arm/mach-omap2/clock.h. The goal here is to facilitate ARM single image kernels by removing includes via the "plat/" symlink. Signed-off-by: Paul Walmsley <paul@pwsan.com> [tony@atomide.com: fixed to remove duplicate clock.h includes] Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm/mach-omap1')
-rw-r--r--arch/arm/mach-omap1/board-nokia770.c2
-rw-r--r--arch/arm/mach-omap1/clock.c1
-rw-r--r--arch/arm/mach-omap1/clock.h153
-rw-r--r--arch/arm/mach-omap1/clock_data.c1
-rw-r--r--arch/arm/mach-omap1/pm.c3
5 files changed, 154 insertions, 6 deletions
diff --git a/arch/arm/mach-omap1/board-nokia770.c b/arch/arm/mach-omap1/board-nokia770.c
index 8b3b60a215cb..3e8ead67e459 100644
--- a/arch/arm/mach-omap1/board-nokia770.c
+++ b/arch/arm/mach-omap1/board-nokia770.c
@@ -29,12 +29,12 @@
29#include <asm/mach/map.h> 29#include <asm/mach/map.h>
30 30
31#include <mach/mux.h> 31#include <mach/mux.h>
32#include <plat/clock.h>
33 32
34#include <mach/hardware.h> 33#include <mach/hardware.h>
35#include <mach/usb.h> 34#include <mach/usb.h>
36 35
37#include "common.h" 36#include "common.h"
37#include "clock.h"
38#include "mmc.h" 38#include "mmc.h"
39 39
40#define ADS7846_PENDOWN_GPIO 15 40#define ADS7846_PENDOWN_GPIO 15
diff --git a/arch/arm/mach-omap1/clock.c b/arch/arm/mach-omap1/clock.c
index f46206eb3a15..306772c1c23c 100644
--- a/arch/arm/mach-omap1/clock.c
+++ b/arch/arm/mach-omap1/clock.c
@@ -24,7 +24,6 @@
24 24
25#include <plat/cpu.h> 25#include <plat/cpu.h>
26#include <plat/usb.h> 26#include <plat/usb.h>
27#include <plat/clock.h>
28#include <plat/clkdev_omap.h> 27#include <plat/clkdev_omap.h>
29 28
30#include <mach/hardware.h> 29#include <mach/hardware.h>
diff --git a/arch/arm/mach-omap1/clock.h b/arch/arm/mach-omap1/clock.h
index 3d04f4f67676..155ddd922c17 100644
--- a/arch/arm/mach-omap1/clock.h
+++ b/arch/arm/mach-omap1/clock.h
@@ -14,8 +14,159 @@
14#define __ARCH_ARM_MACH_OMAP1_CLOCK_H 14#define __ARCH_ARM_MACH_OMAP1_CLOCK_H
15 15
16#include <linux/clk.h> 16#include <linux/clk.h>
17#include <linux/list.h>
17 18
18#include <plat/clock.h> 19struct module;
20struct clk;
21
22/* Temporary, needed during the common clock framework conversion */
23#define __clk_get_name(clk) (clk->name)
24#define __clk_get_parent(clk) (clk->parent)
25#define __clk_get_rate(clk) (clk->rate)
26
27/**
28 * struct clkops - some clock function pointers
29 * @enable: fn ptr that enables the current clock in hardware
30 * @disable: fn ptr that enables the current clock in hardware
31 * @find_idlest: function returning the IDLEST register for the clock's IP blk
32 * @find_companion: function returning the "companion" clk reg for the clock
33 * @allow_idle: fn ptr that enables autoidle for the current clock in hardware
34 * @deny_idle: fn ptr that disables autoidle for the current clock in hardware
35 *
36 * A "companion" clk is an accompanying clock to the one being queried
37 * that must be enabled for the IP module connected to the clock to
38 * become accessible by the hardware. Neither @find_idlest nor
39 * @find_companion should be needed; that information is IP
40 * block-specific; the hwmod code has been created to handle this, but
41 * until hwmod data is ready and drivers have been converted to use PM
42 * runtime calls in place of clk_enable()/clk_disable(), @find_idlest and
43 * @find_companion must, unfortunately, remain.
44 */
45struct clkops {
46 int (*enable)(struct clk *);
47 void (*disable)(struct clk *);
48 void (*find_idlest)(struct clk *, void __iomem **,
49 u8 *, u8 *);
50 void (*find_companion)(struct clk *, void __iomem **,
51 u8 *);
52 void (*allow_idle)(struct clk *);
53 void (*deny_idle)(struct clk *);
54};
55
56/*
57 * struct clk.flags possibilities
58 *
59 * XXX document the rest of the clock flags here
60 *
61 * CLOCK_CLKOUTX2: (OMAP4 only) DPLL CLKOUT and CLKOUTX2 GATE_CTRL
62 * bits share the same register. This flag allows the
63 * omap4_dpllmx*() code to determine which GATE_CTRL bit field
64 * should be used. This is a temporary solution - a better approach
65 * would be to associate clock type-specific data with the clock,
66 * similar to the struct dpll_data approach.
67 */
68#define ENABLE_REG_32BIT (1 << 0) /* Use 32-bit access */
69#define CLOCK_IDLE_CONTROL (1 << 1)
70#define CLOCK_NO_IDLE_PARENT (1 << 2)
71#define ENABLE_ON_INIT (1 << 3) /* Enable upon framework init */
72#define INVERT_ENABLE (1 << 4) /* 0 enables, 1 disables */
73#define CLOCK_CLKOUTX2 (1 << 5)
74
75/**
76 * struct clk - OMAP struct clk
77 * @node: list_head connecting this clock into the full clock list
78 * @ops: struct clkops * for this clock
79 * @name: the name of the clock in the hardware (used in hwmod data and debug)
80 * @parent: pointer to this clock's parent struct clk
81 * @children: list_head connecting to the child clks' @sibling list_heads
82 * @sibling: list_head connecting this clk to its parent clk's @children
83 * @rate: current clock rate
84 * @enable_reg: register to write to enable the clock (see @enable_bit)
85 * @recalc: fn ptr that returns the clock's current rate
86 * @set_rate: fn ptr that can change the clock's current rate
87 * @round_rate: fn ptr that can round the clock's current rate
88 * @init: fn ptr to do clock-specific initialization
89 * @enable_bit: bitshift to write to enable/disable the clock (see @enable_reg)
90 * @usecount: number of users that have requested this clock to be enabled
91 * @fixed_div: when > 0, this clock's rate is its parent's rate / @fixed_div
92 * @flags: see "struct clk.flags possibilities" above
93 * @rate_offset: bitshift for rate selection bitfield (OMAP1 only)
94 * @src_offset: bitshift for source selection bitfield (OMAP1 only)
95 *
96 * XXX @rate_offset, @src_offset should probably be removed and OMAP1
97 * clock code converted to use clksel.
98 *
99 * XXX @usecount is poorly named. It should be "enable_count" or
100 * something similar. "users" in the description refers to kernel
101 * code (core code or drivers) that have called clk_enable() and not
102 * yet called clk_disable(); the usecount of parent clocks is also
103 * incremented by the clock code when clk_enable() is called on child
104 * clocks and decremented by the clock code when clk_disable() is
105 * called on child clocks.
106 *
107 * XXX @clkdm, @usecount, @children, @sibling should be marked for
108 * internal use only.
109 *
110 * @children and @sibling are used to optimize parent-to-child clock
111 * tree traversals. (child-to-parent traversals use @parent.)
112 *
113 * XXX The notion of the clock's current rate probably needs to be
114 * separated from the clock's target rate.
115 */
116struct clk {
117 struct list_head node;
118 const struct clkops *ops;
119 const char *name;
120 struct clk *parent;
121 struct list_head children;
122 struct list_head sibling; /* node for children */
123 unsigned long rate;
124 void __iomem *enable_reg;
125 unsigned long (*recalc)(struct clk *);
126 int (*set_rate)(struct clk *, unsigned long);
127 long (*round_rate)(struct clk *, unsigned long);
128 void (*init)(struct clk *);
129 u8 enable_bit;
130 s8 usecount;
131 u8 fixed_div;
132 u8 flags;
133 u8 rate_offset;
134 u8 src_offset;
135#if defined(CONFIG_PM_DEBUG) && defined(CONFIG_DEBUG_FS)
136 struct dentry *dent; /* For visible tree hierarchy */
137#endif
138};
139
140struct clk_functions {
141 int (*clk_enable)(struct clk *clk);
142 void (*clk_disable)(struct clk *clk);
143 long (*clk_round_rate)(struct clk *clk, unsigned long rate);
144 int (*clk_set_rate)(struct clk *clk, unsigned long rate);
145 int (*clk_set_parent)(struct clk *clk, struct clk *parent);
146 void (*clk_allow_idle)(struct clk *clk);
147 void (*clk_deny_idle)(struct clk *clk);
148 void (*clk_disable_unused)(struct clk *clk);
149};
150
151extern int mpurate;
152
153extern int clk_init(struct clk_functions *custom_clocks);
154extern void clk_preinit(struct clk *clk);
155extern int clk_register(struct clk *clk);
156extern void clk_reparent(struct clk *child, struct clk *parent);
157extern void clk_unregister(struct clk *clk);
158extern void propagate_rate(struct clk *clk);
159extern void recalculate_root_clocks(void);
160extern unsigned long followparent_recalc(struct clk *clk);
161extern void clk_enable_init_clocks(void);
162unsigned long omap_fixed_divisor_recalc(struct clk *clk);
163extern struct clk *omap_clk_get_by_name(const char *name);
164extern int omap_clk_enable_autoidle_all(void);
165extern int omap_clk_disable_autoidle_all(void);
166
167extern const struct clkops clkops_null;
168
169extern struct clk dummy_ck;
19 170
20int omap1_clk_init(void); 171int omap1_clk_init(void);
21void omap1_clk_late_init(void); 172void omap1_clk_late_init(void);
diff --git a/arch/arm/mach-omap1/clock_data.c b/arch/arm/mach-omap1/clock_data.c
index 28e58eb163f2..8f4ae755010d 100644
--- a/arch/arm/mach-omap1/clock_data.c
+++ b/arch/arm/mach-omap1/clock_data.c
@@ -22,7 +22,6 @@
22 22
23#include <asm/mach-types.h> /* for machine_is_* */ 23#include <asm/mach-types.h> /* for machine_is_* */
24 24
25#include <plat/clock.h>
26#include <plat/cpu.h> 25#include <plat/cpu.h>
27#include <plat/clkdev_omap.h> 26#include <plat/clkdev_omap.h>
28 27
diff --git a/arch/arm/mach-omap1/pm.c b/arch/arm/mach-omap1/pm.c
index fa8e672a26c5..b2c2328d7c18 100644
--- a/arch/arm/mach-omap1/pm.c
+++ b/arch/arm/mach-omap1/pm.c
@@ -49,8 +49,6 @@
49#include <asm/mach/time.h> 49#include <asm/mach/time.h>
50#include <asm/mach/irq.h> 50#include <asm/mach/irq.h>
51 51
52#include <plat/cpu.h>
53#include <plat/clock.h>
54#include <mach/tc.h> 52#include <mach/tc.h>
55#include <mach/mux.h> 53#include <mach/mux.h>
56#include <plat-omap/dma-omap.h> 54#include <plat-omap/dma-omap.h>
@@ -61,6 +59,7 @@
61#include "../plat-omap/sram.h" 59#include "../plat-omap/sram.h"
62 60
63#include "iomap.h" 61#include "iomap.h"
62#include "clock.h"
64#include "pm.h" 63#include "pm.h"
65 64
66static unsigned int arm_sleep_save[ARM_SLEEP_SAVE_SIZE]; 65static unsigned int arm_sleep_save[ARM_SLEEP_SAVE_SIZE];