linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] ARM: pxa: reduce the scope of get_clk_frequency_khz()
@ 2010-09-20  0:10 Haojian Zhuang
  2010-09-20  0:10 ` [PATCH 2/2] ARM: pxa: reduce the scope of get_memclk_frequency_10khz() Haojian Zhuang
  0 siblings, 1 reply; 3+ messages in thread
From: Haojian Zhuang @ 2010-09-20  0:10 UTC (permalink / raw)
  To: linux-arm-kernel

get_clk_frequency_khz() is used in private cpufreq driver. In order to meet
the change of different pxa silicons, checking cpuid is introduced in
get_clk_frequency_khz(). While more pxa silicons are supported, the workload
of checking cpuid is higher.

So restrict the scope of get_clk_frequency_khz() on pxa2xx. Different pxa
silcions use different private cpufreq driver to avoid too much checking
on cpuid.

Signed-off-by: Haojian Zhuang <haojian.zhuang@marvell.com>
Cc: Eric Miao <eric.y.miao@gmail.com>
---
 arch/arm/mach-pxa/cpufreq-pxa3xx.c |    5 +++--
 arch/arm/mach-pxa/generic.c        |    3 +--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/arm/mach-pxa/cpufreq-pxa3xx.c b/arch/arm/mach-pxa/cpufreq-pxa3xx.c
index 27fa329..9edd9cd 100644
--- a/arch/arm/mach-pxa/cpufreq-pxa3xx.c
+++ b/arch/arm/mach-pxa/cpufreq-pxa3xx.c
@@ -159,7 +159,7 @@ static int pxa3xx_cpufreq_verify(struct cpufreq_policy *policy)
 
 static unsigned int pxa3xx_cpufreq_get(unsigned int cpu)
 {
-	return get_clk_frequency_khz(0);
+	return pxa3xx_get_clk_frequency_khz(0);
 }
 
 static int pxa3xx_cpufreq_set(struct cpufreq_policy *policy,
@@ -212,7 +212,8 @@ static __init int pxa3xx_cpufreq_init(struct cpufreq_policy *policy)
 	policy->cpuinfo.min_freq = 104000;
 	policy->cpuinfo.max_freq = (cpu_is_pxa320()) ? 806000 : 624000;
 	policy->cpuinfo.transition_latency = 1000; /* FIXME: 1 ms, assumed */
-	policy->cur = policy->min = policy->max = get_clk_frequency_khz(0);
+	policy->max = pxa3xx_get_clk_frequency_khz(0);
+	policy->cur = policy->min = policy->max;
 
 	if (cpu_is_pxa300() || cpu_is_pxa310())
 		ret = setup_freqs_table(policy, ARRAY_AND_SIZE(pxa300_freqs));
diff --git a/arch/arm/mach-pxa/generic.c b/arch/arm/mach-pxa/generic.c
index baabb3c..6655dea 100644
--- a/arch/arm/mach-pxa/generic.c
+++ b/arch/arm/mach-pxa/generic.c
@@ -66,8 +66,7 @@ unsigned int get_clk_frequency_khz(int info)
 		return pxa25x_get_clk_frequency_khz(info);
 	else if (cpu_is_pxa27x())
 		return pxa27x_get_clk_frequency_khz(info);
-	else
-		return pxa3xx_get_clk_frequency_khz(info);
+	return 0;
 }
 EXPORT_SYMBOL(get_clk_frequency_khz);
 
-- 
1.5.6.5

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] ARM: pxa: reduce the scope of get_memclk_frequency_10khz()
  2010-09-20  0:10 [PATCH 1/2] ARM: pxa: reduce the scope of get_clk_frequency_khz() Haojian Zhuang
@ 2010-09-20  0:10 ` Haojian Zhuang
  2010-09-26  5:40   ` Eric Miao
  0 siblings, 1 reply; 3+ messages in thread
From: Haojian Zhuang @ 2010-09-20  0:10 UTC (permalink / raw)
  To: linux-arm-kernel

Up to now, only pxa2xx pcmcia driver is using the API. No other device driver
is using this API in PXA3xx or any other PXA silicons.

Restrict the scope only on pxa2xx and remove the implementation of pxa3xx. So
we can avoid oo much checking on cpuid after more pxa chips supported.

Signed-off-by: Haojian Zhuang <haojian.zhuang@marvell.com>
Cc: Eric Miao <eric.y.miao@gmail.com>
---
 arch/arm/mach-pxa/generic.c |    3 +--
 arch/arm/mach-pxa/generic.h |    2 --
 arch/arm/mach-pxa/pxa3xx.c  |   17 -----------------
 3 files changed, 1 insertions(+), 21 deletions(-)

diff --git a/arch/arm/mach-pxa/generic.c b/arch/arm/mach-pxa/generic.c
index 6655dea..6451e9c 100644
--- a/arch/arm/mach-pxa/generic.c
+++ b/arch/arm/mach-pxa/generic.c
@@ -79,8 +79,7 @@ unsigned int get_memclk_frequency_10khz(void)
 		return pxa25x_get_memclk_frequency_10khz();
 	else if (cpu_is_pxa27x())
 		return pxa27x_get_memclk_frequency_10khz();
-	else
-		return pxa3xx_get_memclk_frequency_10khz();
+	return 0;
 }
 EXPORT_SYMBOL(get_memclk_frequency_10khz);
 
diff --git a/arch/arm/mach-pxa/generic.h b/arch/arm/mach-pxa/generic.h
index c6305c5..4b1ad27 100644
--- a/arch/arm/mach-pxa/generic.h
+++ b/arch/arm/mach-pxa/generic.h
@@ -54,11 +54,9 @@ static inline void pxa2xx_clear_reset_status(unsigned int mask) {}
 
 #ifdef CONFIG_PXA3xx
 extern unsigned pxa3xx_get_clk_frequency_khz(int);
-extern unsigned pxa3xx_get_memclk_frequency_10khz(void);
 extern void pxa3xx_clear_reset_status(unsigned int);
 #else
 #define pxa3xx_get_clk_frequency_khz(x)		(0)
-#define pxa3xx_get_memclk_frequency_10khz()	(0)
 static inline void pxa3xx_clear_reset_status(unsigned int mask) {}
 #endif
 
diff --git a/arch/arm/mach-pxa/pxa3xx.c b/arch/arm/mach-pxa/pxa3xx.c
index cf2bd26..c85c3a7 100644
--- a/arch/arm/mach-pxa/pxa3xx.c
+++ b/arch/arm/mach-pxa/pxa3xx.c
@@ -98,23 +98,6 @@ unsigned int pxa3xx_get_clk_frequency_khz(int info)
 	return CLK / 1000;
 }
 
-/*
- * Return the current static memory controller clock frequency
- * in units of 10kHz
- */
-unsigned int pxa3xx_get_memclk_frequency_10khz(void)
-{
-	unsigned long acsr;
-	unsigned int smcfs, clk = 0;
-
-	acsr = ACSR;
-
-	smcfs = (acsr >> 23) & 0x7;
-	clk = (acsr & ACCR_D0CS) ? RO_CLK : smcfs_mult[smcfs] * BASE_CLK;
-
-	return (clk / 10000);
-}
-
 void pxa3xx_clear_reset_status(unsigned int mask)
 {
 	/* RESET_STATUS_* has a 1:1 mapping with ARSR */
-- 
1.5.6.5

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] ARM: pxa: reduce the scope of get_memclk_frequency_10khz()
  2010-09-20  0:10 ` [PATCH 2/2] ARM: pxa: reduce the scope of get_memclk_frequency_10khz() Haojian Zhuang
