Commit ef39a1bf authored by Denis Turischev's avatar Denis Turischev Committed by Wim Van Sebroeck

[WATCHDOG] sbc_fitpc2_wdt: fix I/O space access technique.

The mdelay function was used between I/O access commands, that causes peak
in CPU usage. Fix it by substitution mdelay to msleep.

Expand usage on fitPC2 compatible boards according to DMI identification.
Signed-off-by: default avatarDenis Turischev <denis@compulab.co.il>
Signed-off-by: default avatarWim Van Sebroeck <wim@iguana.be>
parent e605d554
...@@ -396,8 +396,8 @@ config SBC_FITPC2_WATCHDOG ...@@ -396,8 +396,8 @@ config SBC_FITPC2_WATCHDOG
tristate "Compulab SBC-FITPC2 watchdog" tristate "Compulab SBC-FITPC2 watchdog"
depends on X86 depends on X86
---help--- ---help---
This is the driver for the built-in watchdog timer on the fit-PC2 This is the driver for the built-in watchdog timer on the fit-PC2,
Single-board computer made by Compulab. fit-PC2i, CM-iAM single-board computers made by Compulab.
It`s possible to enable watchdog timer either from BIOS (F2) or from booted Linux. It`s possible to enable watchdog timer either from BIOS (F2) or from booted Linux.
When "Watchdog Timer Value" enabled one can set 31-255 s operational range. When "Watchdog Timer Value" enabled one can set 31-255 s operational range.
......
...@@ -46,9 +46,9 @@ static DEFINE_SPINLOCK(wdt_lock); ...@@ -46,9 +46,9 @@ static DEFINE_SPINLOCK(wdt_lock);
static void wdt_send_data(unsigned char command, unsigned char data) static void wdt_send_data(unsigned char command, unsigned char data)
{ {
outb(command, COMMAND_PORT); outb(command, COMMAND_PORT);
mdelay(100); msleep(100);
outb(data, DATA_PORT); outb(data, DATA_PORT);
mdelay(200); msleep(200);
} }
static void wdt_enable(void) static void wdt_enable(void)
...@@ -202,11 +202,10 @@ static int __init fitpc2_wdt_init(void) ...@@ -202,11 +202,10 @@ static int __init fitpc2_wdt_init(void)
{ {
int err; int err;
if (strcmp("SBC-FITPC2", dmi_get_system_info(DMI_BOARD_NAME))) { if (!strstr(dmi_get_system_info(DMI_BOARD_NAME), "SBC-FITPC2"))
pr_info("board name is: %s. Should be SBC-FITPC2\n",
dmi_get_system_info(DMI_BOARD_NAME));
return -ENODEV; return -ENODEV;
}
pr_info("%s found\n", dmi_get_system_info(DMI_BOARD_NAME));
if (!request_region(COMMAND_PORT, 1, WATCHDOG_NAME)) { if (!request_region(COMMAND_PORT, 1, WATCHDOG_NAME)) {
pr_err("I/O address 0x%04x already in use\n", COMMAND_PORT); pr_err("I/O address 0x%04x already in use\n", COMMAND_PORT);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment