linux/Documentation/acpi/method-customizing.txt
<<
l"."/lanux+v3.7.4/Documenta> /acpi/method-customizing.txt"> c/gfx/right.png" alt=">>"> an> < a> class="lxr_search"> ac> ="+search" method="post" onsubmit="return do_search(this);"> Search < a> class="lxr_prm>s" l"+prm>s?return=Documenta> /acpi/method-customizing.txt" hr/fonclick="return ajax_prm>s();"> s an> < hr/formdiv < hr/for> ac> ="ajax+*" method="post" onsubmit="return false;"> ainput typ2.6hidden" nam2.6ajax_lookup" id.6ajax_lookup" e="v2.6"> hr/form> < hr/fordiv class="headingbottam">
l"Documenta> /acpi/method-customizing.txt#L1" id.6L1" class="line" nam2.6L1">/fo1rma>Lanux ACPI Custom Control Method How To < orm>l"Documenta> /acpi/method-customizing.txt#L2" id.6L2" class="line" nam2.6L2">/fo2rma>======================================= < orm>l"Documenta> /acpi/method-customizing.txt#L3" id.6L3" class="line" nam2.6L3">/fo3rma> < orm>l"Documenta> /acpi/method-customizing.txt#L4" id.6L4" class="line" nam2.6L4">/fo4rma>Written by Zhang Rui <rui.zhang@intel.com> < orm>l"Documenta> /acpi/method-customizing.txt#L5" id.6L5" class="line" nam2.6L5">/fo5rma> < orm>l"Documenta> /acpi/method-customizing.txt#L6" id.6L6" class="line" nam2.6L6">/fo6rma> < orm>l"Documenta> /acpi/method-customizing.txt#L7" id.6L7" class="line" nam2.6L7">/fo7rma>Lanux supports customizing ACPI control methods at runtime. < orm>l"Documenta> /acpi/method-customizing.txt#L8" id.6L8" class="line" nam2.6L8">/fo8rma> < orm>l"Documenta> /acpi/method-customizing.txt#L9" id.6L9" class="line" nam2.6L9">/fo9rma>Users c use this to < orm>l"Documenta> /acpi/method-customizing.txt#L10" id.6L10" class="line" nam2.6L10">/foptia>1. override existing method which may not work corr ly, < orm>l"Documenta> /acpi/method-customizing.txt#L11" id.6L11" class="line" nam2.6L11">/f11rma>r/for just > debugging purposes. < orm>l"Documenta> /acpi/method-customizing.txt#L12" id.6L12" class="line" nam2.6L12">/f12rma>2. insert a completely new method inforder to create missing < orm>l"Documenta> /acpi/method-customizing.txt#L13" id.6L13" class="line" nam2.6L13">/f13rma>r/fmethod such as _OFF, _ON, _STA, _INI, etc. < orm>l"Documenta> /acpi/method-customizing.txt#L14" id.6L14" class="line" nam2.6L14">/f14rma>F these cases, it is far simpler to dynamically install single < orm>l"Documenta> /acpi/method-customizing.txt#L15" id.6L15" class="line" nam2.6L15">/f15rma>control method rathe th override the entirm DSDT, because kernel < orm>l"Documenta> /acpi/method-customizing.txt#L16" id.6L16" class="line" nam2.6L16">/f16rma>rebuild/reboot is not needed d test result c be got in minutes. < orm>l"Documenta> /acpi/method-customizing.txt#L17" id.6L17" class="line" nam2.6L17">/f17rma> < orm>l"Documenta> /acpi/method-customizing.txt#L18" id.6L18" class="line" nam2.6L18">/f18rma>Note: Only ACPI METHOD c be overridden, y othe obj typ2s like < orm>l"Documenta> /acpi/method-customizing.txt#L19" id.6L19" class="line" nam2.6L19">/f19rma>r/ffff"Device",f"Opera> Reg ",farm not r ognized. < orm>l"Documenta> /acpi/method-customizing.txt#L20" id.6L20" class="line" nam2.6L20">/f20rma>Note: The sam2 ACPI control method c be overridden > m y times, < orm>l"Documenta> /acpi/method-customizing.txt#L21" id.6L21" class="line" nam2.6L21">/f21rma>r/ffff d it's always the latest one th t used by Lanux/kernel. < orm>l"Documenta> /acpi/method-customizing.txt#L22" id.6L22" class="line" nam2.6L22">/f22rma>Note: To get the ACPI debug obj output (Storm (AAAA, Debug)), < orm>l"Documenta> /acpi/method-customizing.txt#L23" id.6L23" class="line" nam2.6L23">/f23rma>r/ffffplease runf"echo 1 > /sys/module/acpi/param2ters/aml_debug_output". < orm>l"Documenta> /acpi/method-customizing.txt#L24" id.6L24" class="line" nam2.6L24">/f24rma> < orm>l"Documenta> /acpi/method-customizing.txt#L25" id.6L25" class="line" nam2.6L25">/f25tia>1. override existing method < orm>l"Documenta> /acpi/method-customizing.txt#L26" id.6L26" class="line" nam2.6L26">/f26rma>r/fa) get the ACPI table via ACPI sysfs I/F. e.g. to get the DSDT, < orm>l"Documenta> /acpi/method-customizing.txt#L27" id.6L27" class="line" nam2.6L27">/f27rma>r/ffffjust runf"c t /sys/firmwarm/acpi/tables/DSDT > /tmp/dsdt.dat" < orm>l"Documenta> /acpi/method-customizing.txt#L28" id.6L28" class="line" nam2.6L28">/f28rma>r/fb) disassemble the table by running "iasl -d dsdt.dat". < orm>l"Documenta> /acpi/method-customizing.txt#L29" id.6L29" class="line" nam2.6L29">/f29rma>r/fc) r write the ASL code of the method d save it in new file, < orm>l"Documenta> /acpi/method-customizing.txt#L30" id.6L30" class="line" nam2.6L30">/f30rma>r/fd) package the new file (psr.asl) to ACPI table > at. < orm>l"Documenta> /acpi/method-customizing.txt#L31" id.6L31" class="line" nam2.6L31">/f31rma>r/ffffHerm is example of a customized \_SB._AC._PSR method, < orm>l"Documenta> /acpi/method-customizing.txt#L32" id.6L32" class="line" nam2.6L32">/f32rma> < orm>l"Documenta> /acpi/method-customizing.txt#L33" id.6L33" class="line" nam2.6L33">/f33rma>r/ffffDefini> Block ("",f"SSDT",f1,f"",f"",f0x20080715) < orm>l"Documenta> /acpi/method-customizing.txt#L34" id.6L34" class="line" nam2.6L34">/f34rma>r/ffff{ < orm>l"Documenta> /acpi/method-customizing.txt#L35" id.6L35" class="line" nam2.6L35">/f35rma>r/ffff External (ACON) < orm>l"Documenta> /acpi/method-customizing.txt#L36" id.6L36" class="line" nam2.6L36">/f36rma> < orm>l"Documenta> /acpi/method-customizing.txt#L37" id.6L37" class="line" nam2.6L37">/f37rma>r/ffff Method (\_SB_.AC._PSR,f0, NotSerialized) < orm>l"Documenta> /acpi/method-customizing.txt#L38" id.6L38" class="line" nam2.6L38">/f38rma>r/ffff { < orm>l"Documenta> /acpi/method-customizing.txt#L39" id.6L39" class="line" nam2.6L39">/f39rma>r/ffff Storm ("I AC _PSR",fDebug) < orm>l"Documenta> /acpi/method-customizing.txt#L40" id.6L40" class="line" nam2.6L40">/f40rma>r/ffff Return (ACON) < orm>l"Documenta> /acpi/method-customizing.txt#L41" id.6L41" class="line" nam2.6L41">/f41rma>r/ffff } < orm>l"Documenta> /acpi/method-customizing.txt#L42" id.6L42" class="line" nam2.6L42">/f42rma>r/ffff} < orm>l"Documenta> /acpi/method-customizing.txt#L43" id.6L43" class="line" nam2.6L43">/f43rma>r/ffffNote th t the full pathnam2 of the method i ACPI nam2space < orm>l"Documenta> /acpi/method-customizing.txt#L44" id.6L44" class="line" nam2.6L44">/f44rma>r/ffffshould be used. < orm>l"Documenta> /acpi/method-customizing.txt#L45" id.6L45" class="line" nam2.6L45">/f45rma>r/ffffA d remember to use "External" to declarm external obj s. < orm>l"Documenta> /acpi/method-customizing.txt#L46" id.6L46" class="line" nam2.6L46">/f46rma>r/fe) assemble the file to genera>e the AML code of the method. < orm>l"Documenta> /acpi/method-customizing.txt#L47" id.6L47" class="line" nam2.6L47">/f47rma>r/ffffe.g. "iasl psr.asl" (psr.aml is genera>ed as a result) < orm>l"Documenta> /acpi/method-customizing.txt#L48" id.6L48" class="line" nam2.6L48">/f48rma>r/ff) mount debugfs by "mount -t debugfs none /sys/kernel/debug" < orm>l"Documenta> /acpi/method-customizing.txt#L49" id.6L49" class="line" nam2.6L49">/f49rma>r/fg) override the old method via the debugfs by running < orm>l"Documenta> /acpi/method-customizing.txt#L50" id.6L50" class="line" nam2.6L50">/f5019rma>r/ffff&quoc t /4" cclass="lebugfs by runn50" class="line" rma9m+minutes. < orm>l< orm>l< orm>l< orm>l< orm>l< izing.txt#L49" 5d.6L41" 5lass="line" nam2.6L41">5f41rm51 < orm>l"Documenta> /acpi/method-customizing.txt#L37" 5d.6L42" 5lass="line" nam2.6L42">5f42rm5>2. insert a compmethod inform>l"Documenta> /acpi/method-customizing.txt#L37" 5d.6L43" 5lass="line" nam2.6L43">5f43rm5>r/ffffNTto l"Documenta> /acpi/method-customizing.txt#L47" 5d.6L44" 5lass="line" nam2.6L44">5f44rm5>r/ffffsWet runfed create miASL code of the method d we wat d orm>l"Documenta> /acpi/method-customizing.txt#L10" 5d.6L5" cllass="line" nam2.6L5">/ff45rm5>r/ffffArt a comest h m llow methstepr wr~overCPIse ="aj 1 orm>l"Documenta> /acpi/method-customizing.txt#L47" 5d.6L46" 5lass="line" nam2.6L46">5f46rm5> < orm>l"Documenta> /acpi/method-customizing.txt#L37" 5d.6L47" 5lass="line" nam2.6L47">5f47rm5>r/ff3. undo your c@intesorm>l"Documenta> /acpi/method-customizing.txt#L37" 5d.6L48" 5lass="line" nam2.6L48">5f48rm58r/ffffNTtuot;Exteundot; (psro> Reg not needorts cu cm ympmethrt a cedhod inform>l"Documenta> /acpi/method-customizing.txt#L37" 5d.6L49" 5lass="line" nam2.6L49">5f49rm5>r/fg) ot.png new, i.e. we be or ognmridissid c burr> ly orm>l"Documenta> /acpi/method-customizing.txt#L47" 6d.6L50" 6lass="line" nam2.6L50">6f50196ma>r/fffthesverride thedhod inf,order to creaundo your c@intes,ase runorm>l"Documenta> /acpi/method-customizing.txt#L47" 6d.6L41" 6lass="line" nam2.6L41">6f41rm6>r/ffff it implepythe method d ot.piobj code of tCPIstepr wrse ="aj 1 orm>l"Documenta> /acpi/method-customizing.txt#L32" 6d.6L42" 6lass="line" nam2.6L42">6f42rm6>r/ffff}aemembdo stepr wr~overrearide the old od d with old mt.piobj /sy orm>l"Documenta> /acpi/method-customizing.txt#L47" 6d.6L43" 6lass="line" nam2.6L43">6f43rm6> < orm>l"Documenta> /acpi/method-customizing.txt#L4" i6d.6L44" 6lass="line" nam2.6L44">6f44rm6> < orm>l"Documenta> /acpi/method-customizing.txt#L25" 6d.6L5" c6lass="line" nam2.6L5">/6f45rm65Note: To gWe use thisanel < with m < iof aomizinI nam2od ratheng < orm>l"Documenta> /acpi/method-customizing.txt#L32" 6d.6L6" cllass="line" nam2.6L6">/ff46rm66a>r/ffff&qBut sanSINGLEorm>l"Documenta> /acpi/method-customizing.txt#L32" 6d.6L47" 6lass="line" nam2.6L47">6f47rm6>r/ffffe.g.od d oide the. i.e. if we wat d hrt a c/ride the m < iof orm>l"Documenta> /acpi/method-customizing.txt#L32" 6d.6L48" 6lass="line" nam2.6L48">6f48rm6>r/ffff { nam2od rats,awefed creambdo stepr wr~overm y < iof as, < orm>l"Documenta> /acpi/method-customizing.txt#L47" 6d.6L49" 6lass="line" nam2.6L49">6f49rm69 < orm>l"Documenta> /acpi/method-customizing.txt#L7" idd.6L50" 7lass="line" nam2.6L50">7f50197>Note: The Bisa/acpt the ris nuse mis-this to l"Documenta> /acpi/method-customizing.txt#L7" idd.6L41" 7lass="line" nam2.6L41">7f41rm71r/ffffe.g.odmory}aemega newdd Blocbj t.pngt isf ris ;s alwaprivto tes in orm>l"Documenta> /acpi/method-customizing.txt#L7" idd.6L42" 7lass="line" nam2.6L42">7f42rm7>r/ffff} < lt)triccedh(m yple of asf ris not needallow crealoadewdd Blocbjorm>l"Documenta> /acpi/method-customizing.txt#L7" idd.6L43" 7lass="line" nam2.6L43">7f43rm7>r/ffffNotele/acpresfto c is ) orm>l"Documenta> /acpi/method-customizing.txt#L47" 7d.6L44" 7lass="line" nam2.6L44">7f44rm7> < Tld mt.piobj LXR soft/acptunnold rm>l"Docuhttp://sourcem ge.net/pros. < /lxr">LXR community < ,s to ia> l vo s"aj unnrm>l"Documailto:lxr@x+v3..no">lxr@x+v3..no < . v < rdi id.6s="linesubfis er"> lxr.x+v3..no kCPdly hosty Lanurm>l"Docuhttp://www.mbdpill-x+vpro.no">Rbdpillux/kpro co < ,sprovidbj fux/kertrol) < &quoxidro> Reg srser&quosgle ce 1995. v < rdiv /bodydi /htmlr/