Skip to content

Commit b3aeab0

Browse files
Hans de GoedeMark M. Hoffman
authored andcommitted
hwmon: (abituguru3) update driver detection
It has been reported that the abituguru3 driver fails to load after a BIOS update. This patch fixes this by loosening the detection routine so that it will work after the BIOS update too. To compensate for the now very loose detection an additional check is added on the DMI Base Board vendor string to make sure we only load on Abit motherboards, this is the same as the check in the abituguru (1 / 2) driver. Signed-of-by: Hans de Goede <[email protected]> Signed-off-by: Alistair John Strachan <[email protected]> Signed-off-by: Mark M. Hoffman <[email protected]>
1 parent 25845c2 commit b3aeab0

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

drivers/hwmon/abituguru3.c

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
#include <linux/platform_device.h>
3131
#include <linux/hwmon.h>
3232
#include <linux/hwmon-sysfs.h>
33+
#include <linux/dmi.h>
3334
#include <asm/io.h>
3435

3536
/* uGuru3 bank addresses */
@@ -1112,11 +1113,12 @@ static int __init abituguru3_detect(void)
11121113
{
11131114
/* See if there is an uguru3 there. An idle uGuru3 will hold 0x00 or
11141115
0x08 at DATA and 0xAC at CMD. Sometimes the uGuru3 will hold 0x05
1115-
at CMD instead, why is unknown. So we test for 0x05 too. */
1116+
or 0x55 at CMD instead, why is unknown. */
11161117
u8 data_val = inb_p(ABIT_UGURU3_BASE + ABIT_UGURU3_DATA);
11171118
u8 cmd_val = inb_p(ABIT_UGURU3_BASE + ABIT_UGURU3_CMD);
11181119
if (((data_val == 0x00) || (data_val == 0x08)) &&
1119-
((cmd_val == 0xAC) || (cmd_val == 0x05)))
1120+
((cmd_val == 0xAC) || (cmd_val == 0x05) ||
1121+
(cmd_val == 0x55)))
11201122
return ABIT_UGURU3_BASE;
11211123

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

1144+
#ifdef CONFIG_DMI
1145+
const char *board_vendor = dmi_get_system_info(DMI_BOARD_VENDOR);
1146+
1147+
/* safety check, refuse to load on non Abit motherboards */
1148+
if (!force && (!board_vendor ||
1149+
strcmp(board_vendor, "http://www.abit.com.tw/")))
1150+
return -ENODEV;
1151+
#endif
1152+
11421153
address = abituguru3_detect();
11431154
if (address < 0)
11441155
return address;

0 commit comments

Comments
 (0)