All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 3/3] therm_windtunnel doesn't work properly on PowerMac G4
@ 2014-07-30 20:50 Goffredo Baroncelli
  2014-07-31  7:07 ` Jean Delvare
  0 siblings, 1 reply; 3+ messages in thread
From: Goffredo Baroncelli @ 2014-07-30 20:50 UTC (permalink / raw)
  To: Jean Delvare, Benjamin Herrenschmidt; +Cc: LKML

Add the "log_temp" and "verbose" module parameters.
    
log_temp    enable/disable the temperature logging
verbose     enable/disable the fan tune logging

Signed-off-by: Goffredo Baroncelli <kreijack@inwind.it>

---
 drivers/macintosh/therm_windtunnel.c |   19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 deletions(-)

diff --git a/drivers/macintosh/therm_windtunnel.c b/drivers/macintosh/therm_windtunnel.c
index fbe4516..7efba5d 100644
--- a/drivers/macintosh/therm_windtunnel.c
+++ b/drivers/macintosh/therm_windtunnel.c
@@ -44,7 +44,13 @@
 #include <asm/sections.h>
 #include <asm/macio.h>
 
-#define LOG_TEMP		0			/* continuously log temperature */
+static bool log_temp = 0;
+module_param(log_temp, bool, 0644);
+MODULE_PARM_DESC(log_temp, "Enable the temperature logging");
+
+static bool verbose = 1;
+module_param(verbose, bool, 0644);
+MODULE_PARM_DESC(verbose, "Enable the fan speed logging");
 
 static struct {
 	volatile int		running;
@@ -157,11 +163,12 @@ tune_fan( int fan_setting )
 	/* write_reg( x.fan, 0x24, val, 1 ); */
 	write_reg( x.fan, 0x25, val, 1 );
 	write_reg( x.fan, 0x20, 0, 1 );
-	print_temp("CPU-temp: ", x.temp );
-	if( x.casetemp )
+	if (verbose) {
+		print_temp("CPU-temp: ", x.temp );
 		print_temp(", Case: ", x.casetemp );
-	printk(",  Fan: %d (tuned %+d)\n", 11-fan_setting, x.fan_level-fan_setting );
-
+		printk(",  Fan: %d (tuned %+d)\n",
+			11-fan_setting, x.fan_level-fan_setting );
+	}
 	x.fan_level = fan_setting;
 }
 
@@ -179,7 +186,7 @@ poll_temp( void )
 	casetemp = read_reg(x.fan, 0x0b, 1) << 8;
 	casetemp |= (read_reg(x.fan, 0x06, 1) & 0x7) << 5;
 
-	if( LOG_TEMP && x.temp != temp ) {
+	if( log_temp && x.temp != temp ) {
 		print_temp("CPU-temp: ", temp );
 		print_temp(", Case: ", casetemp );
 		printk(",  Fan: %d\n", 11-x.fan_level );

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

end of thread, other threads:[~2014-07-31 21:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-30 20:50 [PATCH 3/3] therm_windtunnel doesn't work properly on PowerMac G4 Goffredo Baroncelli
2014-07-31  7:07 ` Jean Delvare
2014-07-31 21:29   ` Goffredo Baroncelli

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.