All of lore.kernel.org
 help / color / mirror / Atom feed
* [lm-sensors] PATCH: hwmon-f71882fg-17-printout-fan-modes.patch
@ 2008-12-15 15:26 Hans de Goede
  2008-12-16 15:03 ` Jean Delvare
  0 siblings, 1 reply; 2+ messages in thread
From: Hans de Goede @ 2008-12-15 15:26 UTC (permalink / raw)
  To: lm-sensors

[-- Attachment #1: Type: text/plain, Size: 312 bytes --]

Hi Jean,

Print the mode (duty-cycle or RPM) of each fan on driver load (to match the 
documentation from the previous patch which references this mode printout).

Signed-off-by: Hans de Goede <hdegoede@redhat.com>

Thanks & Regards,

Hans


p.s.

This is the very last patch of the f8000 work, or so I hope :)


[-- Attachment #2: hwmon-f71882fg-17-printout-fan-modes.patch --]
[-- Type: text/plain, Size: 1416 bytes --]

Print the mode (duty-cycle or RPM) of each fan on driver load.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
--- linux/drivers/hwmon/f71882fg.c.16-applied	2008-12-15 16:00:38.000000000 +0100
+++ linux/drivers/hwmon/f71882fg.c	2008-12-15 16:20:58.000000000 +0100
@@ -1711,7 +1711,7 @@
 {
 	struct f71882fg_data *data;
 	struct f71882fg_sio_data *sio_data = pdev->dev.platform_data;
-	int err;
+	int err, i, nr_fans = (sio_data->type == f71882fg) ? 4 : 3;
 	u8 start_reg;
 
 	data = kzalloc(sizeof(struct f71882fg_data), GFP_KERNEL);
@@ -1735,14 +1735,14 @@
 		goto exit_free;
 	}
 
+	data->pwm_enable = f71882fg_read8(data, F71882FG_REG_PWM_ENABLE);
 	/* If it is a 71862 and the fan / pwm part is enabled sanity check
 	   the pwm settings */
 	if (data->type == f71862fg && (start_reg & 0x02)) {
-		u8 reg = f71882fg_read8(data, F71882FG_REG_PWM_ENABLE);
-		if ((reg & 0x15) != 0x15) {
+		if ((data->pwm_enable & 0x15) != 0x15) {
 			dev_err(&pdev->dev,
 				"Invalid (reserved) pwm settings: 0x%02x\n",
-				(unsigned int)reg);
+				(unsigned int)data->pwm_enable);
 			err = -ENODEV;
 			goto exit_free;
 		}
@@ -1802,6 +1802,11 @@
 		}
 		if (err)
 			goto exit_unregister_sysfs;
+
+		for (i = 0; i < nr_fans; i++)
+			dev_info(&pdev->dev, "Fan: %d is in %s mode\n", i + 1,
+				 (data->pwm_enable & (1 << 2 * i)) ?
+				 "duty-cycle" : "RPM");
 	}
 
 	data->hwmon_dev = hwmon_device_register(&pdev->dev);

[-- Attachment #3: Type: text/plain, Size: 153 bytes --]

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [lm-sensors] PATCH: hwmon-f71882fg-17-printout-fan-modes.patch
  2008-12-15 15:26 [lm-sensors] PATCH: hwmon-f71882fg-17-printout-fan-modes.patch Hans de Goede
@ 2008-12-16 15:03 ` Jean Delvare
  0 siblings, 0 replies; 2+ messages in thread
From: Jean Delvare @ 2008-12-16 15:03 UTC (permalink / raw)
  To: lm-sensors

On Mon, 15 Dec 2008 16:26:38 +0100, Hans de Goede wrote:
> Hi Jean,
> 
> Print the mode (duty-cycle or RPM) of each fan on driver load (to match the 
> documentation from the previous patch which references this mode printout).
> 
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>

Applied, thanks.

-- 
Jean Delvare

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-12-16 15:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-15 15:26 [lm-sensors] PATCH: hwmon-f71882fg-17-printout-fan-modes.patch Hans de Goede
2008-12-16 15:03 ` Jean Delvare

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.