static void w83697hf_init(void) { unsigned char bbuf; w83697hf_select_wdt(); bbuf = w83697hf_get_reg(0x29); bbuf &= ~0x60; bbuf |= 0x20; w83697hf_set_reg(0x29, bbuf); /* Set pin 119 to WDTO# mode (= CR29, WDT0) */ bbuf = w83697hf_get_reg(0xF3); bbuf &= ~0x04; w83697hf_set_reg(0xF3, bbuf); /* Count mode is seconds */ w83697hf_deselect_wdt(); }
static void w83697hf_init(void) { unsigned char bbuf; w83697hf_select_wdt(); bbuf = w83697hf_get_reg(0x29); bbuf &= ~0x60; bbuf |= 0x20; w83697hf_set_reg(0x29, bbuf); bbuf = w83697hf_get_reg(0xF3); bbuf &= ~0x04; w83697hf_set_reg(0xF3, bbuf); w83697hf_deselect_wdt(); }
static void wdt_disable(void) { spin_lock(&io_lock); w83697hf_select_wdt(); w83697hf_set_reg(0x30, 0); /* Disable timer */ w83697hf_write_timeout(0); w83697hf_deselect_wdt(); spin_unlock(&io_lock); }
static void wdt_enable(void) { spin_lock(&io_lock); w83697hf_select_wdt(); w83697hf_write_timeout(timeout); w83697hf_set_reg(0x30, 1); /* Enable timer */ w83697hf_deselect_wdt(); spin_unlock(&io_lock); }
static void w83697hf_select_wdt(void) { w83697hf_unlock(); w83697hf_set_reg(0x07, 0x08); /* Switch to logic device 8 (GPIO2) */ }
static void w83697hf_write_timeout(int timeout) { w83697hf_set_reg(0xF4, timeout); /* Write Timeout counter to CRF4 */ }
static void w83697hf_select_wdt(void) { w83697hf_unlock(); w83697hf_set_reg(0x07, 0x08); }
static void w83697hf_write_timeout(int timeout) { w83697hf_set_reg(0xF4, timeout); }