aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-21 19:19:34 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-21 19:19:34 -0500
commit06165752c8dfd7c6a3f3186bd6dec86a70895c72 (patch)
treeb8bfcd0ec0a61ec187fc67d941f9200a3a3c5f0d /arch
parent597592d951cdca8e5edb29f7e8174f633a69685a (diff)
parent717a54ad6cb4b1782a26ae0eaebc8bd49c56c66e (diff)
Merge branch 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm
* 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm: [ARM] 4835/1: Fix stale comment in struct machine_desc description [ARM] 4829/1: add .get method to pxa-cpufreq to silence a warning [ARM] 4828/1: fix 3 warnings in drivers/video/pxafb.c [ARM] 4827/1: fix two warnings in drivers/i2c/busses/i2c-pxa.c [ARM] 4826/1: Orion: Register the RTC interrupt on the TS-209 [ARM] pxa: fix clock lookup to find specific device clocks
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-orion/ts209-setup.c15
-rw-r--r--arch/arm/mach-pxa/clock.c23
-rw-r--r--arch/arm/mach-pxa/cpu-pxa.c8
3 files changed, 38 insertions, 8 deletions
diff --git a/arch/arm/mach-orion/ts209-setup.c b/arch/arm/mach-orion/ts209-setup.c
index 306dbcd1e37b..b8cfe6813e9d 100644
--- a/arch/arm/mach-orion/ts209-setup.c
+++ b/arch/arm/mach-orion/ts209-setup.c
@@ -192,9 +192,13 @@ static struct mv643xx_eth_platform_data qnap_ts209_eth_data = {
192/***************************************************************************** 192/*****************************************************************************
193 * RTC S35390A on I2C bus 193 * RTC S35390A on I2C bus
194 ****************************************************************************/ 194 ****************************************************************************/
195
196#define TS209_RTC_GPIO 3
197
195static struct i2c_board_info __initdata qnap_ts209_i2c_rtc = { 198static struct i2c_board_info __initdata qnap_ts209_i2c_rtc = {
196 .driver_name = "rtc-s35390a", 199 .driver_name = "rtc-s35390a",
197 .addr = 0x30, 200 .addr = 0x30,
201 .irq = 0,
198}; 202};
199 203
200/**************************************************************************** 204/****************************************************************************
@@ -328,7 +332,18 @@ static void __init qnap_ts209_init(void)
328 332
329 platform_add_devices(qnap_ts209_devices, 333 platform_add_devices(qnap_ts209_devices,
330 ARRAY_SIZE(qnap_ts209_devices)); 334 ARRAY_SIZE(qnap_ts209_devices));
335
336 /* Get RTC IRQ and register the chip */
337 if (gpio_request(TS209_RTC_GPIO, "rtc") == 0) {
338 if (gpio_direction_input(TS209_RTC_GPIO) == 0)
339 qnap_ts209_i2c_rtc.irq = gpio_to_irq(TS209_RTC_GPIO);
340 else
341 gpio_free(TS209_RTC_GPIO);
342 }
343 if (qnap_ts209_i2c_rtc.irq == 0)
344 pr_warning("qnap_ts209_init: failed to get RTC IRQ\n");
331 i2c_register_board_info(0, &qnap_ts209_i2c_rtc, 1); 345 i2c_register_board_info(0, &qnap_ts209_i2c_rtc, 1);
346
332 orion_eth_init(&qnap_ts209_eth_data); 347 orion_eth_init(&qnap_ts209_eth_data);
333 orion_sata_init(&qnap_ts209_sata_data); 348 orion_sata_init(&qnap_ts209_sata_data);
334} 349}
diff --git a/arch/arm/mach-pxa/clock.c b/arch/arm/mach-pxa/clock.c
index 83ef5ecaf432..df5ae2710ab1 100644
--- a/arch/arm/mach-pxa/clock.c
+++ b/arch/arm/mach-pxa/clock.c
@@ -23,18 +23,27 @@ static LIST_HEAD(clocks);
23static DEFINE_MUTEX(clocks_mutex); 23static DEFINE_MUTEX(clocks_mutex);
24static DEFINE_SPINLOCK(clocks_lock); 24static DEFINE_SPINLOCK(clocks_lock);
25 25
26static struct clk *clk_lookup(struct device *dev, const char *id)
27{
28 struct clk *p;
29
30 list_for_each_entry(p, &clocks, node)
31 if (strcmp(id, p->name) == 0 && p->dev == dev)
32 return p;
33
34 return NULL;
35}
36
26struct clk *clk_get(struct device *dev, const char *id) 37struct clk *clk_get(struct device *dev, const char *id)
27{ 38{
28 struct clk *p, *clk = ERR_PTR(-ENOENT); 39 struct clk *p, *clk = ERR_PTR(-ENOENT);
29 40
30 mutex_lock(&clocks_mutex); 41 mutex_lock(&clocks_mutex);
31 list_for_each_entry(p, &clocks, node) { 42 p = clk_lookup(dev, id);
32 if (strcmp(id, p->name) == 0 && 43 if (!p)
33 (p->dev == NULL || p->dev == dev)) { 44 p = clk_lookup(NULL, id);
34 clk = p; 45 if (p)
35 break; 46 clk = p;
36 }
37 }
38 mutex_unlock(&clocks_mutex); 47 mutex_unlock(&clocks_mutex);
39 48
40 return clk; 49 return clk;
diff --git a/arch/arm/mach-pxa/cpu-pxa.c b/arch/arm/mach-pxa/cpu-pxa.c
index cbc583beedc8..939a3867f77c 100644
--- a/arch/arm/mach-pxa/cpu-pxa.c
+++ b/arch/arm/mach-pxa/cpu-pxa.c
@@ -134,7 +134,7 @@ static int pxa_set_target(struct cpufreq_policy *policy,
134 struct cpufreq_frequency_table *pxa_freqs_table; 134 struct cpufreq_frequency_table *pxa_freqs_table;
135 pxa_freqs_t *pxa_freq_settings; 135 pxa_freqs_t *pxa_freq_settings;
136 struct cpufreq_freqs freqs; 136 struct cpufreq_freqs freqs;
137 int idx; 137 unsigned int idx;
138 unsigned long flags; 138 unsigned long flags;
139 unsigned int unused, preset_mdrefr, postset_mdrefr; 139 unsigned int unused, preset_mdrefr, postset_mdrefr;
140 void *ramstart = phys_to_virt(0xa0000000); 140 void *ramstart = phys_to_virt(0xa0000000);
@@ -233,6 +233,11 @@ static int pxa_set_target(struct cpufreq_policy *policy,
233 return 0; 233 return 0;
234} 234}
235 235
236static unsigned int pxa_cpufreq_get(unsigned int cpu)
237{
238 return get_clk_frequency_khz(0);
239}
240
236static int pxa_cpufreq_init(struct cpufreq_policy *policy) 241static int pxa_cpufreq_init(struct cpufreq_policy *policy)
237{ 242{
238 int i; 243 int i;
@@ -269,6 +274,7 @@ static struct cpufreq_driver pxa_cpufreq_driver = {
269 .verify = pxa_verify_policy, 274 .verify = pxa_verify_policy,
270 .target = pxa_set_target, 275 .target = pxa_set_target,
271 .init = pxa_cpufreq_init, 276 .init = pxa_cpufreq_init,
277 .get = pxa_cpufreq_get,
272 .name = "PXA25x", 278 .name = "PXA25x",
273}; 279};
274 280