Jump to content

how to create a DSDT patch with these requirements?


mrjayviper
 Share

9 posts in this topic

Recommended Posts

1. In Device (PWRB), change Name (_HID, EisaId ("PNP0C0C")) to Name (_CID, EisaId ("PNP0C0C")).

 

2. change string "Store (Local0, Local0)" to "Store (0x00, Local0)"

 

I've looked at examples from olarila but still confused on what to do.

 

thank you very much

Link to comment
Share on other sites

hello

 

i don't really get what u want but ..

 

why u don't do the chances with a dsdt editor manually ?

 

u should read + about what are u trying to do ..

 

good hack

  • Like 1
Link to comment
Share on other sites

1. I'm trying to create a patch file I can use every time instead of doing the edit manually.

 

I gave 2 examples of what I want to do. they are very easy to do when editing manually but as I said, I want to create a patch file.

 

2. I do not know what to read on how to create a DSDT patch file. can you please point me to a good guide?

 

thanks again!

Link to comment
Share on other sites

thanks very much for the help!

 

as for the second help

        Method (_MSG, 1, NotSerialized)
        {
            Store (Local0, Local0)
        }
 
        Method (_SST, 1, NotSerialized)
        {
            Store (Local0, Local0)
        }
how do I change those 2?
Link to comment
Share on other sites

https://sourceforge.net/p/maciasl/wiki/Home/

 

http://regexr.com

 

(into|into_all) (All|DefinitionBlock|Scope|Method|Device|Processor|ThermalZone) [(label|name_adr|name_hid|code_regex|code_regex_not|parent_label|parent_type|parent_adr|parent_hid) <selector>...] (insert|set_label|replace_matched|replaceall_matched|remove_matched|removeall_matched|remove_entry|replace_content|store_%8|store_%9) begin <argument> end;

DOM
extent into,into_all
scope definitionblock,scope,method,device,processor,thermalzone,all
predicate label,name_adr,name_hid,parent_label,parent_type,parent_adr,parent_hid
action insert,set_label,remove_entry,replace_content

REGEX
extent into,into_all
predicate code_regex,code_regex_not
action replace_matched,replaceall_matched,remove_matched,removeall_matched,store_%8,store_%9

No Arguments
remove_entry,remove_matched,removeall_matched,store_%8,store_%9

single-line comments start with '#'
patches separated by ';'

 

 

 

thanks very much for the help!

 

as for the second help

        Method (_MSG, 1, NotSerialized)
        {
            Store (Local0, Local0)
        }
 
        Method (_SST, 1, NotSerialized)
        {
            Store (Local0, Local0)
        }
how do I change those 2?

 

 

 

into method label _MSG code_regex Store\s\(Local0,\sLocal0\) replace_matched
begin Store (0x00, Local0) end; 

 

into method label _SST code_regex Store\s\(Local0,\sLocal0\) replace_matched 

begin Store (0x00, Local0) end; 
 
Search:
 
\s = space
\( = (
.....
  • Like 1
Link to comment
Share on other sites

thank you so much for the link. it's very helpful

 

-------------------------

 

another question though.

 

how do I find the value I need to use when using "parent_adr". I looked at the wiki and there are hardly any examples in there.

 

example: 

How do I find "0x001B0000"?

 

 

into method label _DSM parent_adr 0x001B0000 remove_entry;
into device name_adr 0x001B0000 insert
begin
Method (_DSM, 4, NotSerialized)\n
{\n
    Store (Package (0x08)\n
        {\n
            "codec-id", \n
            Buffer (0x04)\n
            {\n
                0x88, 0x08, 0xEC, 0x10\n
            }, \n
            "layout-id", \n
            Buffer (0x04)\n
            {\n
                0x78, 0x03, 0x00, 0x00\n
            }, \n
            "device-type", \n
            Buffer (0x0F)\n
            {\n
                "Realtek ALC888"\n
            }, \n
            "PinConfigurations", \n
            Buffer (One)\n
            {\n
                0x00\n
            }\n
        }, Local0)\n
    DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))\n
    Return (Local0)\n
}
end;
Link to comment
Share on other sites

parrent_adr is PCI port/slot address.

 

example.

in terminal i run lspci (install it first)

$ lspci

...

00:1a.0 USB Controller: Intel Corporation Ibex Peak USB2 Enhanced Host Controller (rev 06) = 0x001a0000

00:1b.0 Audio device: Intel Corporation Ibex Peak High Definition Audio (rev 06) = 0x001b0000

...

 

or get it with ioreg. explorer

 

HDEF@1B = 0x001b0000

 

 

in DSDT:

 

Device (USBE)

            {
                Name (_ADR, 0x001A0000)
...
Device (USB4)
            {
                Name (_ADR, 0x001A0001)
 
ok now
 
into method label _DSM parent_adr 0x001B0000 remove_entry;
into device name_adr 0x001B0000 insert
begin
if you look at patch you pasted. You search for parent_id 0x001B0000 but sometimes you can't find it because it's not there.
so patch would be something like this: 
 
adding new device (HDEF) sound.
 
into device label PCI0 insert begin
Device (HDEF)\n
        {Name (_ADR, 0x001B0000)\n
        	Name (_STA, 0x0F)\n
        	Name (_PRW, Package (0x02)\n
        	{0x09, 0x04})\n
		
            Method (_DSM, 4, NotSerialized)\n
            {If (LEqual (Arg2, Zero))\n
                {Return (Buffer (One)\n
				{0x03})\n
                }\n
				Return (Package (0x12)\n
                {\n		
				"MaximumBootBeepVolume", Buffer (One) {0x4D},\n
				"hda-gfx",		Buffer (0x0A) {"onboard-1"},\n
				"AAPL,slot-name",	Buffer (0x09) {"Built In"},
				"built-in", 		Buffer (One) {0x00},\n
				"device_type",		Buffer (0x06) {"AUDIO"},
				"name", 		Buffer (0x0F) {"Realtek ALC889"},\n
				"model",		Buffer (0x27) {"Realtek ALC889HD High Definition Audio"}, 
				"layout-id",		Buffer (0x04) {0x0C, 0x00, 0x00, 0x00},\n 
				"PinConfigurations", 	Buffer (Zero) {}\n
                })\n
            }\n
        }\n
end;

  • Like 1
Link to comment
Share on other sites

 Share

×
×
  • Create New...