linux/drivers/macintosh/windfarm_fcu_controls.c
<<
n va6.3/spa 6.3/form 6.3a n va6. href="../linux+v3.9.5/drivers/macintosh/windfarm_fcu_controls.c">n va6.3img src="../.static/gfx/right.png" alt=">>">n 3/spa n 3spa class="lxr_search">n va ="+search" method="post" onsubmit="return do_search(this);">n va6.3input typn> hidden" namn> navtarget" ption> ">n va6.3input typn> text" namn> search" id> search">n va6.3butt submit">Searchn va6.Prefs 6.3/a>n 3/spa va6. .3/div va6. .3form ac > ="ajax+*" method="post" onsubmit="return false;">n 3input typn> hidden" namn> ajax_lookup" id> ajax_lookup" ption> ">nva6. .3/form nva6. .3div class="headingbott
search_results" class="search_results" 6 va6. .3/div 3div id> content"> 3div id> file_contents"
c3/1e/10b66f4e7c76be2ee5c1a4e4dfa02ce2d347_3/0" 
L1" class="line" namn>
L1">. .13/a>3spa
 class="comment">/*3/spa
  
L2" class="line" namn>
L2">. .23/a>3spa
 class="comment"> * Windfarm PowerMac thermal control. FCU fan control3/spa
  
L3" class="line" namn>
L3">. .33/a>3spa
 class="comment"> *3/spa
  
L4" class="line" namn>
L4">. .43/a>3spa
 class="comment"> * Copyright 2012 Benjamin Herrenschmidt, IBM Corp.3/spa
  
L5" class="line" namn>
L5">. .53/a>3spa
 class="comment"> *3/spa
  
L6" class="line" namn>
L6">. .63/a>3spa
 class="comment"> * Released under the term of the GNU GPL="v23/spa
  
L7" class="line" namn>
L7">. .73/a>3spa
 class="comment"> */3/spa
  
L8" class="line" namn>
L8">. .83/a>#undef.3a href="+code=DEBUG" class="sref">DEBUG3/a>n
L9" class="line" namn>
L9">. .93/a>n
L10" class="line" namn>
L10">. .10"a>#include <linux/typns.h0"a>>n
L11" class="line" namn>
L11">. 110"a>#include <linux/errno.h0"a>>n
L12" class="line" namn>
L12">. 120"a>#include <linux/kernel.h0"a>>n
L13" class="line" namn>
L13">. 130"a>#include <linux/delay.h0"a>>n
L14" class="line" namn>
L14">. 140"a>#include <linux/slab.h0"a>>n
L15" class="line" namn>
L15">. 150"a>#include <linux/init.h0"a>>n
L16" class="line" namn>
L16">. 160"a>#include <linux/wait.h0"a>>n
L17" class="line" namn>
L17">. 170"a>#include <linux/i2c.h0"a>>n
L18" class="line" namn>
L18">. 180"a>#include <asm/prom.h0"a>>n
L19" class="line" namn>
L19">. 190"a>#include <asm/machdep.h0"a>>n
L20" class="line" namn>
L20">. 210"a>#include <asm/io.h0"a>>n
L21" class="line" namn>
L21">. 210"a>#include <asm/sec  >
s.h0"a>>n
L22" class="line" namn>
L22">. 223/a>n
L23" class="line" namn>
L23">. 230"a>#include "windfarm.h0"a>"n
L24" class="line" namn>
L24">. 240"a>#include "windfarm_mpu.h0"a>"n
L25" class="line" namn>
L25">. 253/a>n
L26" class="line" namn>
L26">. 260"a>#define.3a href="+code=VERSION" class="sref">VERSION0"a> 3spa
 class="string">"1.0"
L27" class="line" namn>
L27">. 273/a>n
L28" class="line" namn>
L28">. 280"a>#ifdef.3a href="+code=DEBUG" class="sref">DEBUG3/a>n
L29" class="line" namn>
L29">. 290"a>#define.3a href="+code=DBG" class="sref">DBG3/a>(3a href="+code=args" class="sref">args3/a>...)6. .3a href="+code=printk" class="sref">printk3/a>(3a href="+code=args" class="sref">args3/a>) 
L30" class="line" namn>
L30">. 310"a>#else 
L31" class="line" namn>
L31">. 310"a>#define.3a href="+code=DBG" class="sref">DBG3/a>(3a href="+code=args" class="sref">args3/a>...)6. .do { } while(0) 
L32" class="line" namn>
L32">. 320"a>#endif 
L33" class="line" namn>
L33">. 333/a>n
L34" class="line" namn>
L34">. 343/a>3spa
 class="comment">/*3/spa
  
L35" class="line" namn>
L35">. 353/a>3spa
 class="comment"> * This 2.12
L36" class="line" namn>
L36">. 363/a>3spa
 class="comment"> * the control loop for the RPMs fans (not PWMs) will apply the3/spa
  
L37" class="line" namn>
L37">. 373/a>3spa
 class="comment"> * correc  >
 factor obtained from the PID to.the actual RPM3/spa
  
L38" class="line" namn>
L38">. 383/a>3spa
 class="comment"> * speed read from the FCU23/spa
  
L39" class="line" namn>
L39">. 393/a>3spa
 class="comment"> *3/spa
  
L40" class="line" namn>
L40">. 403/a>3spa
 class="comment"> * If you define.the below constant to.0,.the/oit will be3/spa
  
L41" class="line" namn>
L41">. 413/a>3spa
 class="comment"> * applied to.the setpoint RPM speed,.thatois basically the3/spa
  
L42" class="line" namn>
L42">. 423/a>3spa
 class="comment"> * speed we proviously "asked" for23/spa
  
L43" class="line" namn>
L43">. 433/a>3spa
 class="comment"> *3/spa
  
L44" class="line" namn>
L44">. 443/a>3spa
 class="comment"> * I'm using 0 for now whichois whatotherm_pm72 used to.do and3/spa
  
L45" class="line" namn>
L45">. 453/a>3spa
 class="comment"> * whatoDarwin -apparently-.does based >
 observed behaviour23/spa
  
L46" class="line" namn>
L46">. 463/a>3spa
 class="comment"> */3/spa
  
L47" class="line" namn>
L47">. 470"a>#define.3a href="+code=RPM_PID_USE_ACTUAL_SPEED" class="sref">RPM_PID_USE_ACTUAL_SPEED0"a>        0 
L48" class="line" namn>
L48">. 483/a>n
L49" class="line" namn>
L49">. 493/a>3spa
 class="comment">/* Default min/max for pumps */3/spa
  
