aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorSamuel Tardieu <sam@rfc1149.net>2006-09-07 05:57:00 -0400
committerWim Van Sebroeck <wim@iguana.be>2006-10-04 16:44:08 -0400
commit44d7d3282baa4080b73adca31648e6ef1e191874 (patch)
treeebff2a59bdae53a98fe7c7b26c3268d600d5c994 /drivers
parenteb64419e397aaea55b2ef6904e86b6263a80acc7 (diff)
[WATCHDOG] w83697hf/hg WDT driver - patch 5
This is patch 5 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: - Rename the Extended Function Registers to the names used in the data-sheet. Signed-off-by: Samuel Tardieu <sam@rfc1149.net> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/char/watchdog/w83697hf_wdt.c42
1 files changed, 21 insertions, 21 deletions
diff --git a/drivers/char/watchdog/w83697hf_wdt.c b/drivers/char/watchdog/w83697hf_wdt.c
index 94b1655e70ca..c44f281f3565 100644
--- a/drivers/char/watchdog/w83697hf_wdt.c
+++ b/drivers/char/watchdog/w83697hf_wdt.c
@@ -64,29 +64,29 @@ MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CON
64 * Kernel methods. 64 * Kernel methods.
65 */ 65 */
66 66
67#define WDT_EFER (wdt_io+0) /* Extended Function Enable Registers */ 67#define W83697HF_EFER (wdt_io+0) /* Extended Function Enable Register */
68#define WDT_EFIR (wdt_io+0) /* Extended Function Index Register (same as EFER) */ 68#define W83697HF_EFIR (wdt_io+0) /* Extended Function Index Register (same as EFER) */
69#define WDT_EFDR (WDT_EFIR+1) /* Extended Function Data Register */ 69#define W83697HF_EFDR (wdt_io+1) /* Extended Function Data Register */
70 70
71static void 71static void
72w83697hf_select_wd_register(void) 72w83697hf_select_wd_register(void)
73{ 73{
74 outb_p(0x87, WDT_EFER); /* Enter extended function mode */ 74 outb_p(0x87, W83697HF_EFER); /* Enter extended function mode */
75 outb_p(0x87, WDT_EFER); /* Again according to manual */ 75 outb_p(0x87, W83697HF_EFER); /* Again according to manual */
76 76
77 outb_p(0x29, WDT_EFER); /* select CR29 */ 77 outb_p(0x29, W83697HF_EFER); /* select CR29 */
78 outb_p(0x20, WDT_EFDR); /* select WDTO */ 78 outb_p(0x20, W83697HF_EFDR); /* select WDTO */
79 79
80 outb_p(0x07, WDT_EFER); /* point to logical device number reg */ 80 outb_p(0x07, W83697HF_EFER); /* point to logical device number reg */
81 outb_p(0x08, WDT_EFDR); /* select logical device 8 (GPIO2) */ 81 outb_p(0x08, W83697HF_EFDR); /* select logical device 8 (GPIO2) */
82 outb_p(0x30, WDT_EFER); /* select CR30 */ 82 outb_p(0x30, W83697HF_EFER); /* select CR30 */
83 outb_p(0x01, WDT_EFDR); /* set bit 0 to activate GPIO2 */ 83 outb_p(0x01, W83697HF_EFDR); /* set bit 0 to activate GPIO2 */
84} 84}
85 85
86static void 86static void
87w83697hf_unselect_wd_register(void) 87w83697hf_unselect_wd_register(void)
88{ 88{
89 outb_p(0xAA, WDT_EFER); /* Leave extended function mode */ 89 outb_p(0xAA, W83697HF_EFER); /* Leave extended function mode */
90} 90}
91 91
92static void 92static void
@@ -96,17 +96,17 @@ w83697hf_init(void)
96 96
97 w83697hf_select_wd_register(); 97 w83697hf_select_wd_register();
98 98
99 outb_p(0xF3, WDT_EFER); /* Select CRF3 */ 99 outb_p(0xF3, W83697HF_EFER); /* Select CRF3 */
100 100
101 t=inb_p(WDT_EFDR); /* read CRF3 */ 101 t=inb_p(W83697HF_EFDR); /* read CRF3 */
102 if (t != 0) { 102 if (t != 0) {
103 printk (KERN_INFO PFX "Watchdog already running. Resetting timeout to %d sec\n", timeout); 103 printk (KERN_INFO PFX "Watchdog already running. Resetting timeout to %d sec\n", timeout);
104 outb_p(timeout, WDT_EFDR); /* Write back to CRF3 */ 104 outb_p(timeout, W83697HF_EFDR); /* Write back to CRF3 */
105 } 105 }
106 outb_p(0xF4, WDT_EFER); /* Select CRF4 */ 106 outb_p(0xF4, W83697HF_EFER); /* Select CRF4 */
107 t=inb_p(WDT_EFDR); /* read CRF4 */ 107 t=inb_p(W83697HF_EFDR); /* read CRF4 */
108 t&=~0x0C; /* set second mode & disable keyboard turning off watchdog */ 108 t&=~0x0C; /* set second mode & disable keyboard turning off watchdog */
109 outb_p(t, WDT_EFDR); /* Write back to CRF4 */ 109 outb_p(t, W83697HF_EFDR); /* Write back to CRF4 */
110 110
111 w83697hf_unselect_wd_register(); 111 w83697hf_unselect_wd_register();
112} 112}
@@ -118,8 +118,8 @@ wdt_ctrl(int timeout)
118 118
119 w83697hf_select_wd_register(); 119 w83697hf_select_wd_register();
120 120
121 outb_p(0xF4, WDT_EFER); /* Select CRF4 */ 121 outb_p(0xF4, W83697HF_EFER); /* Select CRF4 */
122 outb_p(timeout, WDT_EFDR); /* Write Timeout counter to CRF4 */ 122 outb_p(timeout, W83697HF_EFDR); /* Write Timeout counter to CRF4 */
123 123
124 w83697hf_unselect_wd_register(); 124 w83697hf_unselect_wd_register();
125 125