Exemple #1
0
static int w83697ug_init(void)
{
	int ret;
	unsigned char t;

	ret = w83697ug_select_wd_register();
	if (ret != 0)
		return ret;

	outb_p(0xF6, WDT_EFER); /* Select CRF6 */
	t = inb_p(WDT_EFDR);    /* read CRF6 */
	if (t != 0) {
		printk(KERN_INFO PFX "Watchdog already running."
			" Resetting timeout to %d sec\n", timeout);
		outb_p(timeout, WDT_EFDR);    /* Write back to CRF6 */
	}
	outb_p(0xF5, WDT_EFER); /* Select CRF5 */
	t = inb_p(WDT_EFDR);    /* read CRF5 */
	t &= ~0x0C;             /* set second mode &
					disable keyboard turning off watchdog */
	outb_p(t, WDT_EFDR);    /* Write back to CRF5 */

	w83697ug_unselect_wd_register();
	return 0;
}
Exemple #2
0
static void wdt_ctrl(int timeout)
{
	spin_lock(&io_lock);

	w83697ug_select_wd_register();

	outb_p(0xF4, WDT_EFER);    /* Select CRF4 */
	outb_p(timeout, WDT_EFDR); /* Write Timeout counter to CRF4 */

	w83697ug_unselect_wd_register();

	spin_unlock(&io_lock);
}