diff options
author | Greg Kroah-Hartman <gregkh@suse.de> | 2006-01-06 15:59:59 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-01-06 15:59:59 -0500 |
commit | ccf18968b1bbc2fb117190a1984ac2a826dac228 (patch) | |
tree | 7bc8fbf5722aecf1e84fa50c31c657864cba1daa /drivers/macintosh | |
parent | e91c021c487110386a07facd0396e6c3b7cf9c1f (diff) | |
parent | d99cf9d679a520d67f81d805b7cb91c68e1847f0 (diff) |
Merge ../torvalds-2.6/
Diffstat (limited to 'drivers/macintosh')
-rw-r--r-- | drivers/macintosh/therm_adt746x.c | 39 | ||||
-rw-r--r-- | drivers/macintosh/therm_pm72.c | 7 | ||||
-rw-r--r-- | drivers/macintosh/windfarm_lm75_sensor.c | 7 |
3 files changed, 26 insertions, 27 deletions
diff --git a/drivers/macintosh/therm_adt746x.c b/drivers/macintosh/therm_adt746x.c index 02a3117ef92d..5ebfd1d138da 100644 --- a/drivers/macintosh/therm_adt746x.c +++ b/drivers/macintosh/therm_adt746x.c | |||
@@ -52,6 +52,7 @@ static char *sensor_location[3] = {NULL, NULL, NULL}; | |||
52 | 52 | ||
53 | static int limit_adjust = 0; | 53 | static int limit_adjust = 0; |
54 | static int fan_speed = -1; | 54 | static int fan_speed = -1; |
55 | static int verbose = 0; | ||
55 | 56 | ||
56 | MODULE_AUTHOR("Colin Leroy <colin@colino.net>"); | 57 | MODULE_AUTHOR("Colin Leroy <colin@colino.net>"); |
57 | MODULE_DESCRIPTION("Driver for ADT746x thermostat in iBook G4 and " | 58 | MODULE_DESCRIPTION("Driver for ADT746x thermostat in iBook G4 and " |
@@ -66,6 +67,10 @@ module_param(fan_speed, int, 0644); | |||
66 | MODULE_PARM_DESC(fan_speed,"Specify starting fan speed (0-255) " | 67 | MODULE_PARM_DESC(fan_speed,"Specify starting fan speed (0-255) " |
67 | "(default 64)"); | 68 | "(default 64)"); |
68 | 69 | ||
70 | module_param(verbose, bool, 0); | ||
71 | MODULE_PARM_DESC(verbose,"Verbose log operations " | ||
72 | "(default 0)"); | ||
73 | |||
69 | struct thermostat { | 74 | struct thermostat { |
70 | struct i2c_client clt; | 75 | struct i2c_client clt; |
71 | u8 temps[3]; | 76 | u8 temps[3]; |
@@ -149,13 +154,13 @@ detach_thermostat(struct i2c_adapter *adapter) | |||
149 | if (thread_therm != NULL) { | 154 | if (thread_therm != NULL) { |
150 | kthread_stop(thread_therm); | 155 | kthread_stop(thread_therm); |
151 | } | 156 | } |
152 | 157 | ||
153 | printk(KERN_INFO "adt746x: Putting max temperatures back from " | 158 | printk(KERN_INFO "adt746x: Putting max temperatures back from " |
154 | "%d, %d, %d to %d, %d, %d\n", | 159 | "%d, %d, %d to %d, %d, %d\n", |
155 | th->limits[0], th->limits[1], th->limits[2], | 160 | th->limits[0], th->limits[1], th->limits[2], |
156 | th->initial_limits[0], th->initial_limits[1], | 161 | th->initial_limits[0], th->initial_limits[1], |
157 | th->initial_limits[2]); | 162 | th->initial_limits[2]); |
158 | 163 | ||
159 | for (i = 0; i < 3; i++) | 164 | for (i = 0; i < 3; i++) |
160 | write_reg(th, LIMIT_REG[i], th->initial_limits[i]); | 165 | write_reg(th, LIMIT_REG[i], th->initial_limits[i]); |
161 | 166 | ||
@@ -212,12 +217,14 @@ static void write_fan_speed(struct thermostat *th, int speed, int fan) | |||
212 | return; | 217 | return; |
213 | 218 | ||
214 | if (th->last_speed[fan] != speed) { | 219 | if (th->last_speed[fan] != speed) { |
215 | if (speed == -1) | 220 | if (verbose) { |
216 | printk(KERN_DEBUG "adt746x: Setting speed to automatic " | 221 | if (speed == -1) |
217 | "for %s fan.\n", sensor_location[fan+1]); | 222 | printk(KERN_DEBUG "adt746x: Setting speed to automatic " |
218 | else | 223 | "for %s fan.\n", sensor_location[fan+1]); |
219 | printk(KERN_DEBUG "adt746x: Setting speed to %d " | 224 | else |
220 | "for %s fan.\n", speed, sensor_location[fan+1]); | 225 | printk(KERN_DEBUG "adt746x: Setting speed to %d " |
226 | "for %s fan.\n", speed, sensor_location[fan+1]); | ||
227 | } | ||
221 | } else | 228 | } else |
222 | return; | 229 | return; |
223 | 230 | ||
@@ -298,10 +305,11 @@ static void update_fans_speed (struct thermostat *th) | |||
298 | if (new_speed > 255) | 305 | if (new_speed > 255) |
299 | new_speed = 255; | 306 | new_speed = 255; |
300 | 307 | ||
301 | printk(KERN_DEBUG "adt746x: setting fans speed to %d " | 308 | if (verbose) |
302 | "(limit exceeded by %d on %s) \n", | 309 | printk(KERN_DEBUG "adt746x: Setting fans speed to %d " |
303 | new_speed, var, | 310 | "(limit exceeded by %d on %s) \n", |
304 | sensor_location[fan_number+1]); | 311 | new_speed, var, |
312 | sensor_location[fan_number+1]); | ||
305 | write_both_fan_speed(th, new_speed); | 313 | write_both_fan_speed(th, new_speed); |
306 | th->last_var[fan_number] = var; | 314 | th->last_var[fan_number] = var; |
307 | } else if (var < -2) { | 315 | } else if (var < -2) { |
@@ -309,8 +317,9 @@ static void update_fans_speed (struct thermostat *th) | |||
309 | * so cold (lastvar >= -1) */ | 317 | * so cold (lastvar >= -1) */ |
310 | if (i == 2 && lastvar < -1) { | 318 | if (i == 2 && lastvar < -1) { |
311 | if (th->last_speed[fan_number] != 0) | 319 | if (th->last_speed[fan_number] != 0) |
312 | printk(KERN_DEBUG "adt746x: Stopping " | 320 | if (verbose) |
313 | "fans.\n"); | 321 | printk(KERN_DEBUG "adt746x: Stopping " |
322 | "fans.\n"); | ||
314 | write_both_fan_speed(th, 0); | 323 | write_both_fan_speed(th, 0); |
315 | } | 324 | } |
316 | } | 325 | } |
@@ -406,7 +415,7 @@ static int attach_one_thermostat(struct i2c_adapter *adapter, int addr, | |||
406 | th->initial_limits[i] = read_reg(th, LIMIT_REG[i]); | 415 | th->initial_limits[i] = read_reg(th, LIMIT_REG[i]); |
407 | set_limit(th, i); | 416 | set_limit(th, i); |
408 | } | 417 | } |
409 | 418 | ||
410 | printk(KERN_INFO "adt746x: Lowering max temperatures from %d, %d, %d" | 419 | printk(KERN_INFO "adt746x: Lowering max temperatures from %d, %d, %d" |
411 | " to %d, %d, %d\n", | 420 | " to %d, %d, %d\n", |
412 | th->initial_limits[0], th->initial_limits[1], | 421 | th->initial_limits[0], th->initial_limits[1], |
diff --git a/drivers/macintosh/therm_pm72.c b/drivers/macintosh/therm_pm72.c index cf72b782f60f..8d0958c38b6b 100644 --- a/drivers/macintosh/therm_pm72.c +++ b/drivers/macintosh/therm_pm72.c | |||
@@ -1988,18 +1988,13 @@ static void fcu_lookup_fans(struct device_node *fcu_node) | |||
1988 | 1988 | ||
1989 | static int fcu_of_probe(struct of_device* dev, const struct of_device_id *match) | 1989 | static int fcu_of_probe(struct of_device* dev, const struct of_device_id *match) |
1990 | { | 1990 | { |
1991 | int rc; | ||
1992 | |||
1993 | state = state_detached; | 1991 | state = state_detached; |
1994 | 1992 | ||
1995 | /* Lookup the fans in the device tree */ | 1993 | /* Lookup the fans in the device tree */ |
1996 | fcu_lookup_fans(dev->node); | 1994 | fcu_lookup_fans(dev->node); |
1997 | 1995 | ||
1998 | /* Add the driver */ | 1996 | /* Add the driver */ |
1999 | rc = i2c_add_driver(&therm_pm72_driver); | 1997 | return i2c_add_driver(&therm_pm72_driver); |
2000 | if (rc < 0) | ||
2001 | return rc; | ||
2002 | return 0; | ||
2003 | } | 1998 | } |
2004 | 1999 | ||
2005 | static int fcu_of_remove(struct of_device* dev) | 2000 | static int fcu_of_remove(struct of_device* dev) |
diff --git a/drivers/macintosh/windfarm_lm75_sensor.c b/drivers/macintosh/windfarm_lm75_sensor.c index fd16642d98ab..57460e46c89f 100644 --- a/drivers/macintosh/windfarm_lm75_sensor.c +++ b/drivers/macintosh/windfarm_lm75_sensor.c | |||
@@ -240,12 +240,7 @@ static int wf_lm75_detach(struct i2c_client *client) | |||
240 | 240 | ||
241 | static int __init wf_lm75_sensor_init(void) | 241 | static int __init wf_lm75_sensor_init(void) |
242 | { | 242 | { |
243 | int rc; | 243 | return i2c_add_driver(&wf_lm75_driver); |
244 | |||
245 | rc = i2c_add_driver(&wf_lm75_driver); | ||
246 | if (rc < 0) | ||
247 | return rc; | ||
248 | return 0; | ||
249 | } | 244 | } |
250 | 245 | ||
251 | static void __exit wf_lm75_sensor_exit(void) | 246 | static void __exit wf_lm75_sensor_exit(void) |