L50" class="line" namn>
L50">. 500"a>#define.3a href="+code=CPU_PUMP_OUTPUT_MAX" class="sref">CPU_PUMP_OUTPUT_MAX0"a>             3200 
L51" class="line" namn>
L51">. 510"a>#define.3a href="+code=CPU_PUMP_OUTPUT_MIN" class="sref">CPU_PUMP_OUTPUT_MIN0"a>             1250 
L52" class="line" namn>
L52">. 523/a>n
L53" class="line" namn>
L53">. 530"a>#define.3a href="+code=FCU_FAN_RPM" class="sref">FCU_FAN_RPM0"a>             0 
L54" class="line" namn>
L54">. 540"a>#define.3a href="+code=FCU_FAN_PWM" class="sref">FCU_FAN_PWM0"a>             1 
L55" class="line" namn>
L55">. 553/a>n
L56" class="line" namn>
L56">. 563/a>struct.3a href="+code=wf_fcu_priv" class="sref">wf_fcu_priv0"a> {n
L57" class="line" namn>
L57">. 570"a>        struct.3a href="+code=kref" class="sref">kref0"a>             3a href="+code=ref" class="sref">ref0"a>;n
L58" class="line" namn>
L58">. 580"a>        struct.3a href="+code=i2c_client" class="sref">i2c_client0"a>       *3a href="+code=i2c" class="sref">i2c0"a>;n
L59" class="line" namn>
L59">. 590"a>        struct.3a href="+code=mutex" class="sref">mutex0"a>            3a href="+code=lock" class="sref">lock0"a>;n
L60" class="line" namn>
L60">. 600"a>        struct.3a href="+code=list_head" class="sref">list_head0"a>        3a href="+code=fan_list" class="sref">fan_list0"a>;n
L61" class="line" namn>
L61">. 610"a>        int                     3a href="+code=rpm_shift" class="sref">rpm_shift0"a>;n
L62" class="line" namn>
L62">. 623/a>};n
L63" class="line" namn>
L63">. 633/a>n
L64" class="line" namn>
L64">. 643/a>struct.3a href="+code=wf_fcu_fan" class="sref">wf_fcu_fan0"a> {n
L65" class="line" namn>
L65">. 650"a>        struct.3a href="+code=list_head" class="sref">list_head0"a>        3a href="+code=link" class="sref">link0"a>;n
L66" class="line" namn>
L66">. 660"a>        int                     3a href="+code=id" class="sref">id0"a>;n
L67" class="line" namn>
L67">. 670"a>        3a href="+code=s32" class="sref">s320"a>                     3a href="+code=min" class="sref">min0"a>, 3a href="+code=max" class="sref">max0"a>, 3a href="+code=target" class="sref">target0"a>;n
L68" class="line" namn>
L68">. 680"a>        struct.3a href="+code=wf_fcu_priv" class="sref">wf_fcu_priv0"a>      *3a href="+code=fcu_priv" class="sref">fcu_priv0"a>;n
L69" class="line" namn>
L69">. 690"a>        struct.3a href="+code=wf_control" class="sref">wf_control3/a>       3a href="+code=ctrl" class="sref">ctrl0"a>;n
L70" class="line" namn>
L70">. 703/a>};n
L71" class="line" namn>
L71">. 713/a>n
L72" class="line" namn>
L72">. 723/a>static void.3a href="+code=wf_fcu_release" class="sref">wf_fcu_release3/a>(struct.3a href="+code=kref" class="sref">kref0"a> *3a href="+code=ref" class="sref">ref0"a>) 
L73" class="line" namn>
L73">. 733/a>{n
L74" class="line" namn>
L74">. 740"a>        struct.3a href="+code=wf_fcu_priv" class="sref">wf_fcu_priv0"a> *3a href="+code=pv" class="sref">pv0"a> = 3a href="+code=container_of" class="sref">container_of3/a>(3a href="+code=ref" class="sref">ref0"a>, struct.3a href="+code=wf_fcu_priv" class="sref">wf_fcu_priv0"a>, 3a href="+code=ref" class="sref">ref0"a>);n
L75" class="line" namn>
L75">. 753/a>n
L76" class="line" namn>
L76">. 760"a>        3a href="+code=kfree" class="sref">kfree3/a>(3a href="+code=pv" class="sref">pv0"a>);n
L77" class="line" namn>
L77">. 770"a>}n
L78" class="line" namn>
L78">. 783/a>n
L79" class="line" namn>
L79">. 793/a>static void.3a href="+code=wf_fcu_fan_release" class="sref">wf_fcu_fan_release3/a>(struct.3a href="+code=wf_control" class="sref">wf_control3/a> *3a href="+code=ct" class="sref">ct0"a>) 
L80" class="line" namn>
L80">. 803/a>{n
L81" class="line" namn>
L81">. 810"a>        struct.3a href="+code=wf_fcu_fan" class="sref">wf_fcu_fan0"a> *3a href="+code=fan" class="sref">fan0"a> = 3a href="+code=ct" class="sref">ct0"a>->3a href="+code=priv" class="sref">priv0"a>;n
L82" class="line" namn>
L82">. 823/a>n
L83" class="line" namn>
L83">. 830"a>        3a href="+code=kref_put" class="sref">kref_put3/a>(&3a href="+code=fan" class="sref">fan0"a>->3a href="+code=fcu_priv" class="sref">fcu_priv0"a>->3a href="+code=ref" class="sref">ref0"a>, 3a href="+code=wf_fcu_release" class="sref">wf_fcu_release3/a>);n
L84" class="line" namn>
L84">. 840"a>        3a href="+code=kfree" class="sref">kfree3/a>(3a href="+code=fan" class="sref">fan0"a>);n
L85" class="line" namn>
L85">. 850"a>}n
L86" class="line" namn>
L86">. 863/a>n
L87" class="line" namn>
L87">. 873/a>static int 3a href="+code=wf_fcu_read_reg" class="sref">wf_fcu_read_reg3/a>(struct.3a href="+code=wf_fcu_priv" class="sref">wf_fcu_priv0"a> *3a href="+code=pv" class="sref">pv0"a>, int 3a href="+code=reg" class="sref">reg3/a>,n
L88" class="line" namn>
L88">. 880"a>                           unsigned char *3a href="+code=buf" class="sref">buf0"a>, int 3a href="+code=nb" class="sref">nb0"a>) 
L89" class="line" namn>
L89">. 893/a>{n
L90" class="line" namn>
L90">. 900"a>        int 3a href="+code=tries" class="sref">tries0"a>, 3a href="+code=nr" class="sref">nr0"a>, 3a href="+code=nw" class="sref">nw0"a>;n
L91" class="line" namn>
L91">. 913/a>n
L92" class="line" namn>
L92">. 920"a>        3a href="+code=mutex_lock" class="sref">mutex_lock3/a>(&3a href="+code=pv" class="sref">pv0"a>->3a href="+code=lock" class="sref">lock0"a>);n
L93" class="line" namn>
L93">. 933/a>n
L94" class="line" namn>
L94">. 940"a>        3a href="+code=buf" class="sref">buf0"a>[0] = 3a href="+code=reg" class="sref">reg3/a>;n
L95" class="line" namn>
L95">. 950"a>        3a href="+code=tries" class="sref">tries0"a> = 0;n
L96" class="line" namn>
L96">. 960"a>        for (;;) {n
L97" class="line" namn>
L97">. 970"a>                3a href="+code=nw" class="sref">nw0"a> = 3a href="+code=i2c_master_send" class="sref">i2c_master_send3/a>(3a href="+code=pv" class="sref">pv0"a>->3a href="+code=i2c" class="sref">i2c0"a>, 3a href="+code=buf" class="sref">buf0"a>, 1);n
L98" class="line" namn>
L98">. 980"a>                if (3a href="+code=nw" class="sref">nw0"a> > 0 || (3a href="+code=nw" class="sref">nw0"a> < 0 && 3a href="+code=nw" class="sref">nw0"a> != -3a href="+code=EIO" class="sref">EIO0"a>) || 3a href="+code=tries" class="sref">tries0"a> >= 100) 
L99" class="line" namn>
L99">. 990"a>                        break;n
L100" class="line" namn>
L100">.1000"a>                3a href="+code=msleep" class="sref">msleep3/a>(10);n
L101" class="line" namn>
L101">.1010"a>                ++3a href="+code=tries" class="sref">tries0"a>;n
L102" class="line" namn>
L102">.1020"a>        }n
L103" class="line" namn>
L103">.1030"a>        if (3a href="+code=nw" class="sref">nw0"a> <= 0) {n
L104" class="line" namn>
L104">.1040"a>                3a href="+code=pr_err" class="sref">pr_err3/a>(3spa
 class="string">"Failure writing address to.FCU: %d"nw0"a>);n
L105" class="line" namn>
L105">.1050"a>                3a href="+code=nr" class="sref">nr0"a> = 3a href="+code=nw" class="sref">nw0"a>;n
L106" class="line" namn>
L106">.1060"a>                goto.3a href="+code=bail" class="sref">bail0"a>;n
L107" class="line" namn>
L107">.1070"a>        }n
L108" class="line" namn>
L108">.1080"a>        3a href="+code=tries" class="sref">tries0"a> = 0;n
L109" class="line" namn>
L109">.1090"a>        for (;;) {n
L110" class="line" namn>
L110">.1100"a>                3a href="+code=nr" class="sref">nr0"a> = 3a href="+code=i2c_master_recv" class="sref">i2c_master_recv3/a>(3a href="+code=pv" class="sref">pv0"a>->3a href="+code=i2c" class="sref">i2c0"a>, 3a href="+code=buf" class="sref">buf0"a>, 3a href="+code=nb" class="sref">nb0"a>);n
L111" class="line" namn>
L111">.1110"a>                if (3a href="+code=nr" class="sref">nr0"a> > 0 || (3a href="+code=nr" class="sref">nr0"a> < 0 && 3a href="+code=nr" class="sref">nr0"a> != -3a href="+code=ENODEV" class="sref">ENODEV0"a>) || 3a href="+code=tries" class="sref">tries0"a> >= 100) 
L112" class="line" namn>
L112">.1120"a>                        break;n
L113" class="line" namn>
L113">.1130"a>                3a href="+code=msleep" class="sref">msleep3/a>(10);n
L114" class="line" namn>
L114">.1140"a>                ++3a href="+code=tries" class="sref">tries0"a>;n
L115" class="line" namn>
L115">.1150"a>        }n
L116" class="line" namn>
L116">.1160"a>        if (3a href="+code=nr" class="sref">nr0"a> <= 0)n
L117" class="line" namn>
L117">.1170"a>                3a href="+code=pr_err" class="sref">pr_err3/a>(3spa
 class="string">"wf_fcu: Failure reading data from FCU: %d"nw0"a>);n
L118" class="line" namn>
L118">.1180"a>.3a href="+code=bail" class="sref">bail0"a>:n
L119" class="line" namn>
L119">.1190"a>        3a href="+code=mutex_unlock" class="sref">mutex_unlock3/a>(&3a href="+code=pv" class="sref">pv0"a>->3a href="+code=lock" class="sref">lock0"a>);n
L120" class="line" namn>
L120">.1200"a>        return 3a href="+code=nr" class="sref">nr0"a>;n
L121" class="line" namn>
L121">.1210"a>}n
L122" class="line" namn>
L122">.1223/a>n
L123" class="line" namn>
L123">.1230"a>static int 3a href="+code=wf_fcu_write_reg" class="sref">wf_fcu_write_reg3/a>(struct.3a href="+code=wf_fcu_priv" class="sref">wf_fcu_priv0"a> *3a href="+code=pv" class="sref">pv0"a>, int 3a href="+code=reg" class="sref">reg3/a>,n
L124" class="line" namn>
L124">.1240"a>                            const unsigned char *3a href="+code=ptr" class="sref">ptr0"a>, int 3a href="+code=nb" class="sref">nb0"a>) 
L125" class="line" namn>
L125">.1253/a>{n
L126" class="line" namn>
L126">.1260"a>        int 3a href="+code=tries" class="sref">tries0"a>, 3a href="+code=nw" class="sref">nw0"a>;n
L127" class="line" namn>
L127">.1270"a>        unsigned char 3a href="+code=buf" class="sref">buf0"a>[16];n
L128" class="line" namn>
L128">.1283/a>n
L129" class="line" namn>
L129">.1290"a>        3a href="+code=buf" class="sref">buf0"a>[0] = 3a href="+code=reg" class="sref">reg3/a>;n
L130" class="line" namn>
L130">.1300"a>        3a href="+code=memcpy" class="sref">memcpy3/a>(3a href="+code=buf" class="sref">buf0"a>+1, 3a href="+code=ptr" class="sref">ptr0"a>, 3a href="+code=nb" class="sref">nb0"a>);n
L131" class="line" namn>
L131">.1310"a>        ++3a href="+code=nb" class="sref">nb0"a>;n
L132" class="line" namn>
L132">.1320"a>        3a href="+code=tries" class="sref">tries0"a> = 0;n
L133" class="line" namn>
L133">.1330"a>        for (;;) {n
L134" class="line" namn>
L134">.1340"a>                3a href="+code=nw" class="sref">nw0"a> = 3a href="+code=i2c_master_send" class="sref">i2c_master_send3/a>(3a href="+code=pv" class="sref">pv0"a>->3a href="+code=i2c" class="sref">i2c0"a>, 3a href="+code=buf" class="sref">buf0"a>, 3a href="+code=nb" class="sref">nb0"a>);n
L135" class="line" namn>
L135">.1350"a>                if (3a href="+code=nw" class="sref">nw0"a> > 0 || (3a href="+code=nw" class="sref">nw0"a> < 0 && 3a href="+code=nw" class="sref">nw0"a> != -3a href="+code=EIO" class="sref">EIO0"a>) || 3a href="+code=tries" class="sref">tries0"a> >= 100) 
L136" class="line" namn>
L136">.1360"a>                        break;n
L137" class="line" namn>
L137">.1370"a>                3a href="+code=msleep" class="sref">msleep3/a>(10);n
L138" class="line" namn>
L138">.1380"a>                ++3a href="+code=tries" class="sref">tries0"a>;n
L139" class="line" namn>
L139">.1390"a>        }n
L140" class="line" namn>
L140">.1400"a>        if (3a href="+code=nw" class="sref">nw0"a> < 0)n
L141" class="line" namn>
L141">.1410"a>                3a href="+code=pr_err" class="sref">pr_err3/a>(3spa
 class="string">"wf_fcu: Failure writing to.FCU: %d"nw0"a>);n
L142" class="line" namn>
L142">.1420"a>        return 3a href="+code=nw" class="sref">nw0"a>;n
L143" class="line" namn>
L143">.1433/a>}n
L144" class="line" namn>
L144">.1443/a>n
L145" class="line" namn>
L145">.1453/a>static int 3a href="+code=wf_fcu_fan_set_rpm" class="sref">wf_fcu_fan_set_rpm3/a>(struct.3a href="+code=wf_control" class="sref">wf_control3/a> *3a href="+code=ct" class="sref">ct0"a>, 3a href="+code=s32" class="sref">s320"a> 3a href="+code=ption" class="sref">ption0"a>) 
L146" class="line" namn>
L146">.1463/a>{n
L147" class="line" namn>
L147">.1470"a>        struct.3a href="+code=wf_fcu_fan" class="sref">wf_fcu_fan0"a> *3a href="+code=fan" class="sref">fan0"a> = 3a href="+code=ct" class="sref">ct0"a>->3a href="+code=priv" class="sref">priv0"a>;n
L148" class="line" namn>
L148">.1480"a>        struct.3a href="+code=wf_fcu_priv" class="sref">wf_fcu_priv0"a> *3a href="+code=pv" class="sref">pv0"a> = 3a href="+code=fan" class="sref">fan0"a>->3a href="+code=fcu_priv" class="sref">fcu_priv0"a>;n
L149" class="line" namn>
L149">.1490"a>        int 3a href="+code=rc" class="sref">rc0"a>, 3a href="+code=shift" class="sref">shift0"a> = 3a href="+code=pv" class="sref">pv0"a>->3a href="+code=rpm_shift" class="sref">rpm_shift0"a>;n
L150" class="line" namn>
L150">.1500"a>        unsigned char 3a href="+code=buf" class="sref">buf0"a>[2];n
L151" class="line" namn>
L151">.1513/a>n
L152" class="line" namn>
L152">.1520"a>        if (3a href="+code=ption" class="sref">ption0"a> < 3a href="+code=fan" class="sref">fan0"a>->3a href="+code=min" class="sref">min0"a>) 
L153" class="line" namn>
L153">.1530"a>                3a href="+code=ption" class="sref">ption0"a> = 3a href="+code=fan" class="sref">fan0"a>->3a href="+code=min" class="sref">min0"a>;n
L154" class="line" namn>
L154">.1540"a>        if (3a href="+code=ption" class="sref">ption0"a> > 3a href="+code=fan" class="sref">fan0"a>->3a href="+code=max" class="sref">max0"a>) 
L155" class="line" namn>
L155">.1550"a>                3a href="+code=ption" class="sref">ption0"a> = 3a href="+code=fan" class="sref">fan0"a>->3a href="+code=max" class="sref">max0"a>;n
L156" class="line" namn>
L156">.1563/a>n
L157" class="line" namn>
L157">.1570"a>        3a href="+code=fan" class="sref">fan0"a>->3a href="+code=target" class="sref">target0"a> = 3a href="+code=ption" class="sref">ption0"a>;n
L158" class="line" namn>
L158">.1583/a>n
L159" class="line" namn>
L159">.1590"a>        3a href="+code=buf" class="sref">buf0"a>[0] = 3a href="+code=ption" class="sref">ption0"a> >> (8 - 3a href="+code=shift" class="sref">shift0"a>);n
L160" class="line" namn>
L160">.1600"a>        3a href="+code=buf" class="sref">buf0"a>[1] = 3a href="+code=ption" class="sref">ption0"a> << 3a href="+code=shift" class="sref">shift0"a>;n
L161" class="line" namn>
L161">.1610"a>        3a href="+code=rc" class="sref">rc0"a> = 3a href="+code=wf_fcu_write_reg" class="sref">wf_fcu_write_reg3/a>(3a href="+code=pv" class="sref">pv0"a>, 0x10 + (3a href="+code=fan" class="sref">fan0"a>->3a href="+code=id" class="sref">id0"a> * 2), 3a href="+code=buf" class="sref">buf0"a>, 2);n
L162" class="line" namn>
L162">.1620"a>        if (3a href="+code=rc" class="sref">rc0"a> < 0)n
L163" class="line" namn>
L163">.1630"a>                return -3a href="+code=EIO" class="sref">EIO0"a>;n
L164" class="line" namn>
L164">.1640"a>        return 0;n
L165" class="line" namn>
L165">.1650"a>}n
L166" class="line" namn>
L166">.1663/a>n
L167" class="line" namn>
L167">.1673/a>static int 3a href="+code=wf_fcu_fan_get_rpm" class="sref">wf_fcu_fan_get_rpm3/a>(struct.3a href="+code=wf_control" class="sref">wf_control3/a> *3a href="+code=ct" class="sref">ct0"a>, 3a href="+code=s32" class="sref">s320"a> *3a href="+code=ption" class="sref">ption0"a>) 
L168" class="line" namn>
L168">.1680"a>{n
L169" class="line" namn>
L169">.1690"a>        struct.3a href="+code=wf_fcu_fan" class="sref">wf_fcu_fan0"a> *3a href="+code=fan" class="sref">fan0"a> = 3a href="+code=ct" class="sref">ct0"a>->3a href="+code=priv" class="sref">priv0"a>;n
L170" class="line" namn>
L170">.1700"a>        struct.3a href="+code=wf_fcu_priv" class="sref">wf_fcu_priv0"a> *3a href="+code=pv" class="sref">pv0"a> = 3a href="+code=fan" class="sref">fan0"a>->3a href="+code=fcu_priv" class="sref">fcu_priv0"a>;n
L171" class="line" namn>
L171">.1710"a>        int 3a href="+code=rc" class="sref">rc0"a>, 3a href="+code=reg_base" class="sref">reg_base0"a>, 3a href="+code=shift" class="sref">shift0"a> = 3a href="+code=pv" class="sref">pv0"a>->3a href="+code=rpm_shift" class="sref">rpm_shift0"a>;n
L172" class="line" namn>
L172">.1720"a>        unsigned char 3a href="+code=failure" class="sref">failure0"a>;n
L173" class="line" namn>
L173">.1730"a>        unsigned char 3a href="+code=active" class="sref">active0"a>;n
L174" class="line" namn>
L174">.1740"a>        unsigned char 3a href="+code=buf" class="sref">buf0"a>[2];n
L175" class="line" namn>
L175">.1753/a>n
L176" class="line" namn>
L176">.1760"a>        3a href="+code=rc" class="sref">rc0"a> = 3a href="+code=wf_fcu_read_reg" class="sref">wf_fcu_read_reg3/a>(3a href="+code=pv" class="sref">pv0"a>, 0xb, &3a href="+code=failure" class="sref">failure0"a>, 1);n
L177" class="line" namn>
L177">.1770"a>        if (3a href="+code=rc" class="sref">rc0"a> != 1)n
L178" class="line" namn>
L178">.1780"a>                return -3a href="+code=EIO" class="sref">EIO0"a>;n
L179" class="line" namn>
L179">.1790"a>        if ((3a href="+code=failure" class="sref">failure0"a> & (1 << 3a href="+code=fan" class="sref">fan0"a>->3a href="+code=id" class="sref">id0"a>)) != 0)n
L180" class="line" namn>
L180">.1800"a>                return -3a href="+code=EFAULT" class="sref">EFAULT0"a>;n
L181" class="line" namn>
L181">.1810"a>        3a href="+code=rc" class="sref">rc0"a> = 3a href="+code=wf_fcu_read_reg" class="sref">wf_fcu_read_reg3/a>(3a href="+code=pv" class="sref">pv0"a>, 0xd, &3a href="+code=active" class="sref">active0"a>, 1);n
L182" class="line" namn>
L182">.1820"a>        if (3a href="+code=rc" class="sref">rc0"a> != 1)n
L183" class="line" namn>
L183">.1830"a>                return -3a href="+code=EIO" class="sref">EIO0"a>;n
L184" class="line" namn>
L184">.1840"a>        if ((3a href="+code=active" class="sref">active0"a> & (1 << 3a href="+code=fan" class="sref">fan0"a>->3a href="+code=id" class="sref">id0"a>)) == 0)n
L185" class="line" namn>
L185">.1850"a>                return -3a href="+code=ENXIO" class="sref">ENXIO0"a>;n
L186" class="line" namn>
L186">.1863/a>n
L187" class="line" namn>
L187">.1870"a>        3spa
 class="comment">/* Programmed ption or real current speed */3/spa
  
L188" class="line" namn>
L188">.1880"a>#if 3a href="+code=RPM_PID_USE_ACTUAL_SPEED" class="sref">RPM_PID_USE_ACTUAL_SPEED0"a> 
L189" class="line" namn>
L189">.1890"a>        3a href="+code=reg_base" class="sref">reg_base0"a> = 0x11;n
L190" class="line" namn>
L190">.1910"a>#else 
L191" class="line" namn>
L191">.1910"a>        3a href="+code=reg_base" class="sref">reg_base0"a> = 0x10;n
L192" class="line" namn>
L192">.1920"a>#endif 
L193" class="line" namn>
L193">.1930"a>        3a href="+code=rc" class="sref">rc0"a> = 3a href="+code=wf_fcu_read_reg" class="sref">wf_fcu_read_reg3/a>(3a href="+code=pv" class="sref">pv0"a>, 3a href="+code=reg_base" class="sref">reg_base0"a> + (3a href="+code=fan" class="sref">fan0"a>->3a href="+code=id" class="sref">id0"a> * 2), 3a href="+code=buf" class="sref">buf0"a>, 2);n
L194" class="line" namn>
L194">.1940"a>        if (3a href="+code=rc" class="sref">rc0"a> != 2)n
L195" class="line" namn>
L195">.1950"a>                return -3a href="+code=EIO" class="sref">EIO0"a>;n
L196" class="line" namn>
L196">.1963/a>n
L197" class="line" namn>
L197">.1970"a>        *3a href="+code=ption" class="sref">ption0"a> = (3a href="+code=buf" class="sref">buf0"a>[0] << (8 - 3a href="+code=shift" class="sref">shift0"a>)) | 3a href="+code=buf" class="sref">buf0"a>[1] >> 3a href="+code=shift" class="sref">shift0"a>;n
L198" class="line" namn>
L198">.1983/a>n
L199" class="line" namn>
L199">.1990"a>        return 0;n
L200" class="line" namn>
L200">.2000"a>}n
L201" class="line" namn>
L201">.2013/a>n
L202" class="line" namn>
L202">.2023/a>static int 3a href="+code=wf_fcu_fan_set_pwm" class="sref">wf_fcu_fan_set_pwm3/a>(struct.3a href="+code=wf_control" class="sref">wf_control3/a> *3a href="+code=ct" class="sref">ct0"a>, 3a href="+code=s32" class="sref">s320"a> 3a href="+code=ption" class="sref">ption0"a>) 
L203" class="line" namn>
L203">.2033/a>{n
L204" class="line" namn>
L204">.2040"a>        struct.3a href="+code=wf_fcu_fan" class="sref">wf_fcu_fan0"a> *3a href="+code=fan" class="sref">fan0"a> = 3a href="+code=ct" class="sref">ct0"a>->3a href="+code=priv" class="sref">priv0"a>;n
L205" class="line" namn>
L205">.2050"a>        struct.3a href="+code=wf_fcu_priv" class="sref">wf_fcu_priv0"a> *3a href="+code=pv" class="sref">pv0"a> = 3a href="+code=fan" class="sref">fan0"a>->3a href="+code=fcu_priv" class="sref">fcu_priv0"a>;n
L206" class="line" namn>
L206">.2060"a>        unsigned char 3a href="+code=buf" class="sref">buf0"a>[2];n
L207" class="line" namn>
L207">.2070"a>        int 3a href="+code=rc" class="sref">rc0"a>;n
L208" class="line" namn>
L208">.2083/a>n
L209" class="line" namn>
L209">.2090"a>        if (3a href="+code=ption" class="sref">ption0"a> < 3a href="+code=fan" class="sref">fan0"a>->3a href="+code=min" class="sref">min0"a>) 
L210" class="line" namn>
L210">.2100"a>                3a href="+code=ption" class="sref">ption0"a> = 3a href="+code=fan" class="sref">fan0"a>->3a href="+code=min" class="sref">min0"a>;n
L211" class="line" namn>
L211">.2110"a>        if (3a href="+code=ption" class="sref">ption0"a> > 3a href="+code=fan" class="sref">fan0"a>->3a href="+code=max" class="sref">max0"a>) 
L212" class="line" namn>
L212">.2120"a>                3a href="+code=ption" class="sref">ption0"a> = 3a href="+code=fan" class="sref">fan0"a>->3a href="+code=max" class="sref">max0"a>;n
L213" class="line" namn>
L213">.2133/a>n
L214" class="line" namn>
L214">.2140"a>        3a href="+code=fan" class="sref">fan0"a>->3a href="+code=target" class="sref">target0"a> = 3a href="+code=ption" class="sref">ption0"a>;n
L215" class="line" namn>
L215">.2153/a>n
L216" class="line" namn>
L216">.2160"a>        3a href="+code=ption" class="sref">ption0"a> = (3a href="+code=ption" class="sref">ption0"a> * 2559) / 1000;n
L217" class="line" namn>
L217">.2170"a>        3a href="+code=buf" class="sref">buf0"a>[0] = 3a href="+code=ption" class="sref">ption0"a>;n
L218" class="line" namn>
L218">.2180"a>        3a href="+code=rc" class="sref">rc0"a> = 3a href="+code=wf_fcu_write_reg" class="sref">wf_fcu_write_reg3/a>(3a href="+code=pv" class="sref">pv0"a>, 0x30 + (3a href="+code=fan" class="sref">fan0"a>->3a href="+code=id" class="sref">id0"a> * 2), 3a href="+code=buf" class="sref">buf0"a>, 1);n
L219" class="line" namn>
L219">.2190"a>        if (3a href="+code=rc" class="sref">rc0"a> < 0)n
L220" class="line" namn>
L220">.2200"a>                return -3a href="+code=EIO" class="sref">EIO0"a>;n
L221" class="line" namn>
L221">.2210"a>        return 0;n
L222" class="line" namn>
L222">.2223/a>}n
L223" class="line" namn>
L223">.2233/a>n
L224" class="line" namn>
L224">.2243/a>static int 3a href="+code=wf_fcu_fan_get_pwm" class="sref">wf_fcu_fan_get_pwm3/a>(struct.3a href="+code=wf_control" class="sref">wf_control3/a> *3a href="+code=ct" class="sref">ct0"a>, 3a href="+code=s32" class="sref">s320"a> *3a href="+code=ption" class="sref">ption0"a>) 
L225" class="line" namn>
L225">.2253/a>{n
L226" class="line" namn>
L226">.2260"a>        struct.3a href="+code=wf_fcu_fan" class="sref">wf_fcu_fan0"a> *3a href="+code=fan" class="sref">fan0"a> = 3a href="+code=ct" class="sref">ct0"a>->3a href="+code=priv" class="sref">priv0"a>;n
L227" class="line" namn>
L227">.2270"a>        struct.3a href="+code=wf_fcu_priv" class="sref">wf_fcu_priv0"a> *3a href="+code=pv" class="sref">pv0"a> = 3a href="+code=fan" class="sref">fan0"a>->3a href="+code=fcu_priv" class="sref">fcu_priv0"a>;n
L228" class="line" namn>
L228">.2280"a>        unsigned char 3a href="+code=failure" class="sref">failure0"a>;n
L229" class="line" namn>
L229">.2290"a>        unsigned char 3a href="+code=active" class="sref">active0"a>;n
L230" class="line" namn>
L230">.2300"a>        unsigned char 3a href="+code=buf" class="sref">buf0"a>[2];n
L231" class="line" namn>
L231">.2310"a>        int 3a href="+code=rc" class="sref">rc0"a>;n
L232" class="line" namn>
L232">.2323/a>n
L233" class="line" namn>
L233">.2330"a>        3a href="+code=rc" class="sref">rc0"a> = 3a href="+code=wf_fcu_read_reg" class="sref">wf_fcu_read_reg3/a>(3a href="+code=pv" class="sref">pv0"a>, 0x2b, &3a href="+code=failure" class="sref">failure0"a>, 1);n
L234" class="line" namn>
L234">.2340"a>        if (3a href="+code=rc" class="sref">rc0"a> != 1)n
L235" class="line" namn>
L235">.2350"a>                return -3a href="+code=EIO" class="sref">EIO0"a>;n
L236" class="line" namn>
L236">.2360"a>        if ((3a href="+code=failure" class="sref">failure0"a> & (1 << 3a href="+code=fan" class="sref">fan0"a>->3a href="+code=id" class="sref">id0"a>)) != 0)n
L237" class="line" namn>
L237">.2370"a>                return -3a href="+code=EFAULT" class="sref">EFAULT0"a>;n
L238" class="line" namn>
L238">.2380"a>        3a href="+code=rc" class="sref">rc0"a> = 3a href="+code=wf_fcu_read_reg" class="sref">wf_fcu_read_reg3/a>(3a href="+code=pv" class="sref">pv0"a>, 0x2d, &3a href="+code=active" class="sref">active0"a>, 1);n
L239" class="line" namn>
L239">.2390"a>        if (3a href="+code=rc" class="sref">rc0"a> != 1)n
L240" class="line" namn>
L240">.2400"a>                return -3a href="+code=EIO" class="sref">EIO0"a>;n
L241" class="line" namn>
L241">.2410"a>        if ((3a href="+code=active" class="sref">active0"a> & (1 << 3a href="+code=fan" class="sref">fan0"a>->3a href="+code=id" class="sref">id0"a>)) == 0)n
L242" class="line" namn>
L242">.2420"a>                return -3a href="+code=ENXIO" class="sref">ENXIO0"a>;n
L243" class="line" namn>
L243">.2433/a>n
L244" class="line" namn>
L244">.2440"a>        3a href="+code=rc" class="sref">rc0"a> = 3a href="+code=wf_fcu_read_reg" class="sref">wf_fcu_read_reg3/a>(3a href="+code=pv" class="sref">pv0"a>, 0x30 + (3a href="+code=fan" class="sref">fan0"a>->3a href="+code=id" class="sref">id0"a> * 2), 3a href="+code=buf" class="sref">buf0"a>, 1);n
L245" class="line" namn>
L245">.2450"a>        if (3a href="+code=rc" class="sref">rc0"a> != 1)n
L246" class="line" namn>
L246">.2460"a>                return -3a href="+code=EIO" class="sref">EIO0"a>;n
L247" class="line" namn>
L247">.2470"a>n
L248" class="line" namn>
L248">.2480"a>        *3a href="+code=ption" class="sref">ption0"a> = (((3a href="+code=s32" class="sref">s320"a>)3a href="+code=buf" class="sref">buf0"a>[0]) * 1000) / 2559;n
L249" class="line" namn>
L249">.2490"a>n
L250" class="line" namn>
L250">.2500"a>        return 0;n
L251" class="line" namn>
L251">.2510"a>}n
L252" class="line" namn>
L252">.2523/a>n
L253" class="line" namn>
L253">.2530"a>static 3a href="+code=s32" class="sref">s320"a> 3a href="+code=wf_fcu_fan_min" class="sref">wf_fcu_fan_min3/a>(struct.3a href="+code=wf_control" class="sref">wf_control3/a> *3a href="+code=ct" class="sref">ct0"a>)n
L254" class="line" namn>
L254">.2540"a>{n
L255" class="line" namn>
L255">.2550"a>        struct.3a href="+code=wf_fcu_fan" class="sref">wf_fcu_fan0"a> *3a href="+code=fan" class="sref">fan0"a> = 3a href="+code=ct" class="sref">ct0"a>->3a href="+code=priv" class="sref">priv0"a>;n
L256" class="line" namn>
L256">.2563/a>n
L257" class="line" namn>
L257">.2570"a>        return 3a href="+code=fan" class="sref">fan0"a>->3a href="+code=min" class="sref">min0"a>;n
L258" class="line" namn>
L258">.2583/a>}n
L259" class="line" namn>
L259">.2590"a>n
L260" class="line" namn>
L260">.2600"a>static 3a href="+code=s32" class="sref">s320"a> 3a href="+code=wf_fcu_fan_max" class="sref">wf_fcu_fan_max3/a>(struct.3a href="+code=wf_control" class="sref">wf_control3/a> *3a href="+code=ct" class="sref">ct0"a>)n
L261" class="line" namn>
L261">.2610"a>{n
L262" class="line" namn>
L262">.2620"a>        struct.3a href="+code=wf_fcu_fan" class="sref">wf_fcu_fan0"a> *3a href="+code=fan" class="sref">fan0"a> = 3a href="+code=ct" class="sref">ct0"a>->3a href="+code=priv" class="sref">priv0"a>;n
L263" class="line" namn>
L263">.2633/a>n
L264" class="line" namn>
L264">.2640"a>        return 3a href="+code=fan" class="sref">fan0"a>->3a href="+code=max" class="sref">max0"a>;n
L265" class="line" namn>
L265">.2650"a>}n
L266" class="line" namn>
L266">.2663/a>n
L267" class="line" namn>
L267">.2673/a>static const struct.3a href="+code=wf_control_ops" class="sref">wf_control_ops0"a> 3a href="+code=wf_fcu_fan_rpm_ops" class="sref">wf_fcu_fan_rpm_ops0"a> = {n
L268" class="line" namn>
L268">.2680"a>        .3a href="+code=set_ption" class="sref">set_ption0"a>      = 3a href="+code=wf_fcu_fan_set_rpm" class="sref">wf_fcu_fan_set_rpm3/a>,n
L269" class="line" namn>
L269">.2690"a>        .3a href="+code=get_ption" class="sref">get_ption0"a>      = 3a href="+code=wf_fcu_fan_get_rpm" class="sref">wf_fcu_fan_get_rpm3/a>,n
L270" class="line" namn>
L270">.2700"a>        .3a href="+code=get_min" class="sref">get_min0"a>        = 3a href="+code=wf_fcu_fan_min" class="sref">wf_fcu_fan_min3/a>,n
L271" class="line" namn>
L271">.2710"a>        .3a href="+code=get_max" class="sref">get_max0"a>        = 3a href="+code=wf_fcu_fan_max" class="sref">wf_fcu_fan_max3/a>,n
L272" class="line" namn>
L272">.2720"a>        .3a href="+code=release" class="sref">release0"a>        = 3a href="+code=wf_fcu_fan_release" class="sref">wf_fcu_fan_release3/a>,n
L273" class="line" namn>
L273">.2730"a>        .3a href="+code=owner" class="sref">owner0"a>          = 3a href="+code=THIS_MODULE" class="sref">THIS_MODULE3/a>,n
L274" class="line" namn>
L274">.2740"a>};n
L275" class="line" namn>
L275">.2753/a>n
L276" class="line" namn>
L276">.2760"a>static const struct.3a href="+code=wf_control_ops" class="sref">wf_control_ops0"a> 3a href="+code=wf_fcu_fan_pwm_ops" class="sref">wf_fcu_fan_pwm_ops0"a> = {n
L277" class="line" namn>
L277">.2770"a>        .3a href="+code=set_ption" class="sref">set_ption0"a>      = 3a href="+code=wf_fcu_fan_set_pwm" class="sref">wf_fcu_fan_set_pwm3/a>,n
L278" class="line" namn>
L278">.2780"a>        .3a href="+code=get_ption" class="sref">get_ption0"a>      = 3a href="+code=wf_fcu_fan_get_pwm" class="sref">wf_fcu_fan_get_pwm3/a>,n
L279" class="line" namn>
L279">.2790"a>        .3a href="+code=get_min" class="sref">get_min0"a>        = 3a href="+code=wf_fcu_fan_min" class="sref">wf_fcu_fan_min3/a>,n
L280" class="line" namn>
L280">.2800"a>        .3a href="+code=get_max" class="sref">get_max0"a>        = 3a href="+code=wf_fcu_fan_max" class="sref">wf_fcu_fan_max3/a>,n
L281" class="line" namn>
L281">.2810"a>        .3a href="+code=release" class="sref">release0"a>        = 3a href="+code=wf_fcu_fan_release" class="sref">wf_fcu_fan_release3/a>,n
L282" class="line" namn>
L282">.2820"a>        .3a href="+code=owner" class="sref">owner0"a>          = 3a href="+code=THIS_MODULE" class="sref">THIS_MODULE3/a>,n
L283" class="line" namn>
L283">.2830"a>};n
L284" class="line" namn>
L284">.2843/a>n
L285" class="line" namn>
L285">.2853/a>static void 3a href="+code=wf_fcu_get_pump_minmax" class="sref">wf_fcu_get_pump_minmax3/a>(struct.3a href="+code=wf_fcu_fan" class="sref">wf_fcu_fan0"a> *3a href="+code=fan" class="sref">fan0"a>)n
L286" class="line" namn>
L286">.2863/a>{n
L287" class="line" namn>
L287">.2870"a>        const struct.3a href="+code=mpu_data" class="sref">mpu_data0"a> *3a href="+code=mpu" class="sref">mpu0"a> = 3a href="+code=wf_get_mpu" class="sref">wf_get_mpu3/a>(0);n
L288" class="line" namn>
L288">.2880"a>        3a href="+code=u16" class="sref">u160"a> 3a href="+code=pump_min" class="sref">pump_min0"a> = 0, 3a href="+code=pump_max" class="sref">pump_max0"a> = 0xffff;n
L289" class="line" namn>
L289">.2890"a>        3a href="+code=u16" class="sref">u160"a> 3a href="+code=tmp" class="sref">tmp0"a>[4];n
L290" class="line" namn>
L290">.2910"a>n
L291" class="line" namn>
L291">.2910"a>        3spa
 class="comment">/* Try to.fetch pumps min/max infos from eeprom */3/spa
  
L292" class="line" namn>
L292">.2920"a>        if (3a href="+code=mpu" class="sref">mpu0"a>) {n
L293" class="line" namn>
L293">.2930"a>                3a href="+code=memcpy" class="sref">memcpy3/a>(&3a href="+code=tmp" class="sref">tmp0"a>, 3a href="+code=mpu" class="sref">mpu0"a>->3a href="+code=processor_part_num" class="sref">processor_part_num0"a>, 8);n
L294" class="line" namn>
L294">.2940"a>                if (3a href="+code=tmp" class="sref">tmp0"a>[0] != 0xffff && 3a href="+code=tmp" class="sref">tmp0"a>[1] != 0xffff) {n
L295" class="line" namn>
L295">.2950"a>                        3a href="+code=pump_min" class="sref">pump_min0"a> = 3a href="+code=max" class="sref">max0"a>(3a href="+code=pump_min" class="sref">pump_min0"a>, 3a href="+code=tmp" class="sref">tmp0"a>[0]);n
L296" class="line" namn>
L296">.2960"a>                        3a href="+code=pump_max" class="sref">pump_max0"a> = 3a href="+code=min" class="sref">min0"a>(3a href="+code=pump_max" class="sref">pump_max0"a>, 3a href="+code=tmp" class="sref">tmp0"a>[1]);n
L297" class="line" namn>
L297">.2970"a>                }n
L298" class="line" namn>
L298">.2980"a>                if (3a href="+code=tmp" class="sref">tmp0"a>[2] != 0xffff && 3a href="+code=tmp" class="sref">tmp0"a>[3] != 0xffff) {n
L299" class="line" namn>
L299">.2990"a>                        3a href="+code=pump_min" class="sref">pump_min0"a> = 3a href="+code=max" class="sref">max0"a>(3a href="+code=pump_min" class="sref">pump_min0"a>, 3a href="+code=tmp" class="sref">tmp0"a>[2]);n
L300" class="line" namn>
L300">.3000"a>                        3a href="+code=pump_max" class="sref">pump_max0"a> = 3a href="+code=min" class="sref">min0"a>(3a href="+code=pump_max" class="sref">pump_max0"a>, 3a href="+code=tmp" class="sref">tmp0"a>[3]);n
L301" class="line" namn>
L301">.3010"a>                }n
L302" class="line" namn>
L302">.3020"a>        }n
L303" class="line" namn>
L303">.3033/a>n
L304" class="line" namn>
L304">.3040"a>        3spa
 class="comment">/* Double check the ptions, this _IS_ needed as the EEPROM on3/spa
  
L305" class="line" namn>
L305">.3050"a>3spa
 class="comment">         * some dual 2.5Ghz G5s seem, at least, to.have both min & max0"spa
  
L306" class="line" namn>
L306">.3060"a>3spa
 class="comment">         * samn to.the samn ption ... (grrrr)0"spa
  
L307" class="line" namn>
L307">.3070"a>3spa
 class="comment">         */3/spa
  
L308" class="line" namn>
L308">.3080"a>        if (3a href="+code=pump_min" class="sref">pump_min0"a> == 3a href="+code=pump_max" class="sref">pump_max0"a> || 3a href="+code=pump_min" class="sref">pump_min0"a> == 0 || 3a href="+code=pump_max" class="sref">pump_max0"a> == 0xffff) {n
L309" class="line" namn>
L309">.3090"a>                3a href="+code=pump_min" class="sref">pump_min0"a> = 3a href="+code=CPU_PUMP_OUTPUT_MIN" class="sref">CPU_PUMP_OUTPUT_MIN0"a>;n
L310" class="line" namn>
L310">.3100"a>                3a href="+code=pump_max" class="sref">pump_max0"a> = 3a href="+code=CPU_PUMP_OUTPUT_MAX" class="sref">CPU_PUMP_OUTPUT_MAX0"a>;n
L311" class="line" namn>
L311">.3110"a>        }n
L312" class="line" namn>
L312">.3123/a>n
L313" class="line" namn>
L313">.3130"a>        3a href="+code=fan" class="sref">fan0"a>->3a href="+code=min" class="sref">min0"a> = 3a href="+code=pump_min" class="sref">pump_min0"a>;n
L314" class="line" namn>
L314">.3140"a>        3a href="+code=fan" class="sref">fan0"a>->3a href="+code=max" class="sref">max0"a> = 3a href="+code=pump_max" class="sref">pump_max0"a>;n
L315" class="line" namn>
L315">.3153/a>n
L316" class="line" namn>
L316">.3160"a>        3a href="+code=DBG" class="sref">DBG0"a>(3spa
 class="string">"wf_fcu: pump min/max for %s set to: [%d..%d] RPM\n"3/spa
 ,n
L317" class="line" namn>
L317">.3170"a>            3a href="+code=fan" class="sref">fan0"a>->3a href="+code=ctrl" class="sref">ctrl0"a>.3a href="+code=namn" class="sref">namn0"a>, 3a href="+code=pump_min" class="sref">pump_min0"a>, 3a href="+code=pump_max" class="sref">pump_max0"a>);n
L318" class="line" namn>
L318">.3183/a>}n
L319" class="line" namn>
L319">.3190"a>n
L320" class="line" namn>
L320">.3200"a>static void 3a href="+code=wf_fcu_get_rpmfan_minmax" class="sref">wf_fcu_get_rpmfan_minmax3/a>(struct.3a href="+code=wf_fcu_fan" class="sref">wf_fcu_fan0"a> *3a href="+code=fan" class="sref">fan0"a>)n
L321" class="line" namn>
L321">.3210"a>{n
L322" class="line" namn>
L322">.3220"a>        struct.3a href="+code=wf_fcu_priv" class="sref">wf_fcu_priv0"a> *3a href="+code=pv" class="sref">pv0"a> = 3a href="+code=fan" class="sref">fan0"a>->3a href="+code=fcu_priv" class="sref">fcu_priv0"a>;n
L323" class="line" namn>
L323">.3230"a>        const struct.3a href="+code=mpu_data" class="sref">mpu_data0"a> *3a href="+code=mpu0" class="sref">mpu00"a> = 3a href="+code=wf_get_mpu" class="sref">wf_get_mpu3/a>(0);n
L324" class="line" namn>
L324">.3240"a>        const struct.3a href="+code=mpu_data" class="sref">mpu_data0"a> *3a href="+code=mpu1" class="sref">mpu10"a> = 3a href="+code=wf_get_mpu" class="sref">wf_get_mpu3/a>(1);n
L325" class="line" namn>
L325">.3253/a>n
L326" class="line" namn>
L326">.3260"a>        3spa
 class="comment">/* Default */3/spa
  
L327" class="line" namn>
L327">.3270"a>        3a href="+code=fan" class="sref">fan0"a>->3a href="+code=min" class="sref">min0"a> = 2400 >> 3a href="+code=pv" class="sref">pv0"a>->3a href="+code=rpm_shift" class="sref">rpm_shift0"a>;n
L328" class="line" namn>
L328">.3280"a>        3a href="+code=fan" class="sref">fan0"a>->3a href="+code=max" class="sref">max0"a> = 56000 >> 3a href="+code=pv" class="sref">pv0"a>->3a href="+code=rpm_shift" class="sref">rpm_shift0"a>;n
L329" class="line" namn>
L329">.3290"a>n
L330" class="line" namn>
L330">.3300"a>        3spa
 class="comment">/* CPU fans.have min/max in MPU */3/spa
  
L331" class="line" namn>
L331">.3310"a>        if (3a href="+code=mpu0" class="sref">mpu00"a> && !3a href="+code=strcmp" class="sref">strcmp0"a>(3a href="+code=fan" class="sref">fan0"a>->3a href="+code=ctrl" class="sref">ctrl0"a>.3a href="+code=namn" class="sref">namn0"a>, 3spa
 class="string">"cpu-front-fan-0"3/spa
 )) {n
L332" class="line" namn>
L332">.3320"a>                3a href="+code=fan" class="sref">fan0"a>->3a href="+code=min" class="sref">min0"a> = 3a href="+code=max" class="sref">max0"a>(3a href="+code=fan" class="sref">fan0"a>->3a href="+code=min" class="sref">min0"a>, (3a href="+code=s32" class="sref">s320"a>)3a href="+code=mpu0" class="sref">mpu00"a>->3a href="+code=rminn_intake_fan" class="sref">rminn_intake_fan0"a>);n
L333" class="line" namn>
L333">.3330"a>                3a href="+code=fan" class="sref">fan0"a>->3a href="+code=max" class="sref">max0"a> = 3a href="+code=min" class="sref">min0"a>(3a href="+code=fan" class="sref">fan0"a>->3a href="+code=max" class="sref">max0"a>, (3a href="+code=s32" class="sref">s320"a>)3a href="+code=mpu0" class="sref">mpu00"a>->3a href="+code=rmaxn_intake_fan" class="sref">rmaxn_intake_fan0"a>);n
L334" class="line" namn>
L334">.3340"a>                goto 3a href="+code=bail" class="sref">bail0"a>;n
L335" class="line" namn>
L335">.3350"a>        }n
L336" class="line" namn>
L336">.3360"a>        if (3a href="+code=mpu1" class="sref">mpu10"a> && !3a href="+code=strcmp" class="sref">strcmp0"a>(3a href="+code=fan" class="sref">fan0"a>->3a href="+code=ctrl" class="sref">ctrl0"a>.3a href="+code=namn" class="sref">namn0"a>, 3spa
 class="string">"cpu-front-fan-1"3/spa
 )) {n
L337" class="line" namn>
L337">.3370"a>                3a href="+code=fan" class="sref">fan0"a>->3a href="+code=min" class="sref">min0"a> = 3a href="+code=max" class="sref">max0"a>(3a href="+code=fan" class="sref">fan0"a>->3a href="+code=min" class="sref">min0"a>, (3a href="+code=s32" class="sref">s320"a>)3a href="+code=mpu1" class="sref">mpu10"a>->3a href="+code=rminn_intake_fan" class="sref">rminn_intake_fan0"a>);n
L338" class="line" namn>
L338">.3380"a>                3a href="+code=fan" class="sref">fan0"a>->3a href="+code=max" class="sref">max0"a> = 3a href="+code=min" class="sref">min0"a>(3a href="+code=fan" class="sref">fan0"a>->3a href="+code=max" class="sref">max0"a>, (3a href="+code=s32" class="sref">s320"a>)3a href="+code=mpu1" class="sref">mpu10"a>->3a href="+code=rmaxn_intake_fan" class="sref">rmaxn_intake_fan0"a>);n
L339" class="line" namn>
L339">.3390"a>                goto 3a href="+code=bail" class="sref">bail0"a>;n
L340" class="line" namn>
L340">.3400"a>        }n
L341" class="line" namn>
L341">.3410"a>        if (3a href="+code=mpu0" class="sref">mpu00"a> && !3a href="+code=strcmp" class="sref">strcmp0"a>(3a href="+code=fan" class="sref">fan0"a>->3a href="+code=ctrl" class="sref">ctrl0"a>.3a href="+code=namn" class="sref">namn0"a>, 3spa
 class="string">"cpu-rear-fan-0"3/spa
 )) {n
L342" class="line" namn>
L342">.3420"a>                3a href="+code=fan" class="sref">fan0"a>->3a href="+code=min" class="sref">min0"a> = 3a href="+code=max" class="sref">max0"a>(3a href="+code=fan" class="sref">fan0"a>->3a href="+code=min" class="sref">min0"a>, (3a href="+code=s32" class="sref">s320"a>)3a href="+code=mpu0" class="sref">mpu00"a>->3a href="+code=rminn_exhaust_fan" class="sref">rminn_exhaust_fan0"a>);n
L343" class="line" namn>
L343">.3430"a>                3a href="+code=fan" class="sref">fan0"a>->3a href="+code=max" class="sref">max0"a> = 3a href="+code=min" class="sref">min0"a>(3a href="+code=fan" class="sref">fan0"a>->3a href="+code=max" class="sref">max0"a>, (3a href="+code=s32" class="sref">s320"a>)3a href="+code=mpu0" class="sref">mpu00"a>->3a href="+code=rmaxn_exhaust_fan" class="sref">rmaxn_exhaust_fan0"a>);n
L344" class="line" namn>
L344">.3440"a>                goto 3a href="+code=bail" class="sref">bail0"a>;n
L345" class="line" namn>
L345">.3450"a>        }n
L346" class="line" namn>
L346">.3460"a>        if (3a href="+code=mpu1" class="sref">mpu10"a> && !3a href="+code=strcmp" class="sref">strcmp0"a>(3a href="+code=fan" class="sref">fan0"a>->3a href="+code=ctrl" class="sref">ctrl0"a>.3a href="+code=namn" class="sref">namn0"a>, 3spa
 class="string">"cpu-rear-fan-1"3/spa
 )) {n
L347" class="line" namn>
L347">.3470"a>                3a href="+code=fan" class="sref">fan0"a>->3a href="+code=min" class="sref">min0"a> = 3a href="+code=max" class="sref">max0"a>(3a href="+code=fan" class="sref">fan0"a>->3a href="+code=min" class="sref">min0"a>, (3a href="+code=s32" class="sref">s320"a>)3a href="+code=mpu1" class="sref">mpu10"a>->3a href="+code=rminn_exhaust_fan" class="sref">rminn_exhaust_fan0"a>);n
L348" class="line" namn>
L348">.3480"a>                3a href="+code=fan" class="sref">fan0"a>->3a href="+code=max" class="sref">max0"a> = 3a href="+code=min" class="sref">min0"a>(3a href="+code=fan" class="sref">fan0"a>->3a href="+code=max" class="sref">max0"a>, (3a href="+code=s32" class="sref">s320"a>)3a href="+code=mpu1" class="sref">mpu10"a>->3a href="+code=rmaxn_exhaust_fan" class="sref">rmaxn_exhaust_fan0"a>);n
L349" class="line" namn>
L349">.3490"a>                goto 3a href="+code=bail" class="sref">bail0"a>;n
L350" class="line" namn>
L350">.3500"a>        }n
L351" class="line" namn>
L351">.3510"a>        3spa
 class="comment">/* Rackmac variants, we just use mpu0 intake */3/spa
  
L352" class="line" namn>
L352">.3520"a>        if (!3a href="+code=strncmp" class="sref">strncmp0"a>(3a href="+code=fan" class="sref">fan0"a>->3a href="+code=ctrl" class="sref">ctrl0"a>.3a href="+code=namn" class="sref">namn0"a>, 3spa
 class="string">"cpu-fan"3/spa
 , 7)) {n
L353" class="line" namn>
L353">.3530"a>                3a href="+code=fan" class="sref">fan0"a>->3a href="+code=min" class="sref">min0"a> = 3a href="+code=max" class="sref">max0"a>(3a href="+code=fan" class="sref">fan0"a>->3a href="+code=min" class="sref">min0"a>, (3a href="+code=s32" class="sref">s320"a>)3a href="+code=mpu0" class="sref">mpu00"a>->3a href="+code=rminn_intake_fan" class="sref">rminn_intake_fan0"a>);n
L354" class="line" namn>
L354">.3540"a>                3a href="+code=fan" class="sref">fan0"a>->3a href="+code=max" class="sref">max0"a> = 3a href="+code=min" class="sref">min0"a>(3a href="+code=fan" class="sref">fan0"a>->3a href="+code=max" class="sref">max0"a>, (3a href="+code=s32" class="sref">s320"a>)3a href="+code=mpu0" class="sref">mpu00"a>->3a href="+code=rmaxn_intake_fan" class="sref">rmaxn_intake_fan0"a>);n
L355" class="line" namn>
L355">.3550"a>                goto 3a href="+code=bail" class="sref">bail0"a>;n
L356" class="line" namn>
L356">.3560"a>        }n
L357" class="line" namn>
L357">.3570"a> 3a href="+code=bail" class="sref">bail0"a>:n
L358" class="line" namn>
L358">.3580"a>        3a href="+code=DBG" class="sref">DBG0"a>(3spa
 class="string">"wf_fcu: fan min/max for %s set to: [%d..%d] RPM\n"3/spa
 ,n
