summaryrefslogtreecommitdiff
path: root/arch/arm/common
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2010-01-16 19:46:19 +0000
committerRussell King <rmk+kernel@arm.linux.org.uk>2010-05-02 09:35:32 +0100
commit232eaf7f268f765b52170bec42bfa0c5825aa239 (patch)
tree972eb80dcb7d3b0d8ee10f83f307f1bc47b784a9 /arch/arm/common
parente73a46a3d3df22b379d8adcb59999eafea1d60d5 (diff)
downloadlinux-3.10-232eaf7f268f765b52170bec42bfa0c5825aa239.tar.gz
linux-3.10-232eaf7f268f765b52170bec42bfa0c5825aa239.tar.bz2
linux-3.10-232eaf7f268f765b52170bec42bfa0c5825aa239.zip
ARM: ICST: indirect s2div and idx2s arrays via icst_params
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/common')
-rw-r--r--arch/arm/common/icst307.c18
-rw-r--r--arch/arm/common/icst525.c18
2 files changed, 22 insertions, 14 deletions
diff --git a/arch/arm/common/icst307.c b/arch/arm/common/icst307.c
index 312485fab4a..8332c0726e7 100644
--- a/arch/arm/common/icst307.c
+++ b/arch/arm/common/icst307.c
@@ -22,11 +22,13 @@
/*
* Divisors for each OD setting.
*/
-static unsigned char s2div[8] = { 10, 2, 8, 4, 5, 7, 3, 6 };
+const unsigned char icst307_s2div[8] = { 10, 2, 8, 4, 5, 7, 3, 6 };
+
+EXPORT_SYMBOL(icst307_s2div);
unsigned long icst307_hz(const struct icst_params *p, struct icst_vco vco)
{
- return p->ref * 2 * (vco.v + 8) / ((vco.r + 2) * s2div[vco.s]);
+ return p->ref * 2 * (vco.v + 8) / ((vco.r + 2) * p->s2div[vco.s]);
}
EXPORT_SYMBOL(icst307_hz);
@@ -34,7 +36,9 @@ EXPORT_SYMBOL(icst307_hz);
/*
* Ascending divisor S values.
*/
-static unsigned char idx2s[8] = { 1, 6, 3, 4, 7, 5, 2, 0 };
+const unsigned char icst307_idx2s[8] = { 1, 6, 3, 4, 7, 5, 2, 0 };
+
+EXPORT_SYMBOL(icst307_idx2s);
struct icst_vco
icst307_hz_to_vco(const struct icst_params *p, unsigned long freq)
@@ -48,19 +52,19 @@ icst307_hz_to_vco(const struct icst_params *p, unsigned long freq)
* that the PLL output is within spec.
*/
do {
- f = freq * s2div[idx2s[i]];
+ f = freq * p->s2div[p->idx2s[i]];
/*
* f must be between 6MHz and 200MHz (3.3 or 5V)
*/
if (f > p->vco_min && f <= p->vco_max)
break;
- } while (i < ARRAY_SIZE(idx2s));
+ } while (i < 8);
- if (i >= ARRAY_SIZE(idx2s))
+ if (i >= 8)
return vco;
- vco.s = idx2s[i];
+ vco.s = p->idx2s[i];
/*
* Now find the closest divisor combination
diff --git a/arch/arm/common/icst525.c b/arch/arm/common/icst525.c
index da58965da31..4180255eb07 100644
--- a/arch/arm/common/icst525.c
+++ b/arch/arm/common/icst525.c
@@ -19,11 +19,13 @@
/*
* Divisors for each OD setting.
*/
-static unsigned char s2div[8] = { 10, 2, 8, 4, 5, 7, 9, 6 };
+const unsigned char icst525_s2div[8] = { 10, 2, 8, 4, 5, 7, 9, 6 };
+
+EXPORT_SYMBOL(icst525_s2div);
unsigned long icst525_hz(const struct icst_params *p, struct icst_vco vco)
{
- return p->ref * 2 * (vco.v + 8) / ((vco.r + 2) * s2div[vco.s]);
+ return p->ref * 2 * (vco.v + 8) / ((vco.r + 2) * p->s2div[vco.s]);
}
EXPORT_SYMBOL(icst525_hz);
@@ -31,7 +33,9 @@ EXPORT_SYMBOL(icst525_hz);
/*
* Ascending divisor S values.
*/
-static unsigned char idx2s[] = { 1, 3, 4, 7, 5, 2, 6, 0 };
+const unsigned char icst525_idx2s[8] = { 1, 3, 4, 7, 5, 2, 6, 0 };
+
+EXPORT_SYMBOL(icst525_idx2s);
struct icst_vco
icst525_hz_to_vco(const struct icst_params *p, unsigned long freq)
@@ -45,7 +49,7 @@ icst525_hz_to_vco(const struct icst_params *p, unsigned long freq)
* that the PLL output is within spec.
*/
do {
- f = freq * s2div[idx2s[i]];
+ f = freq * p->s2div[p->idx2s[i]];
/*
* f must be between 10MHz and
@@ -53,12 +57,12 @@ icst525_hz_to_vco(const struct icst_params *p, unsigned long freq)
*/
if (f > p->vco_min && f <= p->vco_max)
break;
- } while (i < ARRAY_SIZE(idx2s));
+ } while (i < 8);
- if (i >= ARRAY_SIZE(idx2s))
+ if (i >= 8)
return vco;
- vco.s = idx2s[i];
+ vco.s = p->idx2s[i];
/*
* Now find the closest divisor combination