<p>Patrick Rudolph has uploaded this change for <strong>review</strong>.</p><p><a href="https://review.coreboot.org/20986">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">ec/lenovo/h8/ssdt: Add WWAN ACPI methods<br><br>Implement GWAN and SWAN for thinkpad_acpi kernel module.<br><br>Change-Id: I5550c78e0d36884eca7a8d8ece19b64aaee44045<br>Signed-off-by: Patrick Rudolph <siro@das-labor.org><br>---<br>M src/ec/lenovo/h8/ssdt.c<br>1 file changed, 67 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://review.coreboot.org:29418/coreboot refs/changes/86/20986/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/src/ec/lenovo/h8/ssdt.c b/src/ec/lenovo/h8/ssdt.c<br>index eb9f2c1..cfc3304 100644<br>--- a/src/ec/lenovo/h8/ssdt.c<br>+++ b/src/ec/lenovo/h8/ssdt.c<br>@@ -102,6 +102,72 @@<br>     acpigen_pop_len(); /* Method */<br> }<br> <br>+/* Generate ACPI methods GWAN and SWAN */<br>+static void h8_dsdt_wwan(struct device *dev)<br>+{<br>+        const bool has_wwan = h8_has_wwan(dev);<br>+      /* Method (GWAN, 0) */<br>+       acpigen_write_method("GWAN", 0);<br>+   /* Store(Zero, Local0) */<br>+    acpigen_write_store_ops(ZERO_OP, LOCAL0_OP);<br>+ if (has_wwan) {<br>+              /* WWAN present */<br>+           /* Or(Local0, One, Local0) */<br>+                acpigen_write_or(LOCAL0_OP, ONE_OP, LOCAL0_OP);<br>+<br>+           /* If(LEqual(\_SB.PCI0.LPCB.EC.WWEB, One)) */<br>+                acpigen_write_if();<br>+          acpigen_emit_byte(LEQUAL_OP);<br>+                acpigen_emit_namestring(h8_dsdt_scope(dev, "WWEB"));<br>+               acpigen_emit_byte(ONE_OP);<br>+<br>+                /* Or(Local0, 2, Local0) */<br>+          acpigen_emit_byte(OR_OP);<br>+            acpigen_emit_byte(LOCAL0_OP);<br>+                acpigen_write_integer(2);<br>+            acpigen_emit_byte(LOCAL0_OP);<br>+                acpigen_pop_len(); /* If */<br>+<br>+               /* State at resume: Enabled */<br>+               /* Or(Local0, 4, Local0) */<br>+          acpigen_emit_byte(OR_OP);<br>+            acpigen_emit_byte(LOCAL0_OP);<br>+                acpigen_write_integer(4);<br>+            acpigen_emit_byte(LOCAL0_OP);<br>+        }<br>+    /* Return(Local0) */<br>+ acpigen_emit_byte(RETURN_OP);<br>+        acpigen_emit_byte(LOCAL0_OP);<br>+        acpigen_pop_len(); /* Method */<br>+<br>+   /* Method (SWAN, 0) */<br>+       acpigen_write_method("SWAN", 1);<br>+   if (has_wwan) {<br>+              /* And(Arg0, 2, Local0) */<br>+           acpigen_emit_byte(AND_OP);<br>+           acpigen_emit_byte(ARG0_OP);<br>+          acpigen_write_integer(2);<br>+            acpigen_emit_byte(LOCAL0_OP);<br>+                /* If(Lequal(Local0, 2)) */<br>+          acpigen_write_if_lequal_op_int(LOCAL0_OP, 2);<br>+                /* Store(One, \_SB.PCI0.LPCB.EC.WWEB) */<br>+             acpigen_write_store();<br>+               acpigen_emit_byte(ONE_OP);<br>+           acpigen_emit_namestring(h8_dsdt_scope(dev, "WWEB"));<br>+               acpigen_pop_len(); /* If */<br>+          /* Else */<br>+           acpigen_write_else();<br>+                /* Store(Zero, \_SB.PCI0.LPCB.EC.WWEB) */<br>+            acpigen_write_store();<br>+               acpigen_emit_byte(ZERO_OP);<br>+          acpigen_emit_namestring(h8_dsdt_scope(dev, "WWEB"));<br>+               acpigen_pop_len(); /* Else */<br>+<br>+             /* FIXME: Implement state at resume */<br>+       }<br>+    acpigen_pop_len(); /* Method */<br>+}<br>+<br> /*<br>  * Generates EC SSDT.<br>  */<br>@@ -117,6 +183,7 @@<br> <br>     /* Used by thinkpad_acpi */<br>   h8_dsdt_bluetooth(dev);<br>+      h8_dsdt_wwan(dev);<br> <br>         acpigen_pop_len(); /* Scope HKEY */<br> }<br></pre><p>To view, visit <a href="https://review.coreboot.org/20986">change 20986</a>. To unsubscribe, visit <a href="https://review.coreboot.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://review.coreboot.org/20986"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: coreboot </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: I5550c78e0d36884eca7a8d8ece19b64aaee44045 </div>
<div style="display:none"> Gerrit-Change-Number: 20986 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Patrick Rudolph <siro@das-labor.org> </div>