Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 19884
b: refs/heads/master
c: 71baa1a
h: refs/heads/master
v: v3
  • Loading branch information
Ralf Baechle committed Feb 7, 2006
1 parent c080eba commit 08e42e5
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 28 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 05faa7b758e4f23b66c5a776a338f2348cbbc4af
refs/heads/master: 71baa1a599c04ab56ebf5fdb8d03abd0d601462f
52 changes: 25 additions & 27 deletions trunk/arch/mips/sgi-ip22/ip22-reset.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*
* Copyright (C) 1997, 1998, 2001, 2003 by Ralf Baechle
* Copyright (C) 1997, 1998, 2001, 03, 05 by Ralf Baechle
*/
#include <linux/linkage.h>
#include <linux/init.h>
#include <linux/ds1286.h>
#include <linux/module.h>
Expand Down Expand Up @@ -41,28 +42,10 @@ static struct timer_list power_timer, blink_timer, debounce_timer, volume_timer;

#define MACHINE_PANICED 1
#define MACHINE_SHUTTING_DOWN 2
static int machine_state = 0;

static void sgi_machine_restart(char *command) __attribute__((noreturn));
static void sgi_machine_halt(void) __attribute__((noreturn));
static void sgi_machine_power_off(void) __attribute__((noreturn));
static int machine_state;

static void sgi_machine_restart(char *command)
{
if (machine_state & MACHINE_SHUTTING_DOWN)
sgi_machine_power_off();
sgimc->cpuctrl0 |= SGIMC_CCTRL0_SYSINIT;
while (1);
}

static void sgi_machine_halt(void)
{
if (machine_state & MACHINE_SHUTTING_DOWN)
sgi_machine_power_off();
ArcEnterInteractiveMode();
}

static void sgi_machine_power_off(void)
static void ATTRIB_NORET sgi_machine_power_off(void)
{
unsigned int tmp;

Expand All @@ -84,6 +67,21 @@ static void sgi_machine_power_off(void)
}
}

static void ATTRIB_NORET sgi_machine_restart(char *command)
{
if (machine_state & MACHINE_SHUTTING_DOWN)
sgi_machine_power_off();
sgimc->cpuctrl0 |= SGIMC_CCTRL0_SYSINIT;
while (1);
}

static void ATTRIB_NORET sgi_machine_halt(void)
{
if (machine_state & MACHINE_SHUTTING_DOWN)
sgi_machine_power_off();
ArcEnterInteractiveMode();
}

static void power_timeout(unsigned long data)
{
sgi_machine_power_off();
Expand All @@ -95,15 +93,15 @@ static void blink_timeout(unsigned long data)
sgi_ioc_reset ^= (SGIOC_RESET_LC0OFF|SGIOC_RESET_LC1OFF);
sgioc->reset = sgi_ioc_reset;

mod_timer(&blink_timer, jiffies+data);
mod_timer(&blink_timer, jiffies + data);
}

static void debounce(unsigned long data)
{
del_timer(&debounce_timer);
if (sgint->istat1 & SGINT_ISTAT1_PWR) {
/* Interrupt still being sent. */
debounce_timer.expires = jiffies + 5; /* 0.05s */
debounce_timer.expires = jiffies + (HZ / 20); /* 0.05s */
add_timer(&debounce_timer);

sgioc->panel = SGIOC_PANEL_POWERON | SGIOC_PANEL_POWERINTR |
Expand Down Expand Up @@ -151,7 +149,7 @@ static inline void volume_up_button(unsigned long data)
indy_volume_button(1);

if (sgint->istat1 & SGINT_ISTAT1_PWR) {
volume_timer.expires = jiffies + 1;
volume_timer.expires = jiffies + (HZ / 100);
add_timer(&volume_timer);
}
}
Expand All @@ -164,7 +162,7 @@ static inline void volume_down_button(unsigned long data)
indy_volume_button(-1);

if (sgint->istat1 & SGINT_ISTAT1_PWR) {
volume_timer.expires = jiffies + 1;
volume_timer.expires = jiffies + (HZ / 100);
add_timer(&volume_timer);
}
}
Expand Down Expand Up @@ -199,14 +197,14 @@ static irqreturn_t panel_int(int irq, void *dev_id, struct pt_regs *regs)
if (!(buttons & SGIOC_PANEL_VOLUPINTR)) {
init_timer(&volume_timer);
volume_timer.function = volume_up_button;
volume_timer.expires = jiffies + 1;
volume_timer.expires = jiffies + (HZ / 100);
add_timer(&volume_timer);
}
/* Volume down button was pressed */
if (!(buttons & SGIOC_PANEL_VOLDNINTR)) {
init_timer(&volume_timer);
volume_timer.function = volume_down_button;
volume_timer.expires = jiffies + 1;
volume_timer.expires = jiffies + (HZ / 100);
add_timer(&volume_timer);
}

Expand Down

0 comments on commit 08e42e5

Please sign in to comment.