コード例 #1
0
ファイル: wdt.c プロジェクト: jhbsz/102
irqreturn_t ath_wdt_isr(int cpl, void *dev_id)
{
	unsigned delay;
	extern int ath_gpio_in_val(int);

#define UDELAY_COUNT 4000

	wddbg("%s: invoked\n", __func__);

	for (delay = UDELAY_COUNT; delay; delay--) {
		if (ath_gpio_in_val(ATH_GPIO_RESET)) {
			break;
		}
		udelay(1000);
	}

	wddbg("%s: %d", __func__, delay);

	if (!delay) {
		wake_up(&wdt->wq);
	} else {
		extern void ath_restart(char *);
		ath_restart(NULL);
	}
	return IRQ_HANDLED;
}
コード例 #2
0
ファイル: setup.c プロジェクト: KHATEEBNSIT/AP
int ath_be_handler(struct pt_regs *regs, int is_fixup)
{
#ifdef CONFIG_MACH_AR934x
	printk("ath data bus error: cause 0x%x epc 0x%x\nrebooting...", read_c0_cause(), read_c0_epc());
	ath_restart(NULL);
#else
	printk("ath data bus error: cause %#x\n", read_c0_cause());
#endif
	return (is_fixup ? MIPS_BE_FIXUP : MIPS_BE_FATAL);
}
コード例 #3
0
ファイル: gpio.c プロジェクト: jhbsz/102
irqreturn_t ath_reset_irq(int cpl, void *dev_id)
{
    local_irq_disable();

    if(push_time == 0){
        ath_gpio_config_int(AP_RESET_GPIO, INT_TYPE_LEVEL,
                 INT_POL_ACTIVE_HIGH);
        push_time = jiffies;
		local_irq_enable();
        return IRQ_HANDLED;
    }else{
        ath_gpio_config_int(AP_RESET_GPIO, INT_TYPE_LEVEL,
                INT_POL_ACTIVE_LOW);
        push_time = jiffies - push_time;
    }

    if(push_time/HZ > 3){
		/*
		 * since we are going to reboot the board, we
		 * don't need the interrupt handler anymore,
		 * so disable it.
		 */
		disable_irq(ATH_GPIO_IRQn(AP_RESET_GPIO));
		wake_up(&ath_fr_wq);
		printk("\nath: factory configuration restored..\n");
        push_time = 0;
		local_irq_enable();
		return IRQ_HANDLED;
	} else if(push_time/HZ < 1){
        push_time = 0;
		local_irq_enable();
		return IRQ_HANDLED;
    }else{
		extern void ath_restart(char *);
		ath_restart(NULL);
		return IRQ_HANDLED;
	}
}