linux/drivers/macintosh/via-pmu-event.c
<<
> 3.4/spa > 3.4/form> 3.4a > 3. href="../linux+v3.9.5/drivers/macintosh/via-pmu-event.c"> > 3.4img src="../.static/gfx/right.png" alt=">>"> >4/spa > >4spa class="lxr_search"> > > 3.4input typ> hidden" nam> navtarget" tion> "> > 3.4input typ> text" nam> search" id search"> > 3.4butt/optyp> submit">Search 3.4/form> 4/spa > >4spa class="lxr_prefs"> 3.4a href="+prefs?return=drivers/macintosh/via-pmu-event.c" > 3. onclick="return ajax_prefs();"> > 3.Prefs 3.4/a> >4/spa > 3. .4/div> 3. .4form ac ="ajax+*" method="post" onsubmit="return false;"> >4input typ> hidden" nam> ajax_lookup" id ajax_lookup" tion> "> 3. .4/form> 3. .4div class="headingbott/m">
3.
3. 3. .4div id search_results" class="search_results" 3> 3. .4/div> 4div id content"> 4div id file_contents">

 L1">. .14/a>4spa  class="comment">/*4/spa >

 L2">. .24/a>4spa  class="comment"> * via-pmu event device for reporting some events that come through the PMU4/spa >

 L3">. .34/a>4spa  class="comment"> *4/spa >

 L4">. .44/a>4spa  class="comment"> * Copyright 2006 Johannes Berg <johannes@sipsolu
	  s.net>4/spa >

 L5">. .54/a>4spa  class="comment"> *4/spa >

 L6">. .64/a>4spa  class="comment"> * This program is free software; you ca  redistribute it and/or modify4/spa >

 L7">. .74/a>4spa  class="comment"> * it under the terms of the GNU General Public License as published by4/spa >

 L8">. .84/a>4spa  class="comment"> * the Free Software Founda
	  ; either vers

 L9">. .94/a>4spa  class="comment"> * (at your 2"
	  ) any later vers

 L10">. .8.1a>4spa  class="comment"> *4/spa >

 L11">. 114/a>4spa  class="comment"> * This program is distributed in the hope that it will be useful, but4/spa >

 L12">. 124/a>4spa  class="comment"> * WITHOUT ANY WARRANTY; without even the implied warranty of4/spa >

 L13">. 134/a>4spa  class="comment"> * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or4/spa >

 L14">. 144/a>4spa  class="comment"> * NON INFRINGEMENT.  See the GNU General Public License for more4/spa >

 L15">. 154/a>4spa  class="comment"> * details.4/spa >

 L16">. 164/a>4spa  class="comment"> *4/spa >

 L17">. 174/a>4spa  class="comment"> * You should have received a copy of the GNU General Public License4/spa >

 L18">. 184/a>4spa  class="comment"> * along with this program; if not, write to the Free Software4/spa >

 L19">. 194/a>4spa  class="comment"> * Founda
	  , Inc., 51 Franklin St, Fifth Floor, Bost  , MA  02110-1301 USA4/spa >

 L20">. 28.1a>4spa  class="comment"> *4/spa >

 L21">. 214/a>4spa  class="comment"> */4/spa >

 L22">. 224/a>

 L23">. 234/a>#include <linux/input.h4/a>>

 L24">. 244/a>#include <linux/adb.h4/a>>

 L25">. 254/a>#include <linux/pmu.h4/a>>

 L26">. 264/a>#include "via-pmu-event.h4/a>"

 L27">. 274/a>

 L28">. 284/a>static struct.4a href="+code=input_dev" class="sref">input_dev4/a> *4a href="+code=pmu_input_dev" class="sref">pmu_input_dev4/a>;

 L29">. 294/a>

 L30">. 304/a>static int.4a href="+code=__init" class="sref">__init4/a> 4a href="+code=via_pmu_event_init" class="sref">via_pmu_event_init4/a>(void)

 L31">. 314/a>{

 L32">. 324/a>        int.4a href="+code=err" class="sref">err4/a>;

 L33">. 334/a>

 L34">. 344/a>        4spa  class="comment">/* do other models report butt/o/lid status? */4/spa >

 L35">. 354/a>        if (4a href="+code=pmu_get_model" class="sref">pmu_get_model4/a>() !=.4a href="+code=PMU_KEYLARGO_BASED" class="sref">PMU_KEYLARGO_BASED4/a>)

 L36">. 364/a>                return -4a href="+code=ENODEV" class="sref">ENODEV4/a>;

 L37">. 374/a>

 L38">. 384/a>        4a href="+code=pmu_input_dev" class="sref">pmu_input_dev4/a> =.4a href="+code=input_allocate_device" class="sref">input_allocate_device4/a>();

 L39">. 394/a>        if (!4a href="+code=pmu_input_dev" class="sref">pmu_input_dev4/a>)

 L40">. 404/a>                return -4a href="+code=ENOMEM" class="sref">ENOMEM4/a>;

 L41">. 414/a>

 L42">. 424/a>        4a href="+code=pmu_input_dev" class="sref">pmu_input_dev4/a>->4a href="+code=nam>" class="sref">nam>4/a> =.4spa  class="string">"PMU";

 L43">. 434/a>        4a href="+code=pmu_input_dev" class="sref">pmu_input_dev4/a>->4a href="+code=id" class="sref">id4/a>.4a href="+code=bustyp>" class="sref">bustyp>4/a> =.4a href="+code=BUS_HOST" class="sref">BUS_HOST4/a>;

 L44">. 444/a>        4a href="+code=pmu_input_dev" class="sref">pmu_input_dev4/a>->4a href="+code=id" class="sref">id4/a>.4a href="+code=vendor" class="sref">vendor4/a> =.0x0001;

 L45">. 454/a>        4a href="+code=pmu_input_dev" class="sref">pmu_input_dev4/a>->4a href="+code=id" class="sref">id4/a>.4a href="+code=product" class="sref">product4/a> =.0x0001;

 L46">. 464/a>        4a href="+code=pmu_input_dev" class="sref">pmu_input_dev4/a>->4a href="+code=id" class="sref">id4/a>.4a href="+code=versvers =.0x0100;

 L47">. 474/a>

 L48">. 484/a>        4a href="+code=set_bit" class="sref">set_bit4/a>(4a href="+code=EV_KEY" class="sref">EV_KEY4/a>, 4a href="+code=pmu_input_dev" class="sref">pmu_input_dev4/a>->4a href="+code=evbit" class="sref">evbit4/a>);

 L49">. 494/a>        4a href="+code=set_bit" class="sref">set_bit4/a>(4a href="+code=EV_SW" class="sref">EV_SW4/a>, 4a href="+code=pmu_input_dev" class="sref">pmu_input_dev4/a>->4a href="+code=evbit" class="sref">evbit4/a>);

 L50">. 504/a>        4a href="+code=set_bit" class="sref">set_bit4/a>(4a href="+code=KEY_POWER" class="sref">KEY_POWER4/a>, 4a href="+code=pmu_input_dev" class="sref">pmu_input_dev4/a>->4a href="+code=keybit" class="sref">keybit4/a>);

 L51">. 514/a>        4a href="+code=set_bit" class="sref">set_bit4/a>(4a href="+code=SW_LID" class="sref">SW_LID4/a>, 4a href="+code=pmu_input_dev" class="sref">pmu_input_dev4/a>->4a href="+code=swbit" class="sref">swbit4/a>);

 L52">. 524/a>

 L53">. 534/a>        4a href="+code=err" class="sref">err4/a> =.4a href="+code=input_register_device" class="sref">input_register_device4/a>(4a href="+code=pmu_input_dev" class="sref">pmu_input_dev4/a>);

 L54">. 544/a>        if (4a href="+code=err" class="sref">err4/a>)

 L55">. 554/a>                4a href="+code=input_free_device" class="sref">input_free_device4/a>(4a href="+code=pmu_input_dev" class="sref">pmu_input_dev4/a>);

 L56">. 564/a>        return 4a href="+code=err" class="sref">err4/a>;

 L57">. 574/a>}

 L58">. 584/a>

 L59">. 594/a>void 4a href="+code=via_pmu_event" class="sref">via_pmu_event4/a>(int.4a href="+code=key" class="sref">key4/a>, int.4a href="+code=dowo" class="sref">dowo4/a>)

 L60">. 604/a>{

 L61">. 614/a>

 L62">. 624/a>        if (4a href="+code=unlikely" class="sref">unlikely4/a>(!4a href="+code=pmu_input_dev" class="sref">pmu_input_dev4/a>))

 L63">. 634/a>                return;

 L64">. 644/a>

 L65">. 654/a>        switch (4a href="+code=key" class="sref">key4/a>) {

 L66">. 664/a>        case.4a href="+code=PMU_EVT_POWER" class="sref">PMU_EVT_POWER4/a>:

 L67">. 674/a>                4a href="+code=input_report_key" class="sref">input_report_key4/a>(4a href="+code=pmu_input_dev" class="sref">pmu_input_dev4/a>, 4a href="+code=KEY_POWER" class="sref">KEY_POWER4/a>, 4a href="+code=dowo" class="sref">dowo4/a>);

 L68">. 684/a>                break;

 L69">. 694/a>        case.4a href="+code=PMU_EVT_LID" class="sref">PMU_EVT_LID4/a>:

 L70">. 704/a>                4a href="+code=input_report_switch" class="sref">input_report_switch4/a>(4a href="+code=pmu_input_dev" class="sref">pmu_input_dev4/a>, 4a href="+code=SW_LID" class="sref">SW_LID4/a>, 4a href="+code=dowo" class="sref">dowo4/a>);

 L71">. 714/a>                break;

 L72">. 724/a>        default:

 L73">. 734/a>                4spa  class="comment">/* no such key handled */4/spa >

 L74">. 744/a>                return;

 L75">. 754/a>        }

 L76">. 764/a>

 L77">. 774/a>        4a href="+code=input_sync" class="sref">input_sync4/a>(4a href="+code=pmu_input_dev" class="sref">pmu_input_dev4/a>);

 L78">. 784/a>}

 L79">. 794/a>

 L80">. 88.1a>4a href="+code=late_initcall" class="sref">late_initcall4/a>(4a href="+code=via_pmu_event_init" class="sref">via_pmu_event_init4/a>);

 L81">. 814/a>4/pre>


4/div>

4div class="footer">
The original LXR software by the LXR community4/a>, this experimental verslxr@linux.no4/a>.
4/div>
4div class="subfooter">
lxr.linux.no kindly hosted by Redpill Linpro AS4/a>, provider of Linux consulting and opera
	  s services since 1995.
4/div>

4/body>
4/html>