L359" class="line" namn>
L359">.3590"a>            3a href="+code=fan" class="sref">fan0"a>->3a href="+code=ctrl" class="sref">ctrl0"a>.3a href="+code=namn" class="sref">namn0"a>, 3a href="+code=fan" class="sref">fan0"a>->3a href="+code=min" class="sref">min0"a>, 3a href="+code=fan" class="sref">fan0"a>->3a href="+code=max" class="sref">max0"a>);n
L360" class="line" namn>
L360">.3600"a>}n
L361" class="line" namn>
L361">.3610"a>n
L362" class="line" namn>
L362">.3620"a>static void 3a href="+code=wf_fcu_add_fan" class="sref">wf_fcu_add_fan0"a>(struct.3a href="+code=wf_fcu_priv" class="sref">wf_fcu_priv0"a> *3a href="+code=pv" class="sref">pv0"a>, const char *3a href="+code=namn" class="sref">namn0"a>,n
L363" class="line" namn>
L363">.3630"a>                           int 3a href="+code=typn" class="sref">typn0"a>, int 3a href="+code=id" class="sref">id0"a>)n
L364" class="line" namn>
L364">.3640"a>{n
L365" class="line" namn>
L365">.3650"a>        struct.3a href="+code=wf_fcu_fan" class="sref">wf_fcu_fan0"a> *3a href="+code=fan" class="sref">fan0"a>;n
L366" class="line" namn>
L366">.3663/a>n
L367" class="line" namn>
L367">.3670"a>        3a href="+code=fan" class="sref">fan0"a> = 3a href="+code=kzalloc" class="sref">kzalloc0"a>(sizeof(*3a href="+code=fan" class="sref">fan0"a>), 3a href="+code=GFP_KERNEL" class="sref">GFP_KERNEL0"a>);n
L368" class="line" namn>
L368">.3680"a>        if (!3a href="+code=fan" class="sref">fan0"a>)n
L369" class="line" namn>
L369">.3690"a>                return;n
L370" class="line" namn>
L370">.3700"a>        3a href="+code=fan" class="sref">fan0"a>->3a href="+code=fcu_priv" class="sref">fcu_priv0"a> = 3a href="+code=pv" class="sref">pv0"a>;n
L371" class="line" namn>
L371">.3710"a>        3a href="+code=fan" class="sref">fan0"a>->3a href="+code=id" class="sref">id0"a> = 3a href="+code=id" class="sref">id0"a>;n
L372" class="line" namn>
L372">.3720"a>        3a href="+code=fan" class="sref">fan0"a>->3a href="+code=ctrl" class="sref">ctrl0"a>.3a href="+code=namn" class="sref">namn0"a> = 3a href="+code=namn" class="sref">namn0"a>;n
L373" class="line" namn>
L373">.3730"a>        3a href="+code=fan" class="sref">fan0"a>->3a href="+code=ctrl" class="sref">ctrl0"a>.3a href="+code=priv" class="sref">priv0"a> = 3a href="+code=fan" class="sref">fan0"a>;n
L374" class="line" namn>
L374">.3743/a>n
L375" class="line" namn>
L375">.3750"a>        3spa
 class="comment">/* min/max is oddball but.the code comes from3/spa
  
L376" class="line" namn>
L376">.3760"a>3spa
 class="comment">         * therm_pm72 which seems to.work so ...3/spa
  
L377" class="line" namn>
L377">.3770"a>3spa
 class="comment">         */3/spa
  
L378" class="line" namn>
L378">.3780"a>        if (3a href="+code=typn" class="sref">typn0"a> == 3a href="+code=FCU_FAN_RPM" class="sref">FCU_FAN_RPM0"a>) {n
L379" class="line" namn>
L379">.3790"a>                if (!3a href="+code=strncmp" class="sref">strncmp0"a>(3a href="+code=namn" class="sref">namn0"a>, 3spa
 class="string">"cpu-pump"3/spa
 , 3a href="+code=strlen" class="sref">strlen0"a>(3spa
 class="string">"cpu-pump"3/spa
 )))n
L380" class="line" namn>
L380">.3800"a>                        3a href="+code=wf_fcu_get_pump_minmax" class="sref">wf_fcu_get_pump_minmax3/a>(3a href="+code=fan" class="sref">fan0"a>);n
L381" class="line" namn>
L381">.3810"a>                elsen
L382" class="line" namn>
L382">.3820"a>                        3a href="+code=wf_fcu_get_rpmfan_minmax" class="sref">wf_fcu_get_rpmfan_minmax3/a>(3a href="+code=fan" class="sref">fan0"a>);n
L383" class="line" namn>
L383">.3830"a>                3a href="+code=fan" class="sref">fan0"a>->3a href="+code=ctrl" class="sref">ctrl0"a>.3a href="+code=typn" class="sref">typn0"a> = 3a href="+code=WF_CONTROL_RPM_FAN" class="sref">WF_CONTROL_RPM_FAN0"a>;n
L384" class="line" namn>
L384">.3840"a>                3a href="+code=fan" class="sref">fan0"a>->3a href="+code=ctrl" class="sref">ctrl0"a>.3a href="+code=ops" class="sref">ops0"a> = &3a href="+code=wf_fcu_fan_rpm_ops" class="sref">wf_fcu_fan_rpm_ops0"a>;n
L385" class="line" namn>
L385">.3850"a>        } else {n
L386" class="line" namn>
L386">.3860"a>                3a href="+code=fan" class="sref">fan0"a>->3a href="+code=min" class="sref">min0"a> = 10;n
L387" class="line" namn>
L387">.3870"a>                3a href="+code=fan" class="sref">fan0"a>->3a href="+code=max" class="sref">max0"a> = 100;n
L388" class="line" namn>
L388">.3880"a>                3a href="+code=fan" class="sref">fan0"a>->3a href="+code=ctrl" class="sref">ctrl0"a>.3a href="+code=typn" class="sref">typn0"a> = 3a href="+code=WF_CONTROL_PWM_FAN" class="sref">WF_CONTROL_PWM_FAN0"a>;n
L389" class="line" namn>
L389">.3890"a>                3a href="+code=fan" class="sref">fan0"a>->3a href="+code=ctrl" class="sref">ctrl0"a>.3a href="+code=ops" class="sref">ops0"a> = &3a href="+code=wf_fcu_fan_pwm_ops" class="sref">wf_fcu_fan_pwm_ops0"a>;n
L390" class="line" namn>
L390">.3900"a>        }n
L391" class="line" namn>
L391">.3910"a>n
L392" class="line" namn>
L392">.3920"a>        if (3a href="+code=wf_register_control" class="sref">wf_register_control3/a>(&3a href="+code=fan" class="sref">fan0"a>->3a href="+code=ctrl" class="sref">ctrl0"a>)) {n
L393" class="line" namn>
L393">.3930"a>                3a href="+code=pr_err" class="sref">pr_err0"a>(3spa
 class="string">"wf_fcu: Failed to.register fan %s\n"3/spa
 , 3a href="+code=namn" class="sref">namn0"a>);n
L394" class="line" namn>
L394">.3940"a>                3a href="+code=kfren" class="sref">kfren3/a>(3a href="+code=fan" class="sref">fan0"a>);n
L395" class="line" namn>
L395">.3950"a>                return;n
L396" class="line" namn>
L396">.3960"a>        }n
L397" class="line" namn>
L397">.3970"a>        3a href="+code=list_add" class="sref">list_add3/a>(&3a href="+code=fan" class="sref">fan0"a>->3a href="+code=link" class="sref">link0"a>, &3a href="+code=pv" class="sref">pv0"a>->3a href="+code=fan_list" class="sref">fan_list0"a>);n
L398" class="line" namn>
L398">.3980"a>        3a href="+code=kref_get" class="sref">kref_get3/a>(&3a href="+code=pv" class="sref">pv0"a>->3a href="+code=ref" class="sref">ref0"a>);n
L399" class="line" namn>
L399">.3990"a>}n
L400" class="line" namn>
L400">.4010"a>n
L401" class="line" namn>
L401">.4010"a>static void 3a href="+code=wf_fcu_lookup_fans" class="sref">wf_fcu_lookup_fans0"a>(struct.3a href="+code=wf_fcu_priv" class="sref">wf_fcu_priv0"a> *3a href="+code=pv" class="sref">pv0"a>)n
L402" class="line" namn>
L402">.4020"a>{n
L403" class="line" namn>
L403">.4030"a>        3spa
 class="comment">/* Translation of device-tren location properties to3/spa
  
L404" class="line" namn>
L404">.4040"a>3spa
 class="comment">         * windfarm fan namns3/spa
  
L405" class="line" namn>
L405">.4050"a>3spa
 class="comment">         */3/spa
  
L406" class="line" namn>
L406">.4060"a>        static const struct.{n
L407" class="line" namn>
L407">.4070"a>                const char *3a href="+code=dt_namn" class="sref">dt_namn0"a>;    3spa
 class="comment">/* Device-tren namn */3/spa
  
L408" class="line" namn>
L408">.4080"a>                const char *3a href="+code=ct_namn" class="sref">ct_namn0"a>;    3spa
 class="comment">/* Control namn */3/spa
  
L409" class="line" namn>
L409">.4090"a>        } 3a href="+code=loc_trans" class="sref">loc_trans0"a>[] = {n
L410" class="line" namn>
L410">.4100"a>                { 3spa
 class="string">"BACKSIDE"3/spa
 ,           3spa
 class="string">"backside-fan"3/spa
 ,         },n
L411" class="line" namn>
L411">.4110"a>                { 3spa
 class="string">"SYS CTRLR FAN"3/spa
 ,      3spa
 class="string">"backside-fan"3/spa
 ,         },n
L412" class="line" namn>
L412">.4120"a>                { 3spa
 class="string">"DRIVE BAY"3/spa
 ,          3spa
 class="string">"drive-bay-fan"3/spa
 ,        },n
L413" class="line" namn>
L413">.4130"a>                { 3spa
 class="string">"SLOT"3/spa
 ,               3spa
 class="string">"slots-fan"3/spa
 ,            },n
L414" class="line" namn>
L414">.4140"a>                { 3spa
 class="string">"PCI FAN"3/spa
 ,            3spa
 class="string">"slots-fan"3/spa
 ,            },n
L415" class="line" namn>
L415">.4150"a>                { 3spa
 class="string">"CPU A INTAKE"3/spa
 ,       3spa
 class="string">"cpu-front-fan-0"3/spa
 ,      },n
L416" class="line" namn>
L416">.4160"a>                { 3spa
 class="string">"CPU A EXHAUST"3/spa
 ,      3spa
 class="string">"cpu-rear-fan-0"3/spa
 ,       },n
L417" class="line" namn>
L417">.4170"a>                { 3spa
 class="string">"CPU B INTAKE"3/spa
 ,       3spa
 class="string">"cpu-front-fan-1"3/spa
 ,      },n
L418" class="line" namn>
L418">.4180"a>                { 3spa
 class="string">"CPU B EXHAUST"3/spa
 ,      3spa
 class="string">"cpu-rear-fan-1"3/spa
 ,       },n
L419" class="line" namn>
L419">.4190"a>                { 3spa
 class="string">"CPU A PUMP"3/spa
 ,         3spa
 class="string">"cpu-pump-0"3/spa
 ,           },n
L420" class="line" namn>
L420">.4200"a>                { 3spa
 class="string">"CPU B PUMP"3/spa
 ,         3spa
 class="string">"cpu-pump-1"3/spa
 ,           },n
L421" class="line" namn>
L421">.4210"a>                { 3spa
 class="string">"CPU A 1"3/spa
 ,            3spa
 class="string">"cpu-fan-a-0"3/spa
 ,          },n
L422" class="line" namn>
L422">.4220"a>                { 3spa
 class="string">"CPU A 2"3/spa
 ,            3spa
 class="string">"cpu-fan-b-0"3/spa
 ,          },n
L423" class="line" namn>
L423">.4230"a>                { 3spa
 class="string">"CPU A 3"3/spa
 ,            3spa
 class="string">"cpu-fan-c-0"3/spa
 ,          },n
L424" class="line" namn>
L424">.4240"a>                { 3spa
 class="string">"CPU B 1"3/spa
 ,            3spa
 class="string">"cpu-fan-a-1"3/spa
 ,          },n
L425" class="line" namn>
L425">.4250"a>                { 3spa
 class="string">"CPU B 2"3/spa
 ,            3spa
 class="string">"cpu-fan-b-1"3/spa
 ,          },n
L426" class="line" namn>
L426">.4260"a>                { 3spa
 class="string">"CPU B 3"3/spa
 ,            3spa
 class="string">"cpu-fan-c-1"3/spa
 ,          },n
L427" class="line" namn>
L427">.4270"a>        };n
L428" class="line" namn>
L428">.4280"a>        struct.3a href="+code=device_node" class="sref">device_node0"a> *3a href="+code=np" class="sref">np0"a> = 3a href="+code=NULL" class="sref">NULL0"a>, *3a href="+code=fcu" class="sref">fcu0"a> = 3a href="+code=pv" class="sref">pv0"a>->3a href="+code=i2c" class="sref">i2c0"a>->3a href="+code=dev" class="sref">dev0"a>.3a href="+code=of_node" class="sref">of_node0"a>;n
L429" class="line" namn>
L429">.4290"a>        int 3a href="+code=i" class="sref">i0"a>;n
L430" class="line" namn>
L430">.4310"a>n
L431" class="line" namn>
L431">.4310"a>        3a href="+code=DBG" class="sref">DBG0"a>(3spa
 class="string">"Looking up FCU controls in device-tren...\n"3/spa
 );n
L432" class="line" namn>
L432">.4323/a>n
L433" class="line" namn>
L433">.4330"a>        while ((3a href="+code=np" class="sref">np0"a> = 3a href="+code=of_get_next_child" class="sref">of_get_next_child3/a>(3a href="+code=fcu" class="sref">fcu0"a>, 3a href="+code=np" class="sref">np0"a>)) != 3a href="+code=NULL" class="sref">NULL0"a>) {n
L434" class="line" namn>
L434">.4340"a>                int 3a href="+code=id" class="sref">id0"a>, 3a href="+code=typn" class="sref">typn0"a> = -1;n
L435" class="line" namn>
L435">.4350"a>                const char *3a href="+code=loc" class="sref">loc0"a>;n
L436" class="line" namn>
L436">.4360"a>                const char *3a href="+code=namn" class="sref">namn0"a>;n
L437" class="line" namn>
L437">.4370"a>                const 3a href="+code=u32" class="sref">u320"a> *3a href="+code=reg" class="sref">reg0"a>;n
L438" class="line" namn>
L438">.4380"a>n
L439" class="line" namn>
L439">.4390"a>                3a href="+code=DBG" class="sref">DBG0"a>(3spa
 class="string">" control: %s, typn: %s\n"3/spa
 , 3a href="+code=np" class="sref">np0"a>->3a href="+code=namn" class="sref">namn0"a>, 3a href="+code=np" class="sref">np0"a>->3a href="+code=typn" class="sref">typn0"a>);n
L440" class="line" namn>
L440">.4410"a>n
L441" class="line" namn>
L441">.4410"a>                3spa
 class="comment">/* Detect.control typn */3/spa
  
L442" class="line" namn>
L442">.4420"a>                if (!3a href="+code=strcmp" class="sref">strcmp0"a>(3a href="+code=np" class="sref">np0"a>->3a href="+code=typn" class="sref">typn0"a>, 3spa
 class="string">"fan-rpm-control"3/spa
 ) || 
L443" class="line" namn>
L443">.4430"a>                    !3a href="+code=strcmp" class="sref">strcmp0"a>(3a href="+code=np" class="sref">np0"a>->3a href="+code=typn" class="sref">typn0"a>, 3spa
 class="string">"fan-rpm"3/spa
 )) 
L444" class="line" namn>
L444">.4440"a>                        3a href="+code=typn" class="sref">typn0"a> = 3a href="+code=FCU_FAN_RPM" class="sref">FCU_FAN_RPM0"a>;n
L445" class="line" namn>
L445">.4450"a>                if (!3a href="+code=strcmp" class="sref">strcmp0"a>(3a href="+code=np" class="sref">np0"a>->3a href="+code=typn" class="sref">typn0"a>, 3spa
 class="string">"fan-pwm-control"3/spa
 ) || 
L446" class="line" namn>
L446">.4460"a>                    !3a href="+code=strcmp" class="sref">strcmp0"a>(3a href="+code=np" class="sref">np0"a>->3a href="+code=typn" class="sref">typn0"a>, 3spa
 class="string">"fan-pwm"3/spa
 )) 
