<p>Patrick Rudolph has uploaded this change for <strong>review</strong>.</p><p><a href="https://review.coreboot.org/21002">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">ec/lenovo/h8/ssdt: Add keyboard backlight interface<br><br>Add methods MLCG and MLCS for thinkpad_acpi kernel module.<br><br>Change-Id: Ia65e770e772936c9c32be33c30839a2dee2a107c<br>Signed-off-by: Patrick Rudolph <siro@das-labor.org><br>---<br>M src/ec/lenovo/h8/ssdt.c<br>1 file changed, 72 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/02/21002/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 0c68b2b..26c0d84 100644<br>--- a/src/ec/lenovo/h8/ssdt.c<br>+++ b/src/ec/lenovo/h8/ssdt.c<br>@@ -168,6 +168,77 @@<br> acpigen_pop_len(); /* Method */<br> }<br> <br>+/* Generate ACPI methods MLCG and MLCS */<br>+static void h8_dsdt_keyboard_backlight(struct device *dev)<br>+{<br>+ struct ec_lenovo_h8_config *conf = dev->chip_info;<br>+ if (!conf)<br>+ return;<br>+<br>+ const bool has_kbbl = conf->has_keyboard_backlight;<br>+<br>+ /* Method (MLCG, 1) */<br>+ acpigen_write_method("MLCG", 1);<br>+ /* Store(Zero, Local0) */<br>+ acpigen_write_store_ops(ZERO_OP, LOCAL0_OP);<br>+ if (has_kbbl) {<br>+ /* Keyboard backlight present */<br>+ /* Or(Local0, (1 << 9), Local0) */<br>+ acpigen_emit_byte(OR_OP);<br>+ acpigen_emit_byte(LOCAL0_OP);<br>+ acpigen_write_integer((1 << 9));<br>+ acpigen_emit_byte(LOCAL0_OP);<br>+<br>+ /* If(LEqual(\_SB.PCI0.LPCB.EC.KBLT, One)) */<br>+ acpigen_write_if();<br>+ acpigen_emit_byte(LEQUAL_OP);<br>+ acpigen_emit_namestring(h8_dsdt_scope(dev, "KBLT"));<br>+ acpigen_emit_byte(ONE_OP);<br>+<br>+ /* Or(Local0, 1, Local0) */<br>+ acpigen_write_or(LOCAL0_OP, ONE_OP, LOCAL0_OP);<br>+ acpigen_pop_len(); /* If */<br>+ }<br>+ /* Return(Local0) */<br>+ acpigen_emit_byte(RETURN_OP);<br>+ acpigen_emit_byte(LOCAL0_OP);<br>+ acpigen_pop_len(); /* Method */<br>+<br>+ /* Method (MLCS, 1) */<br>+ acpigen_write_method("MLCS", 1);<br>+ if (has_kbbl) {<br>+ /* And(Arg0, 3, Local0) */<br>+ acpigen_emit_byte(AND_OP);<br>+ acpigen_emit_byte(ARG0_OP);<br>+ acpigen_write_integer(3);<br>+ acpigen_emit_byte(LOCAL0_OP);<br>+<br>+ /* If(LGREATER_OP(Local0, 0)) */<br>+ acpigen_write_if();<br>+ acpigen_emit_byte(LGREATER_OP);<br>+ acpigen_emit_byte(LOCAL0_OP);<br>+ acpigen_emit_byte(ZERO_OP);<br>+<br>+ /* FIXME: Support 2bit brightness control */<br>+ /* Store(One, \_SB.PCI0.LPCB.EC.KBLT) */<br>+ acpigen_write_store();<br>+ acpigen_emit_byte(ONE_OP);<br>+ acpigen_emit_namestring(h8_dsdt_scope(dev, "KBLT"));<br>+ acpigen_pop_len(); /* If */<br>+ /* Else */<br>+ acpigen_write_else();<br>+ /* Store(Zero, \_SB.PCI0.LPCB.EC.KBLT) */<br>+ acpigen_write_store();<br>+ acpigen_emit_byte(ZERO_OP);<br>+ acpigen_emit_namestring(h8_dsdt_scope(dev, "KBLT"));<br>+ acpigen_pop_len(); /* Else */<br>+ }<br>+ /* Return(Zero) */<br>+ acpigen_emit_byte(RETURN_OP);<br>+ acpigen_emit_byte(ZERO_OP);<br>+ acpigen_pop_len(); /* Method */<br>+}<br>+<br> /*<br> * Generates EC SSDT.<br> */<br>@@ -184,6 +255,7 @@<br> /* Used by thinkpad_acpi */<br> h8_dsdt_bluetooth(dev);<br> h8_dsdt_wwan(dev);<br>+ h8_dsdt_keyboard_backlight(dev);<br> <br> acpigen_pop_len(); /* Scope HKEY */<br> }<br></pre><p>To view, visit <a href="https://review.coreboot.org/21002">change 21002</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/21002"/><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: Ia65e770e772936c9c32be33c30839a2dee2a107c </div>
<div style="display:none"> Gerrit-Change-Number: 21002 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Patrick Rudolph <siro@das-labor.org> </div>