aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/au1000/common/power.c
diff options
context:
space:
mode:
authorPete Popov <ppopov@embeddedalley.com>2005-07-19 03:05:36 -0400
committerRalf Baechle <ralf@linux-mips.org>2005-10-29 14:31:56 -0400
commit3ce86ee14ba7c4b0f8ddae6030df9d0dee15b236 (patch)
tree9283cd659849be0deaea5fa80b7d8343edd5d926 /arch/mips/au1000/common/power.c
parent7ab1261f5fe421602fadeda1d89662303b08830b (diff)
Au1x PM fixes.
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/au1000/common/power.c')
-rw-r--r--arch/mips/au1000/common/power.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/arch/mips/au1000/common/power.c b/arch/mips/au1000/common/power.c
index d3aa067505b4..f85093b8d54d 100644
--- a/arch/mips/au1000/common/power.c
+++ b/arch/mips/au1000/common/power.c
@@ -34,11 +34,13 @@
34#include <linux/pm.h> 34#include <linux/pm.h>
35#include <linux/slab.h> 35#include <linux/slab.h>
36#include <linux/sysctl.h> 36#include <linux/sysctl.h>
37#include <linux/jiffies.h>
37 38
38#include <asm/string.h> 39#include <asm/string.h>
39#include <asm/uaccess.h> 40#include <asm/uaccess.h>
40#include <asm/io.h> 41#include <asm/io.h>
41#include <asm/system.h> 42#include <asm/system.h>
43#include <asm/cacheflush.h>
42#include <asm/mach-au1x00/au1000.h> 44#include <asm/mach-au1x00/au1000.h>
43 45
44#ifdef CONFIG_PM 46#ifdef CONFIG_PM
@@ -50,7 +52,7 @@
50# define DPRINTK(fmt, args...) 52# define DPRINTK(fmt, args...)
51#endif 53#endif
52 54
53static void calibrate_delay(void); 55static void au1000_calibrate_delay(void);
54 56
55extern void set_au1x00_speed(unsigned int new_freq); 57extern void set_au1x00_speed(unsigned int new_freq);
56extern unsigned int get_au1x00_speed(void); 58extern unsigned int get_au1x00_speed(void);
@@ -260,7 +262,7 @@ int au_sleep(void)
260} 262}
261 263
262static int pm_do_sleep(ctl_table * ctl, int write, struct file *file, 264static int pm_do_sleep(ctl_table * ctl, int write, struct file *file,
263 void *buffer, size_t * len) 265 void __user *buffer, size_t * len, loff_t *ppos)
264{ 266{
265 int retval = 0; 267 int retval = 0;
266#ifdef SLEEP_TEST_TIMEOUT 268#ifdef SLEEP_TEST_TIMEOUT
@@ -294,7 +296,7 @@ static int pm_do_sleep(ctl_table * ctl, int write, struct file *file,
294} 296}
295 297
296static int pm_do_suspend(ctl_table * ctl, int write, struct file *file, 298static int pm_do_suspend(ctl_table * ctl, int write, struct file *file,
297 void *buffer, size_t * len) 299 void __user *buffer, size_t * len, loff_t *ppos)
298{ 300{
299 int retval = 0; 301 int retval = 0;
300 302
@@ -313,7 +315,7 @@ static int pm_do_suspend(ctl_table * ctl, int write, struct file *file,
313 315
314 316
315static int pm_do_freq(ctl_table * ctl, int write, struct file *file, 317static int pm_do_freq(ctl_table * ctl, int write, struct file *file,
316 void *buffer, size_t * len) 318 void __user *buffer, size_t * len, loff_t *ppos)
317{ 319{
318 int retval = 0, i; 320 int retval = 0, i;
319 unsigned long val, pll; 321 unsigned long val, pll;
@@ -408,14 +410,14 @@ static int pm_do_freq(ctl_table * ctl, int write, struct file *file,
408 410
409 411
410 /* We don't want _any_ interrupts other than 412 /* We don't want _any_ interrupts other than
411 * match20. Otherwise our calibrate_delay() 413 * match20. Otherwise our au1000_calibrate_delay()
412 * calculation will be off, potentially a lot. 414 * calculation will be off, potentially a lot.
413 */ 415 */
414 intc0_mask = save_local_and_disable(0); 416 intc0_mask = save_local_and_disable(0);
415 intc1_mask = save_local_and_disable(1); 417 intc1_mask = save_local_and_disable(1);
416 local_enable_irq(AU1000_TOY_MATCH2_INT); 418 local_enable_irq(AU1000_TOY_MATCH2_INT);
417 spin_unlock_irqrestore(&pm_lock, flags); 419 spin_unlock_irqrestore(&pm_lock, flags);
418 calibrate_delay(); 420 au1000_calibrate_delay();
419 restore_local_and_enable(0, intc0_mask); 421 restore_local_and_enable(0, intc0_mask);
420 restore_local_and_enable(1, intc1_mask); 422 restore_local_and_enable(1, intc1_mask);
421 return retval; 423 return retval;
@@ -455,7 +457,7 @@ __initcall(pm_init);
455 better than 1% */ 457 better than 1% */
456#define LPS_PREC 8 458#define LPS_PREC 8
457 459
458static void calibrate_delay(void) 460static void au1000_calibrate_delay(void)
459{ 461{
460 unsigned long ticks, loopbit; 462 unsigned long ticks, loopbit;
461 int lps_precision = LPS_PREC; 463 int lps_precision = LPS_PREC;