Skip to contentSkip to conversation

hwmon: it87 force enable fans1-3 to

PATCH In review Andrew Paprocki 1 participant 1 message Jul 7, 2008

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 4/4 hwmon: it87 force enable fans1-3 to

This patch always forces fans1-3 to be enabled and logs a debug message indicating the action. Certain BIOSes incorrectly report connected fans as disabled. There is already a mechanism via sensors.conf to ignore invalid inputs, so it is desired over making the driver more complex with an optional module parameter.

---
 Documentation/hwmon/it87 |    6 ++++++
 drivers/hwmon/it87.c     |   11 ++++++++---
 2 files changed, 14 insertions(+), 3 deletions(-)
Documentation/hwmon/it87 +6 -0
index 77196bf..f73f95f 100644
@@ -91,8 +91,14 @@ the driver won't notice and report changes in the VID value. The two
 upper VID bits share their pins with voltage inputs (in5 and in6) so you
 can't have both on a given board.
 
+System BIOSes do not always properly enable fans1-3 which are actually
+connected. For this reason, fans1-3 will be forcefully enabled by the
+driver and any disconnected fans should be ignored in sensors.conf.
+
 The IT8716F, IT8718F and later IT8712F revisions have support for
 2 additional fans. The additional fans are supported by the driver.
+These fans are not forced on by the driver because there is no known
+cases of chips incorrectly reporting their status.
 
 The IT8716F and IT8718F, and late IT8712F and IT8705F also have optional
 16-bit tachometer counters for fans 1 to 3. This is better (no more fan
drivers/hwmon/it87.c +8 -3
index b7b9b58..14143bf 100644
@@ -1417,10 +1417,15 @@ static void __devinit it87_init_device(struct platform_device *pdev)
 
 	/* Check if tachometers are reset manually or by some reason */
 	data->fan_main_ctrl = it87_read_value(data, IT87_REG_FAN_MAIN_CTRL);
-	if ((data->fan_main_ctrl & 0x70) = 0) {
-		/* Enable all fan tachometers */
+	if ((data->fan_main_ctrl & 0x70) = 0
+	 || (data->fan_main_ctrl & 0x70) != 0x70) {
+		/* Enable all fan tachometers if not all were enabled.
+		   BIOS configuration is sometimes wrong, unused fans
+		   should be disabled in sensors.conf. */
+		dev_dbg(&pdev->dev, "Forcing fan1-3 enabled\n");
 		data->fan_main_ctrl |= 0x70;
-		it87_write_value(data, IT87_REG_FAN_MAIN_CTRL, data->fan_main_ctrl);
+		it87_write_value(data, IT87_REG_FAN_MAIN_CTRL,
+				 data->fan_main_ctrl);
 	}
 	data->has_fan = (data->fan_main_ctrl >> 4) & 0x07;
 
Signature · 7 lines
1.5.6


_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors