Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 98375
b: refs/heads/master
c: b3aeab0
h: refs/heads/master
i:
  98373: f3570e6
  98371: 7b015b9
  98367: 02581e5
v: v3
  • Loading branch information
Hans de Goede authored and Mark M. Hoffman committed Jun 19, 2008
1 parent 83e78a2 commit 0bf632d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 25845c22647fad2a0852cf6bf277d84e8a7a6b4a
refs/heads/master: b3aeab0cdbd0fe5339a3a5918b59eebf148cbcd1
15 changes: 13 additions & 2 deletions trunk/drivers/hwmon/abituguru3.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include <linux/platform_device.h>
#include <linux/hwmon.h>
#include <linux/hwmon-sysfs.h>
#include <linux/dmi.h>
#include <asm/io.h>

/* uGuru3 bank addresses */
Expand Down Expand Up @@ -1112,11 +1113,12 @@ static int __init abituguru3_detect(void)
{
/* See if there is an uguru3 there. An idle uGuru3 will hold 0x00 or
0x08 at DATA and 0xAC at CMD. Sometimes the uGuru3 will hold 0x05
at CMD instead, why is unknown. So we test for 0x05 too. */
or 0x55 at CMD instead, why is unknown. */
u8 data_val = inb_p(ABIT_UGURU3_BASE + ABIT_UGURU3_DATA);
u8 cmd_val = inb_p(ABIT_UGURU3_BASE + ABIT_UGURU3_CMD);
if (((data_val == 0x00) || (data_val == 0x08)) &&
((cmd_val == 0xAC) || (cmd_val == 0x05)))
((cmd_val == 0xAC) || (cmd_val == 0x05) ||
(cmd_val == 0x55)))
return ABIT_UGURU3_BASE;

ABIT_UGURU3_DEBUG("no Abit uGuru3 found, data = 0x%02X, cmd = "
Expand All @@ -1139,6 +1141,15 @@ static int __init abituguru3_init(void)
int address, err;
struct resource res = { .flags = IORESOURCE_IO };

#ifdef CONFIG_DMI
const char *board_vendor = dmi_get_system_info(DMI_BOARD_VENDOR);

/* safety check, refuse to load on non Abit motherboards */
if (!force && (!board_vendor ||
strcmp(board_vendor, "http://www.abit.com.tw/")))
return -ENODEV;
#endif

address = abituguru3_detect();
if (address < 0)
return address;
Expand Down

0 comments on commit 0bf632d

Please sign in to comment.