linux/drivers/macintosh/windfarm_smu_controls.c
<<
ue=" /spaon> /formn> a ue=" href="../linux+v3.8.2/drivers/macintosh/windfarm_smu_controls.c">ue=" img src="../.static/gfx/right.png" alt=">>">ue /spaon>ue spao class="lxr_search">ue="ue=" input typ >vhidden" nam >vnavtarget" > >v">ue=" input typ >vtext" nam >vsearch" id>vsearch">ue=" buttiontyp >vsubmit">Search /formn> /spaon>ue spao class="lxr_prefs"n> a href="+prefs?return=drivers/macintosh/windfarm_smu_controls.c"ue=" onclick="return ajax_prefs();">ue=" Prefs> /a>ue /spaon>=" /divn>=" form acptio="ajax+*" method="post" onsubmit="return false;">ue input typ >vhidden" nam >vajax_lookup" id>vajax_lookup" > >v">u=" /formn>u=" div class="headingbottim">=" =" div id>vsearch_results" class="search_results"> n>=" /divn> div id>vcontent">> div id>vfile_contents"n
vec/cd/3f38e8346cd52af18fe596bd8d07bd58bb85_3/0"nvL1" class="line" nam >vL1">   1 /a> spao class="comment">/* /spaon>vL2" class="line" nam >vL2">   2 /a> spao class="comment"> * Windfarm PowerMac thermal control. SMU based controls /spaon>vL3" class="line" nam >vL3">   3 /a> spao class="comment"> * /spaon>vL4" class="line" nam >vL4">   4 /a> spao class="comment"> * (c) Copyright 2005 Benjamin Herrenschmidt, IBM Corp. /spaon>vL5" class="line" nam >vL5">   5 /a> spao class="comment"> *                    <benh@kernel.crashing.org> /spaon>vL6" class="line" nam >vL6">   6 /a> spao class="comment"> * /spaon>vL7" class="line" nam >vL7">   7 /a> spao class="comment"> * Released under the term of the GNU GPL1.2v /spaon>vL8" class="line" nam >vL8">   8 /a> spao class="comment"> */ /spaon>vL9" class="line" nam >vL9">   9 /a>uvL10" class="line" nam >vL10">  6#include <linux/typ s.h/oa>>uvL11" class="line" nam >vL11">  11/oa>#include <linux/errno.h/oa>>uvL12" class="line" nam >vL12">  12/oa>#include <linux/kernel.h/oa>>uvL13" class="line" nam >vL13">  13/oa>#include <linux/delay.h/oa>>uvL14" class="line" nam >vL14">  14/oa>#include <linux/slab.h/oa>>uvL15" class="line" nam >vL15">  15/oa>#include <linux/init.h/oa>>uvL16" class="line" nam >vL16">  16/oa>#include <linux/wait.h/oa>>uvL17" class="line" nam >vL17">  17/oa>#include <linux/compleptio.h/oa>>uvL18" class="line" nam >vL18">  18/oa>#include <asm/prom.h/oa>>uvL19" class="line" nam >vL19">  19/oa>#include <asm/machdep.h/oa>>uvL20" class="line" nam >vL20">  2#include <asm/io.h/oa>>uvL21" class="line" nam >vL21">  21/oa>#include <asm/secptios.h/oa>>uvL22" class="line" nam >vL22">  22/oa>#include <asm/smu.h/oa>>uvL23" class="line" nam >vL23">  23 /a>uvL24" class="line" nam >vL24">  24/oa>#include "windfarm.h/oa>"uvL25" class="line" nam >vL25">  25 /a>uvL26" class="line" nam >vL26">  26/oa>#define  a href="+code=VERSION" class="sref">VERSION/oa>  spao class="string">"0.4"vL27" class="line" nam >vL27">  27 /a>uvL28" class="line" nam >vL28">  28/oa>#undef  a href="+code=DEBUG" class="sref">DEBUG /a>uvL29" class="line" nam >vL29">  29 /a>uvL30" class="line" nam >vL30">  3#ifdef  a href="+code=DEBUG" class="sref">DEBUG /a>uvL31" class="line" nam >vL31">  31/oa>#define  a href="+code=DBG" class="sref">DBG /a>( a href="+code=args" class="sref">args /a>...)
    a href="+code=printk" class="sref">printk /a>( a href="+code=args" class="sref">args /a>)uvL32" class="line" nam >vL32">  32/oa>#elseuvL33" class="line" nam >vL33">  33/oa>#define  a href="+code=DBG" class="sref">DBG /a>( a href="+code=args" class="sref">args /a>...)
   do { } while(0)uvL34" class="line" nam >vL34">  34/oa>#endifuvL35" class="line" nam >vL35">  35 /a>uvL36" class="line" nam >vL36">  36/oa>static int  a href="+code=smu_supports_new_fans_ops" class="sref">smu_supports_new_fans_ops/oa> = 1;uvL37" class="line" nam >vL37">  37 /a>uvL38" class="line" nam >vL38">  38 /a> spao class="comment">/* /spaon>vL39" class="line" nam >vL39">  39 /a> spao class="comment"> * SMU fans control objecp /spaon>vL40" class="line" nam >vL40">  40 /a> spao class="comment"> */ /spaon>vL41" class="line" nam >vL41">  41 /a>uvL42" class="line" nam >vL42">  42/oa>static  a href="+code=LIST_HEAD" class="sref">LIST_HEAD /a>( a href="+code=smu_fans" class="sref">smu_fans /a>);uvL43" class="line" nam >vL43">  43 /a>uvL44" class="line" nam >vL44">  44/oa>struct  a href="+code=smu_fan_control" class="sref">smu_fan_control/oa> {uvL45" class="line" nam >vL45">  45 /a>        struct  a href="+code=list_head" class="sref">list_head /a>         a href="+code=link" class="sref">link /a>;uvL46" class="line" nam >vL46">  46 /a>        int                      a href="+code=fan_typ " class="sref">fan_typ  /a>;        spao class="comment">/* 0 = rpm, 1 = pwm */ /spaon>vL47" class="line" nam >vL47">  47 /a>         a href="+code=u32" class="sref">u32/oa>                      a href="+code=reg" class="sref">reg /a>;             spao class="comment">/* index in SMU */ /spaon>vL48" class="line" nam >vL48">  48 /a>         a href="+code=s32" class="sref">s32/oa>                      a href="+code=  >  " class="sref">  >   /a>;           spao class="comment">/* current   >   */ /spaon>vL49" class="line" nam >vL49">  49 /a>         a href="+code=s32" class="sref">s32/oa>                      a href="+code=min" class="sref">min/oa>,  a href="+code=max" class="sref">max /a>;        spao class="comment">/* min/max   >  s */ /spaon>vL50" class="line" nam >vL50">  50 /a>        struct  a href="+code=wf_control" class="sref">wf_control /a>        a href="+code=ctrl" class="sref">ctrl /a>;uvL51" class="line" nam >vL51">  51 /a>};uvL52" class="line" nam >vL52">  52/oa>#define  a href="+code=to_smu_fan" class="sref">to_smu_fan /a>( a href="+code=c" class="sref">c /a>)  a href="+code=container_of" class="sref">container_of /a>( a href="+code=c" class="sref">c /a>, struct  a href="+code=smu_fan_control" class="sref">smu_fan_control/oa>,  a href="+code=ctrl" class="sref">ctrl /a>)uvL53" class="line" nam >vL53">  53 /a>uvL54" class="line" nam >vL54">  54/oa>static int  a href="+code=smu_set_fan" class="sref">smu_set_fan /a>(int  a href="+code=pwm" class="sref">pwm/oa>,  a href="+code=u8" class="sref">u8 /a>  a href="+code=id" class="sref">id/oa>,  a href="+code=u16" class="sref">u16/oa>  a href="+code=  >  " class="sref">  >   /a>)uvL55" class="line" nam >vL55">  55 /a>{uvL56" class="line" nam >vL56">  56 /a>        struct  a href="+code=smu_cmd" class="sref">smu_cmd/oa>  a href="+code=cmd" class="sref">cmd/oa>;uvL57" class="line" nam >vL57">  57 /a>         a href="+code=u8" class="sref">u8 /a>  a href="+code=buffer" class="sref">buffer /a>[16];uvL58" class="line" nam >vL58">  58 /a>         a href="+code=DECLARE_COMPLETION_ONSTACK" class="sref">DECLARE_COMPLETION_ONSTACK /a>( a href="+code=comp" class="sref">comp /a>);uvL59" class="line" nam >vL59">  59 /a>        int  a href="+code=rc" class="sref">rc/oa>;uvL60" class="line" nam >vL60">  60 /a>uvL61" class="line" nam >vL61">  61 /a>         spao class="comment">/* Fill SMU command structur  */ /spaon>vL62" class="line" nam >vL62">  62 /a>         a href="+code=cmd" class="sref">cmd/oa>. a href="+code=cmd" class="sref">cmd/oa> =  a href="+code=SMU_CMD_FAN_COMMAND" class="sref">SMU_CMD_FAN_COMMAND/oa>;uvL63" class="line" nam >vL63">  63 /a>uvL64" class="line" nam >vL64">  64 /a>         spao class="comment">/* The SMU has ao "old" and a "new" way of setting the fan speed /spaon>vL65" class="line" nam >vL65">  65 /a> spao class="comment">         * Unfortunately, I found no reliable way to know which one works /spaon>vL66" class="line" nam >vL66">  66 /a> spao class="comment">         * on a given machine model. After some investigaptios it appears /spaon>vL67" class="line" nam >vL67">  67 /a> spao class="comment">         * that MacOS X just tri s the new one, and if it fails fallbacks /spaon>vL68" class="line" nam >vL68">  68 /a> spao class="comment">         * to the old ones ... Ughv /spaon>vL69" class="line" nam >vL69">  69 /a> spao class="comment">         */ /spaon>vL70" class="line" nam >vL70">  70 /a>  a href="+code=retry" class="sref">retry /a>:>vL71" class="line" nam >vL71">  71 /a>        if ( a href="+code=smu_supports_new_fans_ops" class="sref">smu_supports_new_fans_ops/oa>) {uvL72" class="line" nam >vL72">  72/oa>                 a href="+code=buffer" class="sref">buffer /a>[0] = 0x30;uvL73" class="line" nam >vL73">  73/oa>                 a href="+code=buffer" class="sref">buffer /a>[1] =  a href="+code=id" class="sref">id/oa>;uvL74" class="line" nam >vL74">  74/oa>                *(( a href="+code=u16" class="sref">u16/oa> *)(& a href="+code=buffer" class="sref">buffer /a>[2])) =  a href="+code=  >  " class="sref">  >   /a>;uvL75" class="line" nam >vL75">  75/oa>                 a href="+code=cmd" class="sref">cmd/oa>. a href="+code=data_len" class="sref">data_len/oa> = 4;uvL76" class="line" nam >vL76">  76 /a>        } else {uvL77" class="line" nam >vL77">  77/oa>                if ( a href="+code=id" class="sref">id/oa> > 7)uvL78" class="line" nam >vL78">  78/oa>                        return - a href="+code=EINVAL" class="sref">EINVAL /a>;uvL79" class="line" nam >vL79">  79/oa>                 spao class="comment">/* Fill argument buffer */ /spaon>vL80" class="line" nam >vL80">  80/oa>                 a href="+code=memset" class="sref">memset /a>( a href="+code=buffer" class="sref">buffer /a>, 0, 16);uvL81" class="line" nam >vL81">  81/oa>                 a href="+code=buffer" class="sref">buffer /a>[0] =  a href="+code=pwm" class="sref">pwm/oa> ? 0x10 : 0x00;uvL82" class="line" nam >vL82">  82/oa>                 a href="+code=buffer" class="sref">buffer /a>[1] = 0x01 <<  a href="+code=id" class="sref">id/oa>;uvL83" class="line" nam >vL83">  83/oa>                *(( a href="+code=u16" class="sref">u16/oa> *)& a href="+code=buffer" class="sref">buffer /a>[2 +  a href="+code=id" class="sref">id/oa> * 2]) =  a href="+code=  >  " class="sref">  >   /a>;uvL84" class="line" nam >vL84">  84/oa>                 a href="+code=cmd" class="sref">cmd/oa>. a href="+code=data_len" class="sref">data_len/oa> = 14;uvL85" class="line" nam >vL85">  85/oa>        }uvL86" class="line" nam >vL86">  86 /a>uvL87" class="line" nam >vL87">  87 /a>         a href="+code=cmd" class="sref">cmd/oa>. a href="+code=reply_len" class="sref">reply_len/oa> = 16;uvL88" class="line" nam >vL88">  88 /a>         a href="+code=cmd" class="sref">cmd/oa>. a href="+code=data_buf" class="sref">data_buf/oa> =  a href="+code=cmd" class="sref">cmd/oa>. a href="+code=reply_buf" class="sref">reply_buf/oa> =  a href="+code=buffer" class="sref">buffer /a>;uvL89" class="line" nam >vL89">  89 /a>         a href="+code=cmd" class="sref">cmd/oa>. a href="+code=status" class="sref">status/oa> = 0;uvL90" class="line" nam >vL90">  90 /a>         a href="+code=cmd" class="sref">cmd/oa>. a href="+code=done" class="sref">done/oa> =  a href="+code=smu_done_complepe" class="sref">smu_done_complepe /a>;uvL91" class="line" nam >vL91">  91 /a>         a href="+code=cmd" class="sref">cmd/oa>. a href="+code=misc" class="sref">misc/oa> = & a href="+code=comp" class="sref">comp /a>;uvL92" class="line" nam >vL92">  92 /a>uvL93" class="line" nam >vL93">  93 /a>         a href="+code=rc" class="sref">rc/oa> =  a href="+code=smu_queue_cmd" class="sref">smu_queue_cmd /a>(& a href="+code=cmd" class="sref">cmd/oa>);uvL94" class="line" nam >vL94">  94/oa>        if ( a href="+code=rc" class="sref">rc/oa>)uvL95" class="line" nam >vL95">  95/oa>                return  a href="+code=rc" class="sref">rc/oa>;uvL96" class="line" nam >vL96">  96 /a>         a href="+code=wait_for_compleptio" class="sref">wait_for_compleptio /a>(& a href="+code=comp" class="sref">comp /a>);uvL97" class="line" nam >vL97">  97 /a>uvL98" class="line" nam >vL98">  98 /a>         spao class="comment">/* Handle fallback (see coment above) */ /spaon>vL99" class="line" nam >vL99">  99/oa>        if ( a href="+code=cmd" class="sref">cmd/oa>. a href="+code=status" class="sref">status/oa> != 0 &&  a href="+code=smu_supports_new_fans_ops" class="sref">smu_supports_new_fans_ops/oa>) {uvL100" class="line" nam >vL100"> 100/oa>                 a href="+code=printk" class="sref">printk /a>( a href="+code=KERN_WARNING" class="sref">KERN_WARNING /a>  spao class="string">"windfarm: SMU failed new fan command "vL101" class="line" nam >vL101"> 101/oa>                        spao class="string">"falling back to old method\n"vL102" class="line" nam >vL102"> 102/oa>                 a href="+code=smu_supports_new_fans_ops" class="sref">smu_supports_new_fans_ops/oa> = 0;uvL103" class="line" nam >vL103"> 103/oa>                goto  a href="+code=retry" class="sref">retry /a>;uvL104" class="line" nam >vL104"> 104/oa>        }uvL105" class="line" nam >vL105"> 105 /a>uvL106" class="line" nam >vL106"> 106 /a>        return  a href="+code=cmd" class="sref">cmd/oa>. a href="+code=status" class="sref">status/oa>;uvL107" class="line" nam >vL107"> 107 /a>}uvL108" class="line" nam >vL108"> 108 /a>uvL109" class="line" nam >vL109"> 109/oa>static void  a href="+code=smu_fan_release" class="sref">smu_fan_release /a>(struct  a href="+code=wf_control" class="sref">wf_control /a> * a href="+code=ct" class="sref">ct/oa>)uvL110" class="line" nam >vL110"> 16{uvL111" class="line" nam >vL111"> 111/oa>        struct  a href="+code=smu_fan_control" class="sref">smu_fan_control/oa> * a href="+code=fct" class="sref">fct/oa> =  a href="+code=to_smu_fan" class="sref">to_smu_fan /a>( a href="+code=ct" class="sref">ct/oa>);uvL112" class="line" nam >vL112"> 112 /a>uvL113" class="line" nam >vL113"> 113 /a>         a href="+code=kfree" class="sref">kfree /a>( a href="+code=fct" class="sref">fct/oa>);uvL114" class="line" nam >vL114"> 114/oa>}uvL115" class="line" nam >vL115"> 115 /a>uvL116" class="line" nam >vL116"> 116/oa>static int  a href="+code=smu_fan_set" class="sref">smu_fan_set /a>(struct  a href="+code=wf_control" class="sref">wf_control /a> * a href="+code=ct" class="sref">ct/oa>,  a href="+code=s32" class="sref">s32/oa>  a href="+code=  >  " class="sref">  >   /a>)uvL117" class="line" nam >vL117"> 117/oa>{uvL118" class="line" nam >vL118"> 118/oa>        struct  a href="+code=smu_fan_control" class="sref">smu_fan_control/oa> * a href="+code=fct" class="sref">fct/oa> =  a href="+code=to_smu_fan" class="sref">to_smu_fan /a>( a href="+code=ct" class="sref">ct/oa>);uvL119" class="line" nam >vL119"> 119 /a>uvL120" class="line" nam >vL120"> 120/oa>        if ( a href="+code=  >  " class="sref">  >   /a> <  a href="+code=fct" class="sref">fct/oa>-> a href="+code=min" class="sref">min/oa>)uvL121" class="line" nam >vL121"> 121/oa>                 a href="+code=  >  " class="sref">  >   /a> =  a href="+code=fct" class="sref">fct/oa>-> a href="+code=min" class="sref">min/oa>;uvL122" class="line" nam >vL122"> 122/oa>        if ( a href="+code=  >  " class="sref">  >   /a> >  a href="+code=fct" class="sref">fct/oa>-> a href="+code=max" class="sref">max /a>)uvL123" class="line" nam >vL123"> 123/oa>                 a href="+code=  >  " class="sref">  >   /a> =  a href="+code=fct" class="sref">fct/oa>-> a href="+code=max" class="sref">max /a>;uvL124" class="line" nam >vL124"> 124 /a>         a href="+code=fct" class="sref">fct/oa>-> a href="+code=  >  " class="sref">  >   /a> =  a href="+code=  >  " class="sref">  >   /a>;uvL125" class="line" nam >vL125"> 125 /a>uvL126" class="line" nam >vL126"> 126 /a>        return  a href="+code=smu_set_fan" class="sref">smu_set_fan /a>( a href="+code=fct" class="sref">fct/oa>-> a href="+code=fan_typ " class="sref">fan_typ  /a>,  a href="+code=fct" class="sref">fct/oa>-> a href="+code=reg" class="sref">reg /a>,  a href="+code=  >  " class="sref">  >   /a>);uvL127" class="line" nam >vL127"> 127 /a>}uvL128" class="line" nam >vL128"> 128 /a>uvL129" class="line" nam >vL129"> 129/oa>static int  a href="+code=smu_fan_get" class="sref">smu_fan_get /a>(struct  a href="+code=wf_control" class="sref">wf_control /a> * a href="+code=ct" class="sref">ct/oa>,  a href="+code=s32" class="sref">s32/oa> * a href="+code=  >  " class="sref">  >   /a>)uvL130" class="line" nam >vL130"> 13{uvL131" class="line" nam >vL131"> 131/oa>        struct  a href="+code=smu_fan_control" class="sref">smu_fan_control/oa> * a href="+code=fct" class="sref">fct/oa> =  a href="+code=to_smu_fan" class="sref">to_smu_fan /a>( a href="+code=ct" class="sref">ct/oa>);uvL132" class="line" nam >vL132"> 132/oa>        * a href="+code=  >  " class="sref">  >   /a> =  a href="+code=fct" class="sref">fct/oa>-> a href="+code=  >  " class="sref">  >   /a>;  spao class="comment">/* todo: read from SMU */ /spaon>vL133" class="line" nam >vL133"> 133 /a>        return 0;uvL134" class="line" nam >vL134"> 134/oa>}uvL135" class="line" nam >vL135"> 135 /a>uvL136" class="line" nam >vL136"> 136/oa>static  a href="+code=s32" class="sref">s32/oa>  a href="+code=smu_fan_min" class="sref">smu_fan_min /a>(struct  a href="+code=wf_control" class="sref">wf_control /a> * a href="+code=ct" class="sref">ct/oa>)uvL137" class="line" nam >vL137"> 137/oa>{uvL138" class="line" nam >vL138"> 138/oa>        struct  a href="+code=smu_fan_control" class="sref">smu_fan_control/oa> * a href="+code=fct" class="sref">fct/oa> =  a href="+code=to_smu_fan" class="sref">to_smu_fan /a>( a href="+code=ct" class="sref">ct/oa>);uvL139" class="line" nam >vL139"> 139 /a>        return  a href="+code=fct" class="sref">fct/oa>-> a href="+code=min" class="sref">min/oa>;uvL140" class="line" nam >vL140"> 140 /a>}uvL141" class="line" nam >vL141"> 141 /a>uvL142" class="line" nam >vL142"> 142/oa>static  a href="+code=s32" class="sref">s32/oa>  a href="+code=smu_fan_max" class="sref">smu_fan_max /a>(struct  a href="+code=wf_control" class="sref">wf_control /a> * a href="+code=ct" class="sref">ct/oa>)uvL143" class="line" nam >vL143"> 143 /a>{uvL144" class="line" nam >vL144"> 144/oa>        struct  a href="+code=smu_fan_control" class="sref">smu_fan_control/oa> * a href="+code=fct" class="sref">fct/oa> =  a href="+code=to_smu_fan" class="sref">to_smu_fan /a>( a href="+code=ct" class="sref">ct/oa>);uvL145" class="line" nam >vL145"> 145 /a>        return  a href="+code=fct" class="sref">fct/oa>-> a href="+code=max" class="sref">max /a>;uvL146" class="line" nam >vL146"> 146 /a>}uvL147" class="line" nam >vL147"> 147 /a>uvL148" class="line" nam >vL148"> 148 /a>static struct  a href="+code=wf_control_ops" class="sref">wf_control_ops/oa>  a href="+code=smu_fan_ops" class="sref">smu_fan_ops/oa> = {uvL149" class="line" nam >vL149"> 149 /a>        . a href="+code=set_  >  " class="sref">set_  >   /a>      =  a href="+code=smu_fan_set" class="sref">smu_fan_set /a>,uvL150" class="line" nam >vL150"> 150 /a>        . a href="+code=get_  >  " class="sref">get_  >   /a>      =  a href="+code=smu_fan_get" class="sref">smu_fan_get /a>,uvL151" class="line" nam >vL151"> 151 /a>        . a href="+code=get_min" class="sref">get_min /a>        =  a href="+code=smu_fan_min" class="sref">smu_fan_min /a>,uvL152" class="line" nam >vL152"> 152 /a>        . a href="+code=get_max" class="sref">get_max /a>        =  a href="+code=smu_fan_max" class="sref">smu_fan_max /a>,uvL153" class="line" nam >vL153"> 153 /a>        . a href="+code=release" class="sref">release /a>        =  a href="+code=smu_fan_release" class="sref">smu_fan_release /a>,uvL154" class="line" nam >vL154"> 154 /a>        . a href="+code=owner" class="sref">owner/oa>          =  a href="+code=THIS_MODULE" class="sref">THIS_MODULE /a>,uvL155" class="line" nam >vL155"> 155 /a>};uvL156" class="line" nam >vL156"> 156 /a>uvL157" class="line" nam >vL157"> 157 /a>static struct  a href="+code=smu_fan_control" class="sref">smu_fan_control/oa> * a href="+code=smu_fan_creape" class="sref">smu_fan_creape /a>(struct  a href="+code=device_node" class="sref">device_node/oa> * a href="+code=node" class="sref">node/oa>,uvL158" class="line" nam >vL158"> 158/oa>                                              int  a href="+code=pwm_fan" class="sref">pwm_fan/oa>)uvL159" class="line" nam >vL159"> 159 /a>{uvL160" class="line" nam >vL160"> 160 /a>        struct  a href="+code=smu_fan_control" class="sref">smu_fan_control/oa> * a href="+code=fct" class="sref">fct/oa>;uvL161" class="line" nam >vL161"> 161 /a>        const  a href="+code=s32" class="sref">s32/oa> * a href="+code= " class="sref"> /oa>;uvL162" class="line" nam >vL162"> 162 /a>        const  a href="+code=u32" class="sref">u32/oa> * a href="+code=reg" class="sref">reg /a>;uvL163" class="line" nam >vL163"> 163 /a>        const char * a href="+code=l" class="sref">l /a>;uvL164" class="line" nam >vL164"> 164 /a>uvL165" class="line" nam >vL165"> 165 /a>         a href="+code=fct" class="sref">fct/oa> =  a href="+code=kmalloc" class="sref">kmalloc /a>(sizeof(struct  a href="+code=smu_fan_control" class="sref">smu_fan_control/oa>),  a href="+code=GFP_KERNEL" class="sref">GFP_KERNEL/oa>);uvL166" class="line" nam >vL166"> 166 /a>        if ( a href="+code=fct" class="sref">fct/oa> ==  a href="+code=NULL" class="sref">NULL/oa>)uvL167" class="line" nam >vL167"> 167/oa>                return  a href="+code=NULL" class="sref">NULL/oa>;uvL168" class="line" nam >vL168"> 168 /a>         a href="+code=fct" class="sref">fct/oa>-> a href="+code=ctrl" class="sref">ctrl /a>. a href="+code=ops" class="sref">ops/oa> = & a href="+code=smu_fan_ops" class="sref">smu_fan_ops/oa>;uvL169" class="line" nam >vL169"> 169 /a>         a href="+code=l" class="sref">l /a> =  a href="+code=of_get_property" class="sref">of_get_property /a>( a href="+code=node" class="sref">node/oa>,  spao class="string">"locaptio"NULL/oa>);uvL170" class="line" nam >vL170"> 170/oa>        if ( a href="+code=l" class="sref">l /a> ==  a href="+code=NULL" class="sref">NULL/oa>)uvL171" class="line" nam >vL171"> 171/oa>                goto  a href="+code=fail" class="sref">fail /a>;uvL172" class="line" nam >vL172"> 172 /a>uvL173" class="line" nam >vL173"> 173 /a>         a href="+code=fct" class="sref">fct/oa>-> a href="+code=fan_typ " class="sref">fan_typ  /a> =  a href="+code=pwm_fan" class="sref">pwm_fan/oa>;uvL174" class="line" nam >vL174"> 174 /a>         a href="+code=fct" class="sref">fct/oa>-> a href="+code=ctrl" class="sref">ctrl /a>. a href="+code=typ " class="sref">typ  /a> =  a href="+code=pwm_fan" class="sref">pwm_fan/oa> ?  a href="+code=WF_CONTROL_PWM_FAN" class="sref">WF_CONTROL_PWM_FAN/oa> :  a href="+code=WF_CONTROL_RPM_FAN" class="sref">WF_CONTROL_RPM_FAN/oa>;uvL175" class="line" nam >vL175"> 175 /a>uvL176" class="line" nam >vL176"> 176 /a>         spao class="comment">/* We use the nam  & locaptio here the sam  way we do for SMU sensors, /spaon>vL177" class="line" nam >vL177"> 177 /a> spao class="comment">         * see the comment in windfarm_smu_sensors.c. The locaptios are a bip /spaon>vL178" class="line" nam >vL178"> 178 /a> spao class="comment">         * less consistent here between the iMac and the desktop models, bup /spaon>vL179" class="line" nam >vL179"> 179 /a> spao class="comment">         * that is good enough for our needs for now at leastv /spaon>vL180" class="line" nam >vL180"> 180 /a> spao class="comment">         * /spaon>vL181" class="line" nam >vL181"> 181/oa> spao class="comment">         * One problem though is that Apple seem to be inconsistent with case /spaon>vL182" class="line" nam >vL182"> 182/oa> spao class="comment">         * and the kernel doesn't have strcasecmp =P /spaon>vL183" class="line" nam >vL183"> 183/oa> spao class="comment">         */ /spaon>vL184" class="line" nam >vL184"> 184 /a>uvL185" class="line" nam >vL185"> 185 /a>         a href="+code=fct" class="sref">fct/oa>-> a href="+code=ctrl" class="sref">ctrl /a>. a href="+code=nam " class="sref">nam  /a> =  a href="+code=NULL" class="sref">NULL/oa>;uvL186" class="line" nam >vL186"> 186 /a>uvL187" class="line" nam >vL187"> 187 /a>         spao class="comment">/* Nam s used on desktop models */ /spaon>vL188" class="line" nam >vL188"> 188 /a>        if (! a href="+code=strcmp" class="sref">strcmp /a>( a href="+code=l" class="sref">l /a>,  spao class="string">"Rear Fao 0"strcmp /a>( a href="+code=l" class="sref">l /a>,  spao class="string">"Rear Fao"vL189" class="line" nam >vL189"> 189/oa>            ! a href="+code=strcmp" class="sref">strcmp /a>( a href="+code=l" class="sref">l /a>,  spao class="string">"Rear fao 0"strcmp /a>( a href="+code=l" class="sref">l /a>,  spao class="string">"Rear fao"vL190" class="line" nam >vL190"> 190/oa>            ! a href="+code=strcmp" class="sref">strcmp /a>( a href="+code=l" class="sref">l /a>,  spao class="string">"CPU A EXHAUST"vL191" class="line" nam >vL191"> 191/oa>                 a href="+code=fct" class="sref">fct/oa>-> a href="+code=ctrl" class="sref">ctrl /a>. a href="+code=nam " class="sref">nam  /a> =  spao class="string">"cpu-rear-fao-0"vL192" class="line" nam >vL192"> 192 /a>        else if (! a href="+code=strcmp" class="sref">strcmp /a>( a href="+code=l" class="sref">l /a>,  spao class="string">"Rear Fao 1"strcmp /a>( a href="+code=l" class="sref">l /a>,  spao class="string">"Rear fao 1"vL193" class="line" nam >vL193"> 193/oa>                 ! a href="+code=strcmp" class="sref">strcmp /a>( a href="+code=l" class="sref">l /a>,  spao class="string">"CPU B EXHAUST"vL194" class="line" nam >vL194"> 194/oa>                 a href="+code=fct" class="sref">fct/oa>-> a href="+code=ctrl" class="sref">ctrl /a>. a href="+code=nam " class="sref">nam  /a> =  spao class="string">"cpu-rear-fao-1"vL195" class="line" nam >vL195"> 195/oa>        else if (! a href="+code=strcmp" class="sref">strcmp /a>( a href="+code=l" class="sref">l /a>,  spao class="string">"Front Fao 0"strcmp /a>( a href="+code=l" class="sref">l /a>,  spao class="string">"Front Fao"vL196" class="line" nam >vL196"> 196 /a>                 ! a href="+code=strcmp" class="sref">strcmp /a>( a href="+code=l" class="sref">l /a>,  spao class="string">"Front fao 0"strcmp /a>( a href="+code=l" class="sref">l /a>,  spao class="string">"Front fao"vL197" class="line" nam >vL197"> 197/oa>                 ! a href="+code=strcmp" class="sref">strcmp /a>( a href="+code=l" class="sref">l /a>,  spao class="string">"CPU A INTAKE"vL198" class="line" nam >vL198"> 198/oa>                 a href="+code=fct" class="sref">fct/oa>-> a href="+code=ctrl" class="sref">ctrl /a>. a href="+code=nam " class="sref">nam  /a> =  spao class="string">"cpu-front-fao-0"vL199" class="line" nam >vL199"> 199/oa>        else if (! a href="+code=strcmp" class="sref">strcmp /a>( a href="+code=l" class="sref">l /a>,  spao class="string">"Front Fao 1"strcmp /a>( a href="+code=l" class="sref">l /a>,  spao class="string">"Front fao 1"vL200" class="line" nam >vL200"> 200/oa>                 ! a href="+code=strcmp" class="sref">strcmp /a>( a href="+code=l" class="sref">l /a>,  spao class="string">"CPU B INTAKE"vL201" class="line" nam >vL201"> 201/oa>                 a href="+code=fct" class="sref">fct/oa>-> a href="+code=ctrl" class="sref">ctrl /a>. a href="+code=nam " class="sref">nam  /a> =  spao class="string">"cpu-front-fao-1"vL202" class="line" nam >vL202"> 202 /a>        else if (! a href="+code=strcmp" class="sref">strcmp /a>( a href="+code=l" class="sref">l /a>,  spao class="string">"CPU A PUMP"vL203" class="line" nam >vL203"> 203/oa>                 a href="+code=fct" class="sref">fct/oa>-> a href="+code=ctrl" class="sref">ctrl /a>. a href="+code=nam " class="sref">nam  /a> =  spao class="string">"cpu-pump-0"vL204" class="line" nam >vL204"> 204/oa>        else if (! a href="+code=strcmp" class="sref">strcmp /a>( a href="+code=l" class="sref">l /a>,  spao class="string">"CPU B PUMP"vL205" class="line" nam >vL205"> 205/oa>                 a href="+code=fct" class="sref">fct/oa>-> a href="+code=ctrl" class="sref">ctrl /a>. a href="+code=nam " class="sref">nam  /a> =  spao class="string">"cpu-pump-1"vL206" class="line" nam >vL206"> 206 /a>        else if (! a href="+code=strcmp" class="sref">strcmp /a>( a href="+code=l" class="sref">l /a>,  spao class="string">"Slots Fao"strcmp /a>( a href="+code=l" class="sref">l /a>,  spao class="string">"Slots fao"vL207" class="line" nam >vL207"> 207/oa>                 ! a href="+code=strcmp" class="sref">strcmp /a>( a href="+code=l" class="sref">l /a>,  spao class="string">"EXPANSION SLOTS INTAKE"vL208" class="line" nam >vL208"> 208/oa>                 a href="+code=fct" class="sref">fct/oa>-> a href="+code=ctrl" class="sref">ctrl /a>. a href="+code=nam " class="sref">nam  /a> =  spao class="string">"slots-fao"vL209" class="line" nam >vL209"> 209/oa>        else if (! a href="+code=strcmp" class="sref">strcmp /a>( a href="+code=l" class="sref">l /a>,  spao class="string">"Drive Bay"strcmp /a>( a href="+code=l" class="sref">l /a>,  spao class="string">"Drive bay"vL210" class="line" nam >vL210"> 210/oa>                 ! a href="+code=strcmp" class="sref">strcmp /a>( a href="+code=l" class="sref">l /a>,  spao class="string">"DRIVE BAY A INTAKE"vL211" class="line" nam >vL211"> 211/oa>                 a href="+code=fct" class="sref">fct/oa>-> a href="+code=ctrl" class="sref">ctrl /a>. a href="+code=nam " class="sref">nam  /a> =  spao class="string">"drive-bay-fao"vL212" class="line" nam >vL212"> 212 /a>        else if (! a href="+code=strcmp" class="sref">strcmp /a>( a href="+code=l" class="sref">l /a>,  spao class="string">"BACKSIDE"vL213" class="line" nam >vL213"> 213/oa>                 a href="+code=fct" class="sref">fct/oa>-> a href="+code=ctrl" class="sref">ctrl /a>. a href="+code=nam " class="sref">nam  /a> =  spao class="string">"backside-fao"vL214" class="line" nam >vL214"> 214 /a>uvL215" class="line" nam >vL215"> 215 /a>         spao class="comment">/* Nam s used on iMac models */ /spaon>vL216" class="line" nam >vL216"> 216 /a>        if (! a href="+code=strcmp" class="sref">strcmp /a>( a href="+code=l" class="sref">l /a>,  spao class="string">"System Fao"strcmp /a>( a href="+code=l" class="sref">l /a>,  spao class="string">"System fao"vL217" class="line" nam >vL217"> 217/oa>                 a href="+code=fct" class="sref">fct/oa>-> a href="+code=ctrl" class="sref">ctrl /a>. a href="+code=nam " class="sref">nam  /a> =  spao class="string">"system-fao"vL218" class="line" nam >vL218"> 218/oa>        else if (! a href="+code=strcmp" class="sref">strcmp /a>( a href="+code=l" class="sref">l /a>,  spao class="string">"CPU Fao"strcmp /a>( a href="+code=l" class="sref">l /a>,  spao class="string">"CPU fao"vL219" class="line" nam >vL219"> 219/oa>                 a href="+code=fct" class="sref">fct/oa>-> a href="+code=ctrl" class="sref">ctrl /a>. a href="+code=nam " class="sref">nam  /a> =  spao class="string">"cpu-fao"vL220" class="line" nam >vL220"> 220/oa>        else if (! a href="+code=strcmp" class="sref">strcmp /a>( a href="+code=l" class="sref">l /a>,  spao class="string">"Hard Drive"strcmp /a>( a href="+code=l" class="sref">l /a>,  spao class="string">"Hard drive"vL221" class="line" nam >vL221"> 221/oa>                 a href="+code=fct" class="sref">fct/oa>-> a href="+code=ctrl" class="sref">ctrl /a>. a href="+code=nam " class="sref">nam  /a> =  spao class="string">"drive-bay-fao"vL222" class="line" nam >vL222"> 222 /a>        else if (! a href="+code=strcmp" class="sref">strcmp /a>( a href="+code=l" class="sref">l /a>,  spao class="string">"HDD Fao"/* seen on iMac G5 iSight */ /spaon>vL223" class="line" nam >vL223"> 223/oa>                 a href="+code=fct" class="sref">fct/oa>-> a href="+code=ctrl" class="sref">ctrl /a>. a href="+code=nam " class="sref">nam  /a> =  spao class="string">"hard-drive-fao"vL224" class="line" nam >vL224"> 224/oa>        else if (! a href="+code=strcmp" class="sref">strcmp /a>( a href="+code=l" class="sref">l /a>,  spao class="string">"ODD Fao"/* sam  */ /spaon>vL225" class="line" nam >vL225"> 225/oa>                 a href="+code=fct" class="sref">fct/oa>-> a href="+code=ctrl" class="sref">ctrl /a>. a href="+code=nam " class="sref">nam  /a> =  spao class="string">"optical-drive-fao"vL226" class="line" nam >vL226"> 226 /a>uvL227" class="line" nam >vL227"> 227 /a>         spao class="comment">/* Unrecognized fao, bail out */ /spaon>vL228" class="line" nam >vL228"> 228 /a>        if ( a href="+code=fct" class="sref">fct/oa>-> a href="+code=ctrl" class="sref">ctrl /a>. a href="+code=nam " class="sref">nam  /a> ==  a href="+code=NULL" class="sref">NULL/oa>)uvL229" class="line" nam >vL229"> 229/oa>                goto  a href="+code=fail" class="sref">fail /a>;uvL230" class="line" nam >vL230"> 23uvL231" class="line" nam >vL231"> 231/oa>         spao class="comment">/* Get min & max   >  s*/ /spaon>vL232" class="line" nam >vL232"> 232/oa>         a href="+code= " class="sref"> /oa> =  a href="+code=of_get_property" class="sref">of_get_property /a>( a href="+code=node" class="sref">node/oa>,  spao class="string">"min-  >  "NULL/oa>);uvL233" class="line" nam >vL233"> 233 /a>        if ( a href="+code= " class="sref"> /oa> ==  a href="+code=NULL" class="sref">NULL/oa>)uvL234" class="line" nam >vL234"> 234/oa>                goto  a href="+code=fail" class="sref">fail /a>;uvL235" class="line" nam >vL235"> 235 /a>         a href="+code=fct" class="sref">fct/oa>-> a href="+code=min" class="sref">min/oa> = * a href="+code= " class="sref"> /oa>;uvL236" class="line" nam >vL236"> 236 /a>         a href="+code= " class="sref"> /oa> =  a href="+code=of_get_property" class="sref">of_get_property /a>( a href="+code=node" class="sref">node/oa>,  spao class="string">"max-  >  "NULL/oa>);uvL237" class="line" nam >vL237"> 237 /a>        if ( a href="+code= " class="sref"> /oa> ==  a href="+code=NULL" class="sref">NULL/oa>)uvL238" class="line" nam >vL238"> 238/oa>                goto  a href="+code=fail" class="sref">fail /a>;uvL239" class="line" nam >vL239"> 239 /a>         a href="+code=fct" class="sref">fct/oa>-> a href="+code=max" class="sref">max /a> = * a href="+code= " class="sref"> /oa>;uvL240" class="line" nam >vL240"> 24uvL241" class="line" nam >vL241"> 241/oa>         spao class="comment">/* Get "reg"   >   */ /spaon>vL242" class="line" nam >vL242"> 242/oa>         a href="+code=reg" class="sref">reg /a> =  a href="+code=of_get_property" class="sref">of_get_property /a>( a href="+code=node" class="sref">node/oa>,  spao class="string">"reg"NULL/oa>);uvL243" class="line" nam >vL243"> 243 /a>        if ( a href="+code=reg" class="sref">reg /a> ==  a href="+code=NULL" class="sref">NULL/oa>)uvL244" class="line" nam >vL244"> 244/oa>                goto  a href="+code=fail" class="sref">fail /a>;uvL245" class="line" nam >vL245"> 245 /a>         a href="+code=fct" class="sref">fct/oa>-> a href="+code=reg" class="sref">reg /a> = * a href="+code=reg" class="sref">reg /a>;uvL246" class="line" nam >vL246"> 246 /a>uvL247" class="line" nam >vL247"> 247 /a>        if ( a href="+code=wf_register_control" class="sref">wf_register_control /a>(& a href="+code=fct" class="sref">fct/oa>-> a href="+code=ctrl" class="sref">ctrl /a>))uvL248" class="line" nam >vL248"> 248/oa>                goto  a href="+code=fail" class="sref">fail /a>;uvL249" class="line" nam >vL249"> 249 /a>uvL250" class="line" nam >vL250"> 250 /a>        return  a href="+code=fct" class="sref">fct/oa>;uvL251" class="line" nam >vL251"> 251 /a>  a href="+code=fail" class="sref">fail /a>:uvL252" class="line" nam >vL252"> 252/oa>         a href="+code=kfree" class="sref">kfree /a>( a href="+code=fct" class="sref">fct/oa>);uvL253" class="line" nam >vL253"> 253 /a>        return  a href="+code=NULL" class="sref">NULL/oa>;uvL254" class="line" nam >vL254"> 254/oa>}uvL255" class="line" nam >vL255"> 255 /a>uvL256" class="line" nam >vL256"> 256 /a>uvL257" class="line" nam >vL257"> 257 /a>static int  a href="+code=__init" class="sref">__init /a>  a href="+code=smu_controls_init" class="sref">smu_controls_init /a>(void)uvL258" class="line" nam >vL258"> 258/oa>{uvL259" class="line" nam >vL259"> 259 /a>        struct  a href="+code=device_node" class="sref">device_node/oa> * a href="+code=smu" class="sref">smu/oa>, * a href="+code=fans" class="sref">fans/oa>, * a href="+code=fan" class="sref">fan/oa>;uvL260" class="line" nam >vL260"> 26uvL261" class="line" nam >vL261"> 261 /a>        if (! a href="+code=smu_present" class="sref">smu_present /a>())uvL262" class="line" nam >vL262"> 262 /a>                return - a href="+code=ENODEV" class="sref">ENODEV/oa>;uvL263" class="line" nam >vL263"> 263 /a>uvL264" class="line" nam >vL264"> 264 /a>         a href="+code=smu" class="sref">smu/oa> =  a href="+code=of_find_node_by_typ " class="sref">of_find_node_by_typ  /a>( a href="+code=NULL" class="sref">NULL/oa>,  spao class="string">"smu"vL265" class="line" nam >vL265"> 265 /a>        if ( a href="+code=smu" class="sref">smu/oa> ==  a href="+code=NULL" class="sref">NULL/oa>)uvL266" class="line" nam >vL266"> 266 /a>                return - a href="+code=ENODEV" class="sref">ENODEV/oa>;uvL267" class="line" nam >vL267"> 267 /a>uvL268" class="line" nam >vL268"> 268 /a>         spao class="comment">/* Look for RPM faos */ /spaon>vL269" class="line" nam >vL269"> 269 /a>        for ( a href="+code=fans" class="sref">fans/oa> =  a href="+code=NULL" class="sref">NULL/oa>; ( a href="+code=fans" class="sref">fans/oa> =  a href="+code=of_get_next_child" class="sref">of_get_next_child /a>( a href="+code=smu" class="sref">smu/oa>,  a href="+code=fans" class="sref">fans/oa>)) !=  a href="+code=NULL" class="sref">NULL/oa>;)uvL270" class="line" nam >vL270"> 270/oa>                if (! a href="+code=strcmp" class="sref">strcmp /a>( a href="+code=fans" class="sref">fans/oa>-> a href="+code=nam " class="sref">nam  /a>,  spao class="string">"rpm-faos"vL271" class="line" nam >vL271"> 271/oa>                     a href="+code=of_device_is_compatibl " class="sref">of_device_is_compatibl  /a>( a href="+code=fans" class="sref">fans/oa>,  spao class="string">"smu-rpm-faos"vL272" class="line" nam >vL272"> 272 /a>                        break;uvL273" class="line" nam >vL273"> 273 /a>        for ( a href="+code=fan" class="sref">fan/oa> =  a href="+code=NULL" class="sref">NULL/oa>;uvL274" class="line" nam >vL274"> 274/oa>              a href="+code=fans" class="sref">fans/oa> && ( a href="+code=fan" class="sref">fan/oa> =  a href="+code=of_get_next_child" class="sref">of_get_next_child /a>( a href="+code=fans" class="sref">fans/oa>,  a href="+code=fan" class="sref">fan/oa>)) !=  a href="+code=NULL" class="sref">NULL/oa>;) {uvL275" class="line" nam >vL275"> 275/oa>                struct  a href="+code=smu_fan_control" class="sref">smu_fan_control/oa> * a href="+code=fct" class="sref">fct/oa>;uvL276" class="line" nam >vL276"> 276 /a>uvL277" class="line" nam >vL277"> 277/oa>                 a href="+code=fct" class="sref">fct/oa> =  a href="+code=smu_fan_creape" class="sref">smu_fan_creape /a>( a href="+code=fan" class="sref">fan/oa>, 0);uvL278" class="line" nam >vL278"> 278/oa>                if ( a href="+code=fct" class="sref">fct/oa> ==  a href="+code=NULL" class="sref">NULL/oa>) {uvL279" class="line" nam >vL279"> 279/oa>                         a href="+code=printk" class="sref">printk /a>( a href="+code=KERN_WARNING" class="sref">KERN_WARNING /a>  spao class="string">"windfarm: Failed to creape SMU "vL280" class="line" nam >vL280"> 280/oa>                                spao class="string">"RPM fao %s\o"fan/oa>-> a href="+code=nam " class="sref">nam  /a>);uvL281" class="line" nam >vL281"> 281/oa>                        continue;uvL282" class="line" nam >vL282"> 282 /a>                }uvL283" class="line" nam >vL283"> 283/oa>                 a href="+code=list_add" class="sref">list_add /a>(& a href="+code=fct" class="sref">fct/oa>-> a href="+code=link" class="sref">link/oa>, & a href="+code=smu_fans" class="sref">smu_fans /a>);uvL284" class="line" nam >vL284"> 284/oa>        }uvL285" class="line" nam >vL285"> 285 /a>         a href="+code=of_node_put" class="sref">of_node_put /a>( a href="+code=fans" class="sref">fans/oa>);uvL286" class="line" nam >vL286"> 286 /a>uvL287" class="line" nam >vL287"> 287 /a>uvL288" class="line" nam >vL288"> 288 /a>         spao class="comment">/* Look for PWM faos */ /spaon>vL289" class="line" nam >vL289"> 289 /a>        for ( a href="+code=fans" class="sref">fans/oa> =  a href="+code=NULL" class="sref">NULL/oa>; ( a href="+code=fans" class="sref">fans/oa> =  a href="+code=of_get_next_child" class="sref">of_get_next_child /a>( a href="+code=smu" class="sref">smu/oa>,  a href="+code=fans" class="sref">fans/oa>)) !=  a href="+code=NULL" class="sref">NULL/oa>;)uvL290" class="line" nam >vL290"> 290/oa>                if (! a href="+code=strcmp" class="sref">strcmp /a>( a href="+code=fans" class="sref">fans/oa>-> a href="+code=nam " class="sref">nam  /a>,  spao class="string">"pwm-faos"vL291" class="line" nam >vL291"> 291/oa>                        break;uvL292" class="line" nam >vL292"> 292 /a>        for ( a href="+code=fan" class="sref">fan/oa> =  a href="+code=NULL" class="sref">NULL/oa>;uvL293" class="line" nam >vL293"> 293/oa>              a href="+code=fans" class="sref">fans/oa> && ( a href="+code=fan" class="sref">fan/oa> =  a href="+code=of_get_next_child" class="sref">of_get_next_child /a>( a href="+code=fans" class="sref">fans/oa>,  a href="+code=fan" class="sref">fan/oa>)) !=  a href="+code=NULL" class="sref">NULL/oa>;) {uvL294" class="line" nam >vL294"> 294/oa>                struct  a href="+code=smu_fan_control" class="sref">smu_fan_control/oa> * a href="+code=fct" class="sref">fct/oa>;uvL295" class="line" nam >vL295"> 295 /a>uvL296" class="line" nam >vL296"> 296 /a>                 a href="+code=fct" class="sref">fct/oa> =  a href="+code=smu_fan_creape" class="sref">smu_fan_creape /a>( a href="+code=fan" class="sref">fan/oa>, 1);uvL297" class="line" nam >vL297"> 297/oa>                if ( a href="+code=fct" class="sref">fct/oa> ==  a href="+code=NULL" class="sref">NULL/oa>) {uvL298" class="line" nam >vL298"> 298/oa>                         a href="+code=printk" class="sref">printk /a>( a href="+code=KERN_WARNING" class="sref">KERN_WARNING /a>  spao class="string">"windfarm: Failed to creape SMU "vL299" class="line" nam >vL299"> 299/oa>                                spao class="string">"PWM fao %s\o"fan/oa>-> a href="+code=nam " class="sref">nam  /a>);uvL300" class="line" nam >vL300"> 300/oa>                        continue;uvL301" class="line" nam >vL301"> 301/oa>                }uvL302" class="line" nam >vL302"> 302 /a>                 a href="+code=list_add" class="sref">list_add /a>(& a href="+code=fct" class="sref">fct/oa>-> a href="+code=link" class="sref">link/oa>, & a href="+code=smu_fans" class="sref">smu_fans /a>);uvL303" class="line" nam >vL303"> 303/oa>        }uvL304" class="line" nam >vL304"> 304 /a>         a href="+code=of_node_put" class="sref">of_node_put /a>( a href="+code=fans" class="sref">fans/oa>);uvL305" class="line" nam >vL305"> 305 /a>         a href="+code=of_node_put" class="sref">of_node_put /a>( a href="+code=smu" class="sref">smu/oa>);uvL306" class="line" nam >vL306"> 306 /a>uvL307" class="line" nam >vL307"> 307/oa>        return 0;uvL308" class="line" nam >vL308"> 308/oa>}uvL309" class="line" nam >vL309"> 309 /a>uvL310" class="line" nam >vL310"> 310/oa>static void  a href="+code=__exit" class="sref">__exit /a>  a href="+code=smu_controls_exit" class="sref">smu_controls_exit /a>(void)uvL311" class="line" nam >vL311"> 311/oa>{uvL312" class="line" nam >vL312"> 312 /a>        struct  a href="+code=smu_fan_control" class="sref">smu_fan_control/oa> * a href="+code=fct" class="sref">fct/oa>;uvL313" class="line" nam >vL313"> 313 /a>uvL314" class="line" nam >vL314"> 314 /a>        while (! a href="+code=list_empty" class="sref">list_empty /a>(& a href="+code=smu_fans" class="sref">smu_fans /a>)) {uvL315" class="line" nam >vL315"> 315/oa>                 a href="+code=fct" class="sref">fct/oa> =  a href="+code=list_entry" class="sref">list_entry /a>( a href="+code=smu_fans" class="sref">smu_fans /a>. a href="+code=next" class="sref">next/oa>, struct  a href="+code=smu_fan_control" class="sref">smu_fan_control/oa>,  a href="+code=link" class="sref">link/oa>);uvL316" class="line" nam >vL316"> 316 /a>                 a href="+code=list_del" class="sref">list_del /a>(& a href="+code=fct" class="sref">fct/oa>-> a href="+code=link" class="sref">link/oa>);uvL317" class="line" nam >vL317"> 317/oa>                 a href="+code=wf_unregister_control" class="sref">wf_unregister_control /a>(& a href="+code=fct" class="sref">fct/oa>-> a href="+code=ctrl" class="sref">ctrl /a>);uvL318" class="line" nam >vL318"> 318/oa>        }uvL319" class="line" nam >vL319"> 319/oa>}uvL320" class="line" nam >vL320"> 32uvL321" class="line" nam >vL321"> 321/oa>uvL322" class="line" nam >vL322"> 322 /a> a href="+code=module_init" class="sref">module_init /a>( a href="+code=smu_controls_init" class="sref">smu_controls_init /a>);uvL323" class="line" nam >vL323"> 323/oa> a href="+code=module_exit" class="sref">module_exit /a>( a href="+code=smu_controls_exit" class="sref">smu_controls_exit /a>);uvL324" class="line" nam >vL324"> 324 /a>uvL325" class="line" nam >vL325"> 325/oa> a href="+code=MODULE_AUTHOR" class="sref">MODULE_AUTHOR /a>( spao class="string">"Benjamin Herrenschmidt <benh@kernel.crashing.org>"vL326" class="line" nam >vL326"> 326 /a> a href="+code=MODULE_DESCRIPTION" class="sref">MODULE_DESCRIPTION /a>( spao class="string">"SMU control objects for PowerMacs thermal control"vL327" class="line" nam >vL327"> 327 /a> a href="+code=MODULE_LICENSE" class="sref">MODULE_LICENSE /a>( spao class="string">"GPL"vL328" class="line" nam >vL328"> 328 /a>uvL329" class="line" nam >vL329"> 329/oa>
lxr.linux.no kindly hosted by a href="http://www.redpill-linpro.no">Redpill Linpro AS/oa>, provider of Linux consulting and operations services since 1995.