L447" class="line" namn>
L447">.4470"a>                        3a href="+code=typn" class="sref">typn0"a> = 3a href="+code=FCU_FAN_PWM" class="sref">FCU_FAN_PWM0"a>;n
L448" class="line" namn>
L448">.4480"a>                3spa
 class="comment">/* Only care about fans.for now */3/spa
  
L449" class="line" namn>
L449">.4490"a>                if (3a href="+code=typn" class="sref">typn0"a> == -1) 
L450" class="line" namn>
L450">.4500"a>                        continue;n
L451" class="line" namn>
L451">.4510"a>n
L452" class="line" namn>
L452">.4520"a>                3spa
 class="comment">/* Lookup.for a matching location */3/spa
  
L453" class="line" namn>
L453">.4530"a>                3a href="+code=loc" class="sref">loc0"a> = 3a href="+code=of_get_property" class="sref">of_get_property0"a>(3a href="+code=np" class="sref">np0"a>, 3spa
 class="string">"location"3/spa
 , 3a href="+code=NULL" class="sref">NULL0"a>);n
L454" class="line" namn>
L454">.4540"a>                3a href="+code=reg" class="sref">reg0"a> = 3a href="+code=of_get_property" class="sref">of_get_property0"a>(3a href="+code=np" class="sref">np0"a>, 3spa
 class="string">"reg"3/spa
 , 3a href="+code=NULL" class="sref">NULL0"a>);n
L455" class="line" namn>
L455">.4550"a>                if (3a href="+code=loc" class="sref">loc0"a> == 3a href="+code=NULL" class="sref">NULL0"a> || 3a href="+code=reg" class="sref">reg0"a> == 3a href="+code=NULL" class="sref">NULL0"a>)n
L456" class="line" namn>
L456">.4560"a>                        continue;n
L457" class="line" namn>
L457">.4570"a>                3a href="+code=DBG" class="sref">DBG0"a>(3spa
 class="string">" matching location: %s, reg: 0x%08x\n"3/spa
 , 3a href="+code=loc" class="sref">loc0"a>, *3a href="+code=reg" class="sref">reg0"a>);n
L458" class="line" namn>
L458">.4580"a>n
L459" class="line" namn>
L459">.4590"a>                for (3a href="+code=i" class="sref">i0"a> = 0; 3a href="+code=i" class="sref">i0"a> < 3a href="+code=ARRAY_SIZE" class="sref">ARRAY_SIZE0"a>(3a href="+code=loc_trans" class="sref">loc_trans0"a>); 3a href="+code=i" class="sref">i0"a>++) {n
L460" class="line" namn>
L460">.4600"a>                        if (3a href="+code=strncmp" class="sref">strncmp0"a>(3a href="+code=loc" class="sref">loc0"a>, 3a href="+code=loc_trans" class="sref">loc_trans0"a>[3a href="+code=i" class="sref">i0"a>].3a href="+code=dt_namn" class="sref">dt_namn0"a>,n
L461" class="line" namn>
L461">.4610"a>                                    3a href="+code=strlen" class="sref">strlen0"a>(3a href="+code=loc_trans" class="sref">loc_trans0"a>[3a href="+code=i" class="sref">i0"a>].3a href="+code=dt_namn" class="sref">dt_namn0"a>)))n
L462" class="line" namn>
L462">.4620"a>                                continue;n
L463" class="line" namn>
L463">.4630"a>                        3a href="+code=namn" class="sref">namn0"a> = 3a href="+code=loc_trans" class="sref">loc_trans0"a>[3a href="+code=i" class="sref">i0"a>].3a href="+code=ct_namn" class="sref">ct_namn0"a>;n
L464" class="line" namn>
L464">.4643/a>n
L465" class="line" namn>
L465">.4650"a>                        3a href="+code=DBG" class="sref">DBG0"a>(3spa
 class="string">" location match, namn: %s\n"3/spa
 , 3a href="+code=namn" class="sref">namn0"a>);n
L466" class="line" namn>
L466">.4663/a>n
L467" class="line" namn>
L467">.4670"a>                        if (3a href="+code=typn" class="sref">typn0"a> == 3a href="+code=FCU_FAN_RPM" class="sref">FCU_FAN_RPM0"a>)n
L468" class="line" namn>
L468">.4680"a>                                3a href="+code=id" class="sref">id0"a> = ((*3a href="+code=reg" class="sref">reg0"a>) - 0x10) / 2;n
L469" class="line" namn>
L469">.4690"a>                        elsen
L470" class="line" namn>
L470">.4700"a>                                3a href="+code=id" class="sref">id0"a> = ((*3a href="+code=reg" class="sref">reg0"a>) - 0x30) / 2;n
L471" class="line" namn>
L471">.4710"a>                        if (3a href="+code=id" class="sref">id0"a> > 7) {n
L472" class="line" namn>
L472">.4720"a>                                3a href="+code=pr_warning" class="sref">pr_warning0"a>(3spa
 class="string">"wf_fcu: Can't parse "3/spa
 n
L473" class="line" namn>
L473">.4730"a>                                       3spa
 class="string">"fan ID in device-tren for %s\n"3/spa
 ,n
L474" class="line" namn>
L474">.4740"a>                                           3a href="+code=np" class="sref">np0"a>->3a href="+code=full_namn" class="sref">full_namn0"a>);n
L475" class="line" namn>
L475">.4750"a>                                break;n
L476" class="line" namn>
L476">.4760"a>                        }n
L477" class="line" namn>
L477">.4770"a>                        3a href="+code=wf_fcu_add_fan" class="sref">wf_fcu_add_fan0"a>(3a href="+code=pv" class="sref">pv0"a>, 3a href="+code=namn" class="sref">namn0"a>, 3a href="+code=typn" class="sref">typn0"a>, 3a href="+code=id" class="sref">id0"a>);n
L478" class="line" namn>
L478">.4780"a>                        break;n
L479" class="line" namn>
L479">.4790"a>                }n
L480" class="line" namn>
L480">.4800"a>        }n
L481" class="line" namn>
L481">.4810"a>}n
L482" class="line" namn>
L482">.4823/a>n
L483" class="line" namn>
L483">.4830"a>static void 3a href="+code=wf_fcu_default_fans" class="sref">wf_fcu_default_fans0"a>(struct.3a href="+code=wf_fcu_priv" class="sref">wf_fcu_priv0"a> *3a href="+code=pv" class="sref">pv0"a>)n
L484" class="line" namn>
L484">.4840"a>{n
L485" class="line" namn>
L485">.4850"a>        3spa
 class="comment">/* We only support.the default fans.for PowerMac7,2 */3/spa
  
L486" class="line" namn>
L486">.4860"a>        if (!3a href="+code=of_machine_is_compatible" class="sref">of_machine_is_compatible0"a>(3spa
 class="string">"PowerMac7,2"3/spa
 )) 
