aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/macintosh/windfarm_fcu_controls.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/macintosh/windfarm_fcu_controls.c')
-rw-r--r--drivers/macintosh/windfarm_fcu_controls.c35
1 files changed, 11 insertions, 24 deletions
diff --git a/drivers/macintosh/windfarm_fcu_controls.c b/drivers/macintosh/windfarm_fcu_controls.c
index b3411edb324b..0226b796a21c 100644
--- a/drivers/macintosh/windfarm_fcu_controls.c
+++ b/drivers/macintosh/windfarm_fcu_controls.c
@@ -282,7 +282,7 @@ static const struct wf_control_ops wf_fcu_fan_pwm_ops = {
282 .owner = THIS_MODULE, 282 .owner = THIS_MODULE,
283}; 283};
284 284
285static void __devinit wf_fcu_get_pump_minmax(struct wf_fcu_fan *fan) 285static void wf_fcu_get_pump_minmax(struct wf_fcu_fan *fan)
286{ 286{
287 const struct mpu_data *mpu = wf_get_mpu(0); 287 const struct mpu_data *mpu = wf_get_mpu(0);
288 u16 pump_min = 0, pump_max = 0xffff; 288 u16 pump_min = 0, pump_max = 0xffff;
@@ -317,7 +317,7 @@ static void __devinit wf_fcu_get_pump_minmax(struct wf_fcu_fan *fan)
317 fan->ctrl.name, pump_min, pump_max); 317 fan->ctrl.name, pump_min, pump_max);
318} 318}
319 319
320static void __devinit wf_fcu_get_rpmfan_minmax(struct wf_fcu_fan *fan) 320static void wf_fcu_get_rpmfan_minmax(struct wf_fcu_fan *fan)
321{ 321{
322 struct wf_fcu_priv *pv = fan->fcu_priv; 322 struct wf_fcu_priv *pv = fan->fcu_priv;
323 const struct mpu_data *mpu0 = wf_get_mpu(0); 323 const struct mpu_data *mpu0 = wf_get_mpu(0);
@@ -359,9 +359,8 @@ static void __devinit wf_fcu_get_rpmfan_minmax(struct wf_fcu_fan *fan)
359 fan->ctrl.name, fan->min, fan->max); 359 fan->ctrl.name, fan->min, fan->max);
360} 360}
361 361
362static void __devinit wf_fcu_add_fan(struct wf_fcu_priv *pv, 362static void wf_fcu_add_fan(struct wf_fcu_priv *pv, const char *name,
363 const char *name, 363 int type, int id)
364 int type, int id)
365{ 364{
366 struct wf_fcu_fan *fan; 365 struct wf_fcu_fan *fan;
367 366
@@ -399,7 +398,7 @@ static void __devinit wf_fcu_add_fan(struct wf_fcu_priv *pv,
399 kref_get(&pv->ref); 398 kref_get(&pv->ref);
400} 399}
401 400
402static void __devinit wf_fcu_lookup_fans(struct wf_fcu_priv *pv) 401static void wf_fcu_lookup_fans(struct wf_fcu_priv *pv)
403{ 402{
404 /* Translation of device-tree location properties to 403 /* Translation of device-tree location properties to
405 * windfarm fan names 404 * windfarm fan names
@@ -481,7 +480,7 @@ static void __devinit wf_fcu_lookup_fans(struct wf_fcu_priv *pv)
481 } 480 }
482} 481}
483 482
484static void __devinit wf_fcu_default_fans(struct wf_fcu_priv *pv) 483static void wf_fcu_default_fans(struct wf_fcu_priv *pv)
485{ 484{
486 /* We only support the default fans for PowerMac7,2 */ 485 /* We only support the default fans for PowerMac7,2 */
487 if (!of_machine_is_compatible("PowerMac7,2")) 486 if (!of_machine_is_compatible("PowerMac7,2"))
@@ -496,7 +495,7 @@ static void __devinit wf_fcu_default_fans(struct wf_fcu_priv *pv)
496 wf_fcu_add_fan(pv, "cpu-rear-fan-1", FCU_FAN_RPM, 6); 495 wf_fcu_add_fan(pv, "cpu-rear-fan-1", FCU_FAN_RPM, 6);
497} 496}
498 497
499static int __devinit wf_fcu_init_chip(struct wf_fcu_priv *pv) 498static int wf_fcu_init_chip(struct wf_fcu_priv *pv)
500{ 499{
501 unsigned char buf = 0xff; 500 unsigned char buf = 0xff;
502 int rc; 501 int rc;
@@ -518,8 +517,8 @@ static int __devinit wf_fcu_init_chip(struct wf_fcu_priv *pv)
518 return 0; 517 return 0;
519} 518}
520 519
521static int __devinit wf_fcu_probe(struct i2c_client *client, 520static int wf_fcu_probe(struct i2c_client *client,
522 const struct i2c_device_id *id) 521 const struct i2c_device_id *id)
523{ 522{
524 struct wf_fcu_priv *pv; 523 struct wf_fcu_priv *pv;
525 524
@@ -564,7 +563,7 @@ static int __devinit wf_fcu_probe(struct i2c_client *client,
564 return 0; 563 return 0;
565} 564}
566 565
567static int __devexit wf_fcu_remove(struct i2c_client *client) 566static int wf_fcu_remove(struct i2c_client *client)
568{ 567{
569 struct wf_fcu_priv *pv = dev_get_drvdata(&client->dev); 568 struct wf_fcu_priv *pv = dev_get_drvdata(&client->dev);
570 struct wf_fcu_fan *fan; 569 struct wf_fcu_fan *fan;
@@ -593,19 +592,7 @@ static struct i2c_driver wf_fcu_driver = {
593 .id_table = wf_fcu_id, 592 .id_table = wf_fcu_id,
594}; 593};
595 594
596static int __init wf_fcu_init(void) 595module_i2c_driver(wf_fcu_driver);
597{
598 return i2c_add_driver(&wf_fcu_driver);
599}
600
601static void __exit wf_fcu_exit(void)
602{
603 i2c_del_driver(&wf_fcu_driver);
604}
605
606
607module_init(wf_fcu_init);
608module_exit(wf_fcu_exit);
609 596
610MODULE_AUTHOR("Benjamin Herrenschmidt <benh@kernel.crashing.org>"); 597MODULE_AUTHOR("Benjamin Herrenschmidt <benh@kernel.crashing.org>");
611MODULE_DESCRIPTION("FCU control objects for PowerMacs thermal control"); 598MODULE_DESCRIPTION("FCU control objects for PowerMacs thermal control");