@ 2010-09-26  5:40   ` Eric Miao
  0 siblings, 0 replies; 3+ messages in thread
From: Eric Miao @ 2010-09-26  5:40 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Sep 20, 2010 at 8:10 AM, Haojian Zhuang
<haojian.zhuang@gmail.com> wrote:
> Up to now, only pxa2xx pcmcia driver is using the API. No other device driver
> is using this API in PXA3xx or any other PXA silicons.
>
> Restrict the scope only on pxa2xx and remove the implementation of pxa3xx. So
> we can avoid oo much checking on cpuid after more pxa chips supported.
>
> Signed-off-by: Haojian Zhuang <haojian.zhuang@marvell.com>
> Cc: Eric Miao <eric.y.miao@gmail.com>

Applied.

> ---
> ?arch/arm/mach-pxa/generic.c | ? ?3 +--
> ?arch/arm/mach-pxa/generic.h | ? ?2 --
> ?arch/arm/mach-pxa/pxa3xx.c ?| ? 17 -----------------
> ?3 files changed, 1 insertions(+), 21 deletions(-)
>
> diff --git a/arch/arm/mach-pxa/generic.c b/arch/arm/mach-pxa/generic.c
> index 6655dea..6451e9c 100644
> --- a/arch/arm/mach-pxa/generic.c
> +++ b/arch/arm/mach-pxa/generic.c
> @@ -79,8 +79,7 @@ unsigned int get_memclk_frequency_10khz(void)
> ? ? ? ? ? ? ? ?return pxa25x_get_memclk_frequency_10khz();
> ? ? ? ?else if (cpu_is_pxa27x())
> ? ? ? ? ? ? ? ?return pxa27x_get_memclk_frequency_10khz();
> - ? ? ? else
> - ? ? ? ? ? ? ? return pxa3xx_get_memclk_frequency_10khz();
> + ? ? ? return 0;
> ?}
> ?EXPORT_SYMBOL(get_memclk_frequency_10khz);
>
> diff --git a/arch/arm/mach-pxa/generic.h b/arch/arm/mach-pxa/generic.h
> index c6305c5..4b1ad27 100644
> --- a/arch/arm/mach-pxa/generic.h
> +++ b/arch/arm/mach-pxa/generic.h
> @@ -54,11 +54,9 @@ static inline void pxa2xx_clear_reset_status(unsigned int mask) {}
>
> ?#ifdef CONFIG_PXA3xx
> ?extern unsigned pxa3xx_get_clk_frequency_khz(int);
> -extern unsigned pxa3xx_get_memclk_frequency_10khz(void);
> ?extern void pxa3xx_clear_reset_status(unsigned int);
> ?#else
> ?#define pxa3xx_get_clk_frequency_khz(x) ? ? ? ? ? ? ? ?(0)
> -#define pxa3xx_get_memclk_frequency_10khz() ? ?(0)
> ?static inline void pxa3xx_clear_reset_status(unsigned int mask) {}
> ?#endif
>
> diff --git a/arch/arm/mach-pxa/pxa3xx.c b/arch/arm/mach-pxa/pxa3xx.c
> index cf2bd26..c85c3a7 100644
> --- a/arch/arm/mach-pxa/pxa3xx.c
> +++ b/arch/arm/mach-pxa/pxa3xx.c
> @@ -98,23 +98,6 @@ unsigned int pxa3xx_get_clk_frequency_khz(int info)
> ? ? ? ?return CLK / 1000;
> ?}
>
> -/*
> - * Return the current static memory controller clock frequency
> - * in units of 10kHz
> - */
> -unsigned int pxa3xx_get_memclk_frequency_10khz(void)
> -{
> - ? ? ? unsigned long acsr;
> - ? ? ? unsigned int smcfs, clk = 0;
> -
> - ? ? ? acsr = ACSR;
> -
> - ? ? ? smcfs = (acsr >> 23) & 0x7;
> - ? ? ? clk = (acsr & ACCR_D0CS) ? RO_CLK : smcfs_mult[smcfs] * BASE_CLK;
> -
> - ? ? ? return (clk / 10000);
> -}
> -
> ?void pxa3xx_clear_reset_status(unsigned int mask)
> ?{
> ? ? ? ?/* RESET_STATUS_* has a 1:1 mapping with ARSR */
> --
> 1.5.6.5
>
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-09-26  5:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-20  0:10 [PATCH 1/2] ARM: pxa: reduce the scope of get_clk_frequency_khz() Haojian Zhuang
2010-09-20  0:10 ` [PATCH 2/2] ARM: pxa: reduce the scope of get_memclk_frequency_10khz() Haojian Zhuang
2010-09-26  5:40   ` Eric Miao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).