X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=arch%2Fmips%2Fau1000%2Fcommon%2Fpower.c;h=a8cd2c1b9e1b59f313ae98a0c6e8579e0afc6dca;hb=2a5f2e3e6cd1ce9fb3f8b186b6bc9aa1f1497a92;hp=3901e8e04755502a1af4e5cf55caa8e79beec1a9;hpb=9cdd79c9b99873d600d397fda012fc3f57cc2776;p=linux-2.6 diff --git a/arch/mips/au1000/common/power.c b/arch/mips/au1000/common/power.c index 3901e8e047..a8cd2c1b9e 100644 --- a/arch/mips/au1000/common/power.c +++ b/arch/mips/au1000/common/power.c @@ -29,17 +29,14 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 675 Mass Ave, Cambridge, MA 02139, USA. */ + #include #include #include -#include #include #include -#include #include -#include -#include #include #include @@ -47,17 +44,13 @@ #define DEBUG 1 #ifdef DEBUG -# define DPRINTK(fmt, args...) printk("%s: " fmt, __FUNCTION__ , ## args) +# define DPRINTK(fmt, args...) printk("%s: " fmt, __func__, ## args) #else # define DPRINTK(fmt, args...) #endif static void au1000_calibrate_delay(void); -extern void set_au1x00_speed(unsigned int new_freq); -extern unsigned int get_au1x00_speed(void); -extern unsigned long get_au1x00_uart_baud_base(void); -extern void set_au1x00_uart_baud_base(unsigned long new_baud_base); extern unsigned long save_local_and_disable(int controller); extern void restore_local_and_enable(int controller, unsigned long mask); extern void local_enable_irq(unsigned int irq_nr); @@ -211,7 +204,7 @@ int au_sleep(void) unsigned long wakeup, flags; extern void save_and_sleep(void); - spin_lock_irqsave(&pm_lock,flags); + spin_lock_irqsave(&pm_lock, flags); save_core_regs(); @@ -258,7 +251,6 @@ int au_sleep(void) static int pm_do_sleep(ctl_table * ctl, int write, struct file *file, void __user *buffer, size_t * len, loff_t *ppos) { - int retval = 0; #ifdef SLEEP_TEST_TIMEOUT #define TMPBUFLEN2 16 char buf[TMPBUFLEN2], *p; @@ -278,36 +270,12 @@ static int pm_do_sleep(ctl_table * ctl, int write, struct file *file, p = buf; sleep_ticks = simple_strtoul(p, &p, 0); #endif - retval = pm_send_all(PM_SUSPEND, (void *) 2); - - if (retval) - return retval; au_sleep(); - retval = pm_send_all(PM_RESUME, (void *) 0); - } - return retval; -} - -static int pm_do_suspend(ctl_table * ctl, int write, struct file *file, - void __user *buffer, size_t * len, loff_t *ppos) -{ - int retval = 0; - - if (!write) { - *len = 0; - } else { - retval = pm_send_all(PM_SUSPEND, (void *) 2); - if (retval) - return retval; - suspend_mode = 1; - - retval = pm_send_all(PM_RESUME, (void *) 0); } - return retval; + return 0; } - static int pm_do_freq(ctl_table * ctl, int write, struct file *file, void __user *buffer, size_t * len, loff_t *ppos) { @@ -403,9 +371,9 @@ static int pm_do_freq(ctl_table * ctl, int write, struct file *file, } - /* We don't want _any_ interrupts other than - * match20. Otherwise our au1000_calibrate_delay() - * calculation will be off, potentially a lot. + /* + * We don't want _any_ interrupts other than match20. Otherwise our + * au1000_calibrate_delay() calculation will be off, potentially a lot. */ intc0_mask = save_local_and_disable(0); intc1_mask = save_local_and_disable(1); @@ -414,19 +382,12 @@ static int pm_do_freq(ctl_table * ctl, int write, struct file *file, au1000_calibrate_delay(); restore_local_and_enable(0, intc0_mask); restore_local_and_enable(1, intc1_mask); + return retval; } static struct ctl_table pm_table[] = { - { - .ctl_name = CTL_UNNUMBERED, - .procname = "suspend", - .data = NULL, - .maxlen = 0, - .mode = 0600, - .proc_handler = &pm_do_suspend - }, { .ctl_name = CTL_UNNUMBERED, .procname = "sleep",