L487" class="line" namn>
L487">.4870"a>                return;n
L488" class="line" namn>
L488">.4880"a>n
L489" class="line" namn>
L489">.4890"a>        3a href="+code=wf_fcu_add_fan" class="sref">wf_fcu_add_fan0"a>(3a href="+code=pv" class="sref">pv0"a>, 3spa
 class="string">"backside-fan"3/spa
 ,      3a href="+code=FCU_FAN_PWM" class="sref">FCU_FAN_PWM0"a>, 1);n
L490" class="line" namn>
L490">.4900"a>        3a href="+code=wf_fcu_add_fan" class="sref">wf_fcu_add_fan0"a>(3a href="+code=pv" class="sref">pv0"a>, 3spa
 class="string">"drive-bay-fan"3/spa
 ,     3a href="+code=FCU_FAN_RPM" class="sref">FCU_FAN_RPM0"a>, 2);n
L491" class="line" namn>
L491">.4910"a>        3a href="+code=wf_fcu_add_fan" class="sref">wf_fcu_add_fan0"a>(3a href="+code=pv" class="sref">pv0"a>, 3spa
 class="string">"slots-fan"3/spa
 ,         3a href="+code=FCU_FAN_PWM" class="sref">FCU_FAN_PWM0"a>, 2);n
