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 */
@@ -323,7 +324,7 @@ static const struct abituguru3_motherboard_info abituguru3_motherboards[] = {
323324 { "AUX1 Fan" , 36 , 2 , 60 , 1 , 0 },
324325 { NULL , 0 , 0 , 0 , 0 , 0 } }
325326 },
326- { 0x0013 , "unknown " , {
327+ { 0x0013 , "Abit AW8D " , {
327328 { "CPU Core" , 0 , 0 , 10 , 1 , 0 },
328329 { "DDR" , 1 , 0 , 10 , 1 , 0 },
329330 { "DDR VTT" , 2 , 0 , 10 , 1 , 0 },
@@ -349,6 +350,7 @@ static const struct abituguru3_motherboard_info abituguru3_motherboards[] = {
349350 { "AUX2 Fan" , 36 , 2 , 60 , 1 , 0 },
350351 { "AUX3 Fan" , 37 , 2 , 60 , 1 , 0 },
351352 { "AUX4 Fan" , 38 , 2 , 60 , 1 , 0 },
353+ { "AUX5 Fan" , 39 , 2 , 60 , 1 , 0 },
352354 { NULL , 0 , 0 , 0 , 0 , 0 } }
353355 },
354356 { 0x0014 , "Abit AB9 Pro" , {
@@ -1111,11 +1113,12 @@ static int __init abituguru3_detect(void)
11111113{
11121114 /* See if there is an uguru3 there. An idle uGuru3 will hold 0x00 or
11131115 0x08 at DATA and 0xAC at CMD. Sometimes the uGuru3 will hold 0x05
1114- at CMD instead, why is unknown. So we test for 0x05 too . */
1116+ or 0x55 at CMD instead, why is unknown. */
11151117 u8 data_val = inb_p (ABIT_UGURU3_BASE + ABIT_UGURU3_DATA );
11161118 u8 cmd_val = inb_p (ABIT_UGURU3_BASE + ABIT_UGURU3_CMD );
11171119 if (((data_val == 0x00 ) || (data_val == 0x08 )) &&
1118- ((cmd_val == 0xAC ) || (cmd_val == 0x05 )))
1120+ ((cmd_val == 0xAC ) || (cmd_val == 0x05 ) ||
1121+ (cmd_val == 0x55 )))
11191122 return ABIT_UGURU3_BASE ;
11201123
11211124 ABIT_UGURU3_DEBUG ("no Abit uGuru3 found, data = 0x%02X, cmd = "
@@ -1138,6 +1141,15 @@ static int __init abituguru3_init(void)
11381141 int address , err ;
11391142 struct resource res = { .flags = IORESOURCE_IO };
11401143
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+
11411153 address = abituguru3_detect ();
11421154 if (address < 0 )
11431155 return address ;
0 commit comments