aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/common/icst525.c
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2010-01-16 12:15:07 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2010-05-02 04:35:30 -0400
commit643761ac43dfe4bea1195e966fc65a9403cdcb9f (patch)
tree75d59ed9d5d2058f188acc6bbdb047f8266fa512 /arch/arm/common/icst525.c
parent39c0cb02db5b8fdfac76d506b7a008b70bc960e9 (diff)
ARM: ICST: icst.*_ps_to_vco() functions are unused, remove them
These functions were originally implemented for the CLCD driver before we had clk API support. Since the CLCD driver does not use these anymore, we can remove them. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/common/icst525.c')
-rw-r--r--arch/arm/common/icst525.c65
1 files changed, 0 insertions, 65 deletions
diff --git a/arch/arm/common/icst525.c b/arch/arm/common/icst525.c
index fd5c2e7ed176..eadf983ee434 100644
--- a/arch/arm/common/icst525.c
+++ b/arch/arm/common/icst525.c
@@ -93,68 +93,3 @@ icst525_khz_to_vco(const struct icst_params *p, unsigned long freq)
93} 93}
94 94
95EXPORT_SYMBOL(icst525_khz_to_vco); 95EXPORT_SYMBOL(icst525_khz_to_vco);
96
97struct icst_vco
98icst525_ps_to_vco(const struct icst_params *p, unsigned long period)
99{
100 struct icst_vco vco = { .s = 1, .v = p->vd_max, .r = p->rd_max };
101 unsigned long f, ps;
102 unsigned int i = 0, rd, best = (unsigned int)-1;
103
104 ps = 1000000000UL / p->vco_max;
105
106 /*
107 * First, find the PLL output divisor such
108 * that the PLL output is within spec.
109 */
110 do {
111 f = period / s2div[idx2s[i]];
112
113 /*
114 * f must be between 10MHz and
115 * 320MHz (5V) or 200MHz (3V)
116 */
117 if (f >= ps && f < 100000)
118 break;
119 } while (i < ARRAY_SIZE(idx2s));
120
121 if (i >= ARRAY_SIZE(idx2s))
122 return vco;
123
124 vco.s = idx2s[i];
125
126 ps = 500000000UL / p->ref;
127
128 /*
129 * Now find the closest divisor combination
130 * which gives a PLL output of 'f'.
131 */
132 for (rd = p->rd_min; rd <= p->rd_max; rd++) {
133 unsigned long f_in_div, f_pll;
134 unsigned int vd;
135 int f_diff;
136
137 f_in_div = ps * rd;
138
139 vd = (f_in_div + f / 2) / f;
140 if (vd < p->vd_min || vd > p->vd_max)
141 continue;
142
143 f_pll = (f_in_div + vd / 2) / vd;
144 f_diff = f_pll - f;
145 if (f_diff < 0)
146 f_diff = -f_diff;
147
148 if ((unsigned)f_diff < best) {
149 vco.v = vd - 8;
150 vco.r = rd - 2;
151 if (f_diff == 0)
152 break;
153 best = f_diff;
154 }
155 }
156
157 return vco;
158}
159
160EXPORT_SYMBOL(icst525_ps_to_vco);