L492" class="line" namn>
L492">.4920"a>        3a href="+code=wf_fcu_add_fan" class="sref">wf_fcu_add_fan0"a>(3a href="+code=pv" class="sref">pv0"a>, 3spa
 class="string">"cpu-front-fan-0"3/spa
 ,   3a href="+code=FCU_FAN_RPM" class="sref">FCU_FAN_RPM0"a>, 3);n
L493" class="line" namn>
L493">.4930"a>        3a href="+code=wf_fcu_add_fan" class="sref">wf_fcu_add_fan0"a>(3a href="+code=pv" class="sref">pv0"a>, 3spa
 class="string">"cpu-rear-fan-0"3/spa
 ,    3a href="+code=FCU_FAN_RPM" class="sref">FCU_FAN_RPM0"a>, 4);n
L494" class="line" namn>
L494">.4940"a>        3a href="+code=wf_fcu_add_fan" class="sref">wf_fcu_add_fan0"a>(3a href="+code=pv" class="sref">pv0"a>, 3spa
 class="string">"cpu-front-fan-1"3/spa
 ,   3a href="+code=FCU_FAN_RPM" class="sref">FCU_FAN_RPM0"a>, 5);n
L495" class="line" namn>
L495">.4950"a>        3a href="+code=wf_fcu_add_fan" class="sref">wf_fcu_add_fan0"a>(3a href="+code=pv" class="sref">pv0"a>, 3spa
 class="string">"cpu-rear-fan-1"3/spa
 ,    3a href="+code=FCU_FAN_RPM" class="sref">FCU_FAN_RPM0"a>, 6);n
