Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a7933e05 authored by Samuel Tardieu's avatar Samuel Tardieu Committed by Wim Van Sebroeck
Browse files

[WATCHDOG] w83697hf/hg WDT driver - patch 11



This is patch 11 in the series of patches that converts
Marcus Junker's w83697hf watchdog driver to Samuel Tardieau's
w83697hf/hg watchdog driver.

This patch contains following changes:
 - Add w83697hf_select_wdt() and w83697hf_deselect_wdt()
   so that the start/stop/ping code can directly talk to
   the watchdog.

Signed-off-by: default avatarSamuel Tardieu <sam@rfc1149.net>
Signed-off-by: default avatarWim Van Sebroeck <wim@iguana.be>
parent c81b2996
Loading
Loading
Loading
Loading
+15 −2
Original line number Diff line number Diff line
@@ -101,6 +101,19 @@ w83697hf_set_reg(unsigned char reg, unsigned char data)
	outb_p(data, W83697HF_EFDR);
}

static void
w83697hf_select_wdt(void)
{
	w83697hf_unlock();
	w83697hf_set_reg(0x07, 0x08);	/* Switch to logic device 8 (GPIO2) */
}

static inline void
w83697hf_deselect_wdt(void)
{
	w83697hf_lock();
}

static void
w83697hf_select_wd_register(void)
{
@@ -142,11 +155,11 @@ wdt_ctrl(int timeout)
{
	spin_lock(&io_lock);

	w83697hf_select_wd_register();
	w83697hf_select_wdt();

	w83697hf_set_reg(0xF4, timeout);	/* Write Timeout counter to CRF4 */

	w83697hf_unselect_wd_register();
	w83697hf_deselect_wdt();

	spin_unlock(&io_lock);
}