linux/drivers/macintosh/via-pmu-event.c
<<
ion .14/spa> .14/form .14a ion .1 href="../linux+v3"3.2/drivers/macintosh/via-pmu-event.c">ion .14img src="../.static/gfx/right.png" alt=">>">io4/spa> io4spa> class="lxr_search">ion ="+search" method="post" onsubmit="return do_search(this);">ion .14input typ> hidden" nam> navtarget" tion> ">ion .14input typ> text" nam> search" id search">ion .14butt/optyp> submit">Search io4spa> class="lxr_prefs" .14a href="+prefs?return=drivers/macintosh/via-pmu-event.c"ion .1 onclick="return ajax_prefs();">ion .1Prefs .14/a>io4/spa> n .1 14/div n .1 14form ac >="ajax+*" method="post" onsubmit="return false;">io4input typ> hidden" nam> ajax_lookup" id ajax_lookup" tion> ">in .1 14/form in .1 14div class="headingbott/m">
L1">1 114/a>4spa> class="comment" /*4/spa> L2">1 124/a>4spa> class="comment" * via-pmu event device for reporting some events that come through the PMU4/spa> L3">1 134/a>4spa> class="comment" *4/spa> L4">1 144/a>4spa> class="comment" * Copyright 2006 Johannes Berg <johannes@sipsolu >s.net>4/spa> L5">1 154/a>4spa> class="comment" *4/spa> L6">1 164/a>4spa> class="comment" * This program is free software; you ca> redistribute it and/or modify4/spa> L7">1 174/a>4spa> class="comment" * it under the terms of the GNU General Public License as published by4/spa> L8">1 184/a>4spa> class="comment" * the Free Software Founda >; either vers L9">1 194/a>4spa> class="comment" * (at your " >) any later vers L10">1 8.10a>4spa> class="comment" *4/spa> L11">1 114/a>4spa> class="comment" * This program is distributed in the hope that it will be useful, but4/spa> L12">1 124/a>4spa> class="comment" * WITHOUT ANY WARRANTY; without even the implied warranty of4/spa> L13">1 134/a>4spa> class="comment" * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or4/spa> L14">1 144/a>4spa> class="comment" * NON INFRINGEMENT. See the GNU General Public License for more4/spa> L15">1 154/a>4spa> class="comment" * details.4/spa> L16">1 164/a>4spa> class="comment" *4/spa> L17">1 174/a>4spa> class="comment" * You should have received a copy of the GNU General Public License4/spa> L18">1 184/a>4spa> class="comment" * along with this program; if not, write to the Free Software4/spa> L19">1 194/a>4spa> class="comment" * Founda >, Inc., 51 Franklin St, Fifth Floor, Bost >, MA 02110-1301 USA4/spa> L20">1 2.10a>4spa> class="comment" *4/spa> L21">1 214/a>4spa> class="comment" */4/spa> L22">1 224/a> L23">1 234/a>#include <linux/input.h4/a>> L24">1 244/a>#include <linux/adb.h4/a>> L25">1 254/a>#include <linux/pmu.h4/a>> L26">1 264/a>#include "via-pmu-event.h4/a>" L27">1 274/a> L28">1 284/a>static struct14a href="+code=input_dev" class="sref">input_dev4/a> *4a href="+code=pmu_input_dev" class="sref">pmu_input_dev4/a>; L29">1 294/a> L30">1 304/a>static int14a href="+code=__init" class="sref">__init4/a> 4a href="+code=via_pmu_event_init" class="sref">via_pmu_event_init4/a>(void) L31">1 314/a>{ L32">1 324/a> int14a href="+code=err" class="sref">err4/a>; L33">1 334/a> L34">1 344/a> 4spa> class="comment" /* do other models report butt/o/lid status? */4/spa> L35">1 354/a> if (4a href="+code=pmu_get_model" class="sref">pmu_get_model4/a>() !=14a href="+code=PMU_KEYLARGO_BASED" class="sref">PMU_KEYLARGO_BASED4/a>) L36">1 364/a> return -4a href="+code=ENODEV" class="sref">ENODEV4/a>; L37">1 374/a> L38">1 384/a> 4a href="+code=pmu_input_dev" class="sref">pmu_input_dev4/a> =14a href="+code=input_allocate_device" class="sref">input_allocate_device4/a>(); L39">1 394/a> if (!4a href="+code=pmu_input_dev" class="sref">pmu_input_dev4/a>) L40">1 404/a> return -4a href="+code=ENOMEM" class="sref">ENOMEM4/a>; L41">1 414/a> L42">1 424/a> 4a href="+code=pmu_input_dev" class="sref">pmu_input_dev4/a>->4a href="+code=nam>" class="sref">nam>4/a> =14spa> class="string">"PMU" ; L43">1 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> =14a href="+code=BUS_HOST" class="sref">BUS_HOST4/a>; L44">1 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> =10x0001; L45">1 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> =10x0001; L46">1 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 =10x0100; L47">1 474/a> L48">1 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">1 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">1 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">1 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">1 524/a> L53">1 534/a> 4a href="+code=err" class="sref">err4/a> =14a href="+code=input_register_device" class="sref">input_register_device4/a>(4a href="+code=pmu_input_dev" class="sref">pmu_input_dev4/a>); L54">1 544/a> if (4a href="+code=err" class="sref">err4/a>) L55">1 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">1 564/a> return 4a href="+code=err" class="sref">err4/a>; L57">1 574/a>} L58">1 584/a> L59">1 594/a>void 4a href="+code=via_pmu_event" class="sref">via_pmu_event4/a>(int14a href="+code=key" class="sref">key4/a>, int14a href="+code=dowo" class="sref">dowo4/a>) L60">1 604/a>{ L61">1 614/a> L62">1 624/a> if (4a href="+code=unlikely" class="sref">unlikely4/a>(!4a href="+code=pmu_input_dev" class="sref">pmu_input_dev4/a>)) L63">1 634/a> return; L64">1 644/a> L65">1 654/a> switch (4a href="+code=key" class="sref">key4/a>) { L66">1 664/a> case14a href="+code=PMU_EVT_POWER" class="sref">PMU_EVT_POWER4/a>: L67">1 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">1 684/a> break; L69">1 694/a> case14a href="+code=PMU_EVT_LID" class="sref">PMU_EVT_LID4/a>: L70">1 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">1 714/a> break; L72">1 724/a> default: L73">1 734/a> 4spa> class="comment" /* no such key handled */4/spa> L74">1 744/a> return; L75">1 754/a> } L76">1 764/a> L77">1 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">1 784/a>} L79">1 794/a> L80">1 8.10a>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">1 814/a>4/pre>
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