L496" class="line" namn>
L496">.4960"a>}n
L497" class="line" namn>
L497">.4970"a>n
L498" class="line" namn>
L498">.4980"a>static int 3a href="+code=wf_fcu_init_chip" class="sref">wf_fcu_init_chip0"a>(struct.3a href="+code=wf_fcu_priv" class="sref">wf_fcu_priv0"a> *3a href="+code=pv" class="sref">pv0"a>)n
L499" class="line" namn>
L499">.4990"a>{n
L500" class="line" namn>
L500">.5000"a>        unsigned char 3a href="+code=buf" class="sref">buf0"a> = 0xff;n
L501" class="line" namn>
L501">.5010"a>        int 3a href="+code=rc" class="sref">rc0"a>;n
L502" class="line" namn>
L502">.5023/a>n
L503" class="line" namn>
L503">.5030"a>        3a href="+code=rc" class="sref">rc0"a> = 3a href="+code=wf_fcu_write_reg" class="sref">wf_fcu_write_reg0"a>(3a href="+code=pv" class="sref">pv0"a>, 0xe, &3a href="+code=buf" class="sref">buf0"a>, 1);n
L504" class="line" namn>
L504">.5040"a>        if (3a href="+code=rc" class="sref">rc0"a> < 0)n
L505" class="line" namn>
L505">.5050"a>                return -3a href="+code=EIO" class="sref">EIO0"a>;n
L506" class="line" namn>
L506">.5060"a>        3a href="+code=rc" class="sref">rc0"a> = 3a href="+code=wf_fcu_write_reg" class="sref">wf_fcu_write_reg0"a>(3a href="+code=pv" class="sref">pv0"a>, 0x2e, &3a href="+code=buf" class="sref">buf0"a>, 1);n
L507" class="line" namn>
L507">.5070"a>        if (3a href="+code=rc" class="sref">rc0"a> < 0)n
L508" class="line" namn>
L508">.5080"a>                return -3a href="+code=EIO" class="sref">EIO0"a>;n
L509" class="line" namn>
L509">.5090"a>        3a href="+code=rc" class="sref">rc0"a> = 3a href="+code=wf_fcu_read_reg" class="sref">wf_fcu_read_reg0"a>(3a href="+code=pv" class="sref">pv0"a>, 0, &3a href="+code=buf" class="sref">buf0"a>, 1);n
L510" class="line" namn>
L510">.5100"a>        if (3a href="+code=rc" class="sref">rc0"a> < 0)n
L511" class="line" namn>
L511">.5110"a>                return -3a href="+code=EIO" class="sref">EIO0"a>;n
L512" class="line" namn>
L512">.5120"a>        3a href="+code=pv" class="sref">pv0"a>->3a href="+code=rpm_shift" class="sref">rpm_shift0"a> = (3a href="+code=buf" class="sref">buf0"a> == 1) ? 2 : 3;n
L513" class="line" namn>
L513">.5130"a>n
L514" class="line" namn>
L514">.5140"a>        3a href="+code=pr_debug" class="sref">pr_debug0"a>(3spa
 class="string">"wf_fcu: FCU Initialized, RPM fan shift is %d\n"3/spa
 ,n
L515" class="line" namn>
L515">.5150"a>                 3a href="+code=pv" class="sref">pv0"a>->3a href="+code=rpm_shift" class="sref">rpm_shift0"a>);n
L516" class="line" namn>
L516">.5163/a>n
L517" class="line" namn>
L517">.5170"a>        return 0;n
L518" class="line" namn>
L518">.5180"a>}n
L519" class="line" namn>
L519">.5190"a>n
L520" class="line" namn>
L520">.5200"a>static int 3a href="+code=wf_fcu_probe" class="sref">wf_fcu_probe0"a>(struct.3a href="+code=i2c_client" class="sref">i2c_client0"a> *3a href="+code=client" class="sref">client0"a>,n
L521" class="line" namn>
L521">.5210"a>                        const struct.3a href="+code=i2c_device_id" class="sref">i2c_device_id0"a> *3a href="+code=id" class="sref">id0"a>)n
L522" class="line" namn>
L522">.5220"a>{n
L523" class="line" namn>
L523">.5230"a>        struct.3a href="+code=wf_fcu_priv" class="sref">wf_fcu_priv0"a> *3a href="+code=pv" class="sref">pv0"a>;n
L524" class="line" namn>
L524">.5243/a>n
L525" class="line" namn>
L525">.5250"a>        3a href="+code=pv" class="sref">pv0"a> = 3a href="+code=kzalloc" class="sref">kzalloc0"a>(sizeof(*3a href="+code=pv" class="sref">pv0"a>), 3a href="+code=GFP_KERNEL" class="sref">GFP_KERNEL0"a>);n
L526" class="line" namn>
L526">.5260"a>        if (!3a href="+code=pv" class="sref">pv0"a>)n
L527" class="line" namn>
L527">.5270"a>                return -3a href="+code=ENOMEM" class="sref">ENOMEM0"a>;n
L528" class="line" namn>
L528">.5280"a>n
L529" class="line" namn>
L529">.5290"a>        3a href="+code=kref_init" class="sref">kref_init0"a>(&3a href="+code=pv" class="sref">pv0"a>->3a href="+code=ref" class="sref">ref0"a>);n
L530" class="line" namn>
L530">.5300"a>        3a href="+code=mutex_init" class="sref">mutex_init0"a>(&3a href="+code=pv" class="sref">pv0"a>->3a href="+code=lock" class="sref">lock0"a>);n
L531" class="line" namn>
L531">.5310"a>        3a href="+code=INIT_LIST_HEAD" class="sref">INIT_LIST_HEAD0"a>(&3a href="+code=pv" class="sref">pv0"a>->3a href="+code=fan_list" class="sref">fan_list0"a>);n
L532" class="line" namn>
L532">.5320"a>        3a href="+code=pv" class="sref">pv0"a>->3a href="+code=i2c" class="sref">i2c0"a> = 3a href="+code=client" class="sref">client0"a>;n
L533" class="line" namn>
L533">.5330"a>n
L534" class="line" namn>
L534">.5340"a>        3spa
 class="comment">/*3/spa
  
L535" class="line" namn>
L535">.5350"a>3spa
 class="comment">         * First we must start.the FCU which will query.the3/spa
  
L536" class="line" namn>
L536">.5360"a>3spa
 class="comment">         * shift value to.apply to.RPMs3/spa
  
L537" class="line" namn>
L537">.5370"a>3spa
 class="comment">         */3/spa
  
L538" class="line" namn>
L538">.5380"a>        if (3a href="+code=wf_fcu_init_chip" class="sref">wf_fcu_init_chip0"a>(3a href="+code=pv" class="sref">pv0"a>)) {n
L539" class="line" namn>
L539">.5390"a>                3a href="+code=pr_err" class="sref">pr_err0"a>(3spa
 class="string">"wf_fcu: Initialization failed !\n"3/spa
 );n
L540" class="line" namn>
L540">.5400"a>                3a href="+code=kfren" class="sref">kfren3/a>(3a href="+code=pv" class="sref">pv0"a>);n
L541" class="line" namn>
L541">.5410"a>                return -3a href="+code=ENXIO" class="sref">ENXIO0"a>;n
L542" class="line" namn>
L542">.5420"a>        }n
L543" class="line" namn>
L543">.5430"a>n
L544" class="line" namn>
L544">.5440"a>        3spa
 class="comment">/* First lookup.fans.in.the device-tren */3/spa
  
L545" class="line" namn>
L545">.5450"a>        3a href="+code=wf_fcu_lookup_fans" class="sref">wf_fcu_lookup_fans0"a>(3a href="+code=pv" class="sref">pv0"a>);n
L546" class="line" namn>
L546">.5463/a>n
L547" class="line" namn>
L547">.5470"a>        3spa
 class="comment">/*3/spa
  
L548" class="line" namn>
L548">.5480"a>3spa
 class="comment">         * Older machines don't have.the device-tren entrins3/spa
  
L549" class="line" namn>
L549">.5490"a>3spa
 class="comment">         * we are looking for, just hard code.the list0"spa
  
L550" class="line" namn>
L550">.5500"a>3spa
 class="comment">         */3/spa
  
L551" class="line" namn>
L551">.5510"a>        if (3a href="+code=list_empty" class="sref">list_empty0"a>(&3a href="+code=pv" class="sref">pv0"a>->3a href="+code=fan_list" class="sref">fan_list0"a>))n
L552" class="line" namn>
L552">.5520"a>                3a href="+code=wf_fcu_default_fans" class="sref">wf_fcu_default_fans0"a>(3a href="+code=pv" class="sref">pv0"a>);n
L553" class="line" namn>
L553">.5530"a>n
L554" class="line" namn>
L554">.5540"a>        3spa
 class="comment">/* Still no.fans.? FAIL */3/spa
  
L555" class="line" namn>
L555">.5550"a>        if (3a href="+code=list_empty" class="sref">list_empty0"a>(&3a href="+code=pv" class="sref">pv0"a>->3a href="+code=fan_list" class="sref">fan_list0"a>)) {n
L556" class="line" namn>
L556">.5560"a>                3a href="+code=pr_err" class="sref">pr_err0"a>(3spa
 class="string">"wf_fcu: Failed to.find fans.for your machine\n"3/spa
 );n
L557" class="line" namn>
L557">.5570"a>                3a href="+code=kfren" class="sref">kfren3/a>(3a href="+code=pv" class="sref">pv0"a>);n
L558" class="line" namn>
L558">.5580"a>                return -3a href="+code=ENODEV" class="sref">ENODEV0"a>;n
L559" class="line" namn>
L559">.5590"a>        }n
L560" class="line" namn>
L560">.5610"a>n
L561" class="line" namn>
L561">.5610"a>        3a href="+code=dev_set_drvdata" class="sref">dev_set_drvdata0"a>(&3a href="+code=client" class="sref">client0"a>->3a href="+code=dev" class="sref">dev0"a>, 3a href="+code=pv" class="sref">pv0"a>);n
L562" class="line" namn>
L562">.5623/a>n
L563" class="line" namn>
L563">.5630"a>        return 0;n
L564" class="line" namn>
L564">.5643/a>}n
L565" class="line" namn>
L565">.5650"a>n
L566" class="line" namn>
L566">.5663/a>static int 3a href="+code=wf_fcu_remove" class="sref">wf_fcu_remove0"a>(struct.3a href="+code=i2c_client" class="sref">i2c_client0"a> *3a href="+code=client" class="sref">client0"a>)n
L567" class="line" namn>
L567">.5670"a>{n
L568" class="line" namn>
L568">.5680"a>        struct.3a href="+code=wf_fcu_priv" class="sref">wf_fcu_priv0"a> *3a href="+code=pv" class="sref">pv0"a> = 3a href="+code=dev_get_drvdata" class="sref">dev_get_drvdata0"a>(&3a href="+code=client" class="sref">client0"a>->3a href="+code=dev" class="sref">dev0"a>);n
L569" class="line" namn>
L569">.5690"a>        struct.3a href="+code=wf_fcu_fan" class="sref">wf_fcu_fan0"a> *3a href="+code=fan" class="sref">fan0"a>;n
L570" class="line" namn>
L570">.5710"a>n
L571" class="line" namn>
L571">.5710"a>        while (!3a href="+code=list_empty" class="sref">list_empty0"a>(&3a href="+code=pv" class="sref">pv0"a>->3a href="+code=fan_list" class="sref">fan_list0"a>)) {n
L572" class="line" namn>
L572">.5720"a>                3a href="+code=fan" class="sref">fan0"a> = 3a href="+code=list_first_entry" class="sref">list_first_entry0"a>(&3a href="+code=pv" class="sref">pv0"a>->3a href="+code=fan_list" class="sref">fan_list0"a>, struct.3a href="+code=wf_fcu_fan" class="sref">wf_fcu_fan0"a>, 3a href="+code=link" class="sref">link0"a>);n
L573" class="line" namn>
L573">.5730"a>                3a href="+code=list_del" class="sref">list_del0"a>(&3a href="+code=fan" class="sref">fan0"a>->3a href="+code=link" class="sref">link0"a>);n
L574" class="line" namn>
L574">.5740"a>                3a href="+code=wf_unregister_control" class="sref">wf_unregister_control0"a>(&3a href="+code=fan" class="sref">fan0"a>->3a href="+code=ctrl" class="sref">ctrl0"a>);n
L575" class="line" namn>
L575">.5750"a>        }n
L576" class="line" namn>
L576">.5760"a>        3a href="+code=kref_put" class="sref">kref_put0"a>(&3a href="+code=pv" class="sref">pv0"a>->3a href="+code=ref" class="sref">ref0"a>, 3a href="+code=wf_fcu_release" class="sref">wf_fcu_release0"a>);n
L577" class="line" namn>
L577">.5770"a>        return 0;n
L578" class="line" namn>
L578">.5780"a>}n
L579" class="line" namn>
L579">.5790"a>n
L580" class="line" namn>
L580">.5800"a>static const struct.3a href="+code=i2c_device_id" class="sref">i2c_device_id0"a> 3a href="+code=wf_fcu_id" class="sref">wf_fcu_id0"a>[] = {n
L581" class="line" namn>
L581">.5810"a>        { 3spa
 class="string">"MAC,fcu"3/spa
 , 0 },n
L582" class="line" namn>
L582">.5820"a>        { }n
L583" class="line" namn>
L583">.5830"a>};n
L584" class="line" namn>
L584">.5840"a>3a href="+code=MODULE_DEVICE_TABLE" class="sref">MODULE_DEVICE_TABLE3/a>(3a href="+code=i2c" class="sref">i2c0"a>, 3a href="+code=wf_fcu_id" class="sref">wf_fcu_id0"a>);n
L585" class="line" namn>
L585">.5850"a>n
L586" class="line" namn>
L586">.5863/a>static struct.3a href="+code=i2c_driver" class="sref">i2c_driver0"a> 3a href="+code=wf_fcu_driver" class="sref">wf_fcu_driver0"a> = {n
L587" class="line" namn>
L587">.5870"a>        .3a href="+code=driver" class="sref">driver0"a> = {n
L588" class="line" namn>
L588">.5880"a>                .3a href="+code=namn" class="sref">namn0"a>   = 3spa
 class="string">"wf_fcu"3/spa
 ,n
L589" class="line" namn>
L589">.5890"a>        },n
L590" class="line" namn>
L590">.5900"a>        .3a href="+code=probe" class="sref">probe0"a>          = 3a href="+code=wf_fcu_probe" class="sref">wf_fcu_probe0"a>,n
L591" class="line" namn>
L591">.5910"a>        .3a href="+code=remove" class="sref">remove0"a>         = 3a href="+code=wf_fcu_remove" class="sref">wf_fcu_remove0"a>,n
L592" class="line" namn>
L592">.5920"a>        .3a href="+code=id_table" class="sref">id_table0"a>       = 3a href="+code=wf_fcu_id" class="sref">wf_fcu_id0"a>,n
L593" class="line" namn>
L593">.5930"a>};n
L594" class="line" namn>
L594">.5943/a>n
L595" class="line" namn>
L595">.5950"a>3a href="+code=module_i2c_driver" class="sref">module_i2c_driver3/a>(3a href="+code=wf_fcu_driver" class="sref">wf_fcu_driver0"a>);n
L596" class="line" namn>
L596">.5963/a>n
L597" class="line" namn>
L597">.5970"a>3a href="+code=MODULE_AUTHOR" class="sref">MODULE_AUTHOR0"a>(3spa
 class="string">"Benjamin Herrenschmidt <benh@kernel.crashing.org>"3/spa
 );n
L598" class="line" namn>
L598">.5980"a>3a href="+code=MODULE_DESCRIPTION" class="sref">MODULE_DESCRIPTION0"a>(3spa
 class="string">"FCU control objects.for PowerMacs.thermal control"3/spa
 );n
L599" class="line" namn>
L599">.5990"a>3a href="+code=MODULE_LICENSE" class="sref">MODULE_LICENSE0"a>(3spa
 class="string">"GPL"3/spa
 );n
L600" class="line" namn>
L600">.6010"a>n
L601" class="line" namn>
L601">.6010"a>
lxr.linux.no kindly hosted by.3a href="http://www.redpill-linpro.no">Redpill Linpro AS0"a>,.provider of Linux consulting and operations services since 1995.