diff options
author | Wim Van Sebroeck <wim@iguana.be> | 2007-06-03 16:46:05 -0400 |
---|---|---|
committer | Wim Van Sebroeck <wim@iguana.be> | 2007-06-03 17:02:17 -0400 |
commit | 21baf3c7c7fcef5004671f697789aea84854ca45 (patch) | |
tree | 60a538b267ff58e397e6b606248aa76b43ac1586 /drivers/char/watchdog/mixcomwd.c | |
parent | 4194db10fab1c9595f12b2846b6799417a8db4dd (diff) |
[WATCHDOG] Mixcom Watchdog - checkcard part 2
Convert the mixcom and flashcom card checks to a
single checkcard call by creating a new structure
that contains all io-ports and their id's.
This is part of the port to the isa watchdog device
driver.
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
Diffstat (limited to 'drivers/char/watchdog/mixcomwd.c')
-rw-r--r-- | drivers/char/watchdog/mixcomwd.c | 44 |
1 files changed, 32 insertions, 12 deletions
diff --git a/drivers/char/watchdog/mixcomwd.c b/drivers/char/watchdog/mixcomwd.c index 17c29cb78d09..0836b9a941e2 100644 --- a/drivers/char/watchdog/mixcomwd.c +++ b/drivers/char/watchdog/mixcomwd.c | |||
@@ -66,7 +66,34 @@ | |||
66 | */ | 66 | */ |
67 | #define MIXCOM_ID 0x11 | 67 | #define MIXCOM_ID 0x11 |
68 | #define FLASHCOM_ID 0x18 | 68 | #define FLASHCOM_ID 0x18 |
69 | static int mixcomwd_ioports[] = { 0xd90, 0xe90, 0xf90, 0x000 }; | 69 | static struct { |
70 | int ioport; | ||
71 | int id; | ||
72 | } mixcomwd_io_info[] __devinitdata = { | ||
73 | /* The Mixcom cards */ | ||
74 | {0x0d90, MIXCOM_ID}, | ||
75 | {0x0e90, MIXCOM_ID}, | ||
76 | {0x0f90, MIXCOM_ID}, | ||
77 | /* The FlashCOM cards */ | ||
78 | {0x0304, FLASHCOM_ID}, | ||
79 | {0x030c, FLASHCOM_ID}, | ||
80 | {0x0314, FLASHCOM_ID}, | ||
81 | {0x031c, FLASHCOM_ID}, | ||
82 | {0x0324, FLASHCOM_ID}, | ||
83 | {0x032c, FLASHCOM_ID}, | ||
84 | {0x0334, FLASHCOM_ID}, | ||
85 | {0x033c, FLASHCOM_ID}, | ||
86 | {0x0344, FLASHCOM_ID}, | ||
87 | {0x034c, FLASHCOM_ID}, | ||
88 | {0x0354, FLASHCOM_ID}, | ||
89 | {0x035c, FLASHCOM_ID}, | ||
90 | {0x0364, FLASHCOM_ID}, | ||
91 | {0x036c, FLASHCOM_ID}, | ||
92 | {0x0374, FLASHCOM_ID}, | ||
93 | {0x037c, FLASHCOM_ID}, | ||
94 | /* The end of the list */ | ||
95 | {0x0000, 0}, | ||
96 | }; | ||
70 | 97 | ||
71 | static void mixcomwd_timerfun(unsigned long d); | 98 | static void mixcomwd_timerfun(unsigned long d); |
72 | 99 | ||
@@ -242,18 +269,11 @@ static int __init mixcomwd_init(void) | |||
242 | int ret; | 269 | int ret; |
243 | int found=0; | 270 | int found=0; |
244 | 271 | ||
245 | for (i = 0; !found && mixcomwd_ioports[i] != 0; i++) { | 272 | for (i = 0; !found && mixcomwd_io_info[i].ioport != 0; i++) { |
246 | if (checkcard(mixcomwd_ioports[i], MIXCOM_ID)) { | 273 | if (checkcard(mixcomwd_io_info[i].ioport, |
247 | found = 1; | 274 | mixcomwd_io_info[i].id)) { |
248 | watchdog_port = mixcomwd_ioports[i]; | ||
249 | } | ||
250 | } | ||
251 | |||
252 | /* The FlashCOM card can be set up at 0x304 -> 0x37c, in 0x8 jumps */ | ||
253 | for (i = 0x304; !found && i < 0x380; i+=0x8) { | ||
254 | if (checkcard(i, FLASHCOM_ID)) { | ||
255 | found = 1; | 275 | found = 1; |
256 | watchdog_port = i; | 276 | watchdog_port = mixcomwd_io_info[i].ioport; |
257 | } | 277 | } |
258 | } | 278 | } |
259 | 279 | ||