lenovo/wacom: Move to implicit length patching
Change-Id: Ica8a54ab215d09a2d2de93f316e3831ae4bfe5f5 Signed-off-by: Vladimir Serbinenko <phcoder@gmail.com> Reviewed-on: http://review.coreboot.org/7331 Reviewed-by: Edward O'Callaghan <eocallaghan@alterapraxis.com> Tested-by: build bot (Jenkins)
This commit is contained in:
parent
f7c75dbe07
commit
bcb3abe130
|
@ -93,84 +93,76 @@ void
|
||||||
drivers_lenovo_serial_ports_ssdt_generate(const char *scope,
|
drivers_lenovo_serial_ports_ssdt_generate(const char *scope,
|
||||||
int have_dock_serial)
|
int have_dock_serial)
|
||||||
{
|
{
|
||||||
int scopelen, devicelen, reslen, methodlen;
|
int reslen;
|
||||||
|
|
||||||
scopelen = acpigen_write_scope(scope);
|
acpigen_write_scope(scope);
|
||||||
|
|
||||||
if (drivers_lenovo_is_wacom_present()) {
|
if (drivers_lenovo_is_wacom_present()) {
|
||||||
/* Device op. */
|
/* Device op. */
|
||||||
scopelen += acpigen_emit_byte(0x5b);
|
acpigen_emit_byte(0x5b);
|
||||||
scopelen += acpigen_emit_byte(0x82);
|
acpigen_emit_byte(0x82);
|
||||||
devicelen = acpigen_write_len_f();
|
acpigen_write_len_f();
|
||||||
devicelen += acpigen_emit_namestring("DTR");
|
acpigen_emit_namestring("DTR");
|
||||||
|
|
||||||
devicelen += acpigen_write_name("_HID");
|
acpigen_write_name("_HID");
|
||||||
devicelen += acpigen_emit_eisaid("WACF004");
|
acpigen_emit_eisaid("WACF004");
|
||||||
|
|
||||||
devicelen += acpigen_write_name("_CRS");
|
acpigen_write_name("_CRS");
|
||||||
|
|
||||||
reslen = acpigen_write_resourcetemplate_header();
|
reslen = acpigen_write_resourcetemplate_header();
|
||||||
reslen += acpigen_write_io16(0x200, 0x200, 1, 8, 1);
|
reslen += acpigen_write_io16(0x200, 0x200, 1, 8, 1);
|
||||||
reslen += acpigen_write_irq((1 << 5));
|
reslen += acpigen_write_irq((1 << 5));
|
||||||
|
|
||||||
devicelen += reslen;
|
acpigen_write_resourcetemplate_footer(reslen);
|
||||||
devicelen += acpigen_write_resourcetemplate_footer(reslen);
|
|
||||||
|
|
||||||
/* method op */
|
/* method op */
|
||||||
devicelen += acpigen_emit_byte(0x14);
|
acpigen_emit_byte(0x14);
|
||||||
methodlen = acpigen_write_len_f();
|
acpigen_write_len_f();
|
||||||
methodlen += acpigen_emit_namestring("_STA");
|
acpigen_emit_namestring("_STA");
|
||||||
/* no fnarg */
|
/* no fnarg */
|
||||||
methodlen += acpigen_emit_byte(0x00);
|
acpigen_emit_byte(0x00);
|
||||||
/* return */
|
/* return */
|
||||||
methodlen += acpigen_emit_byte(0xa4);
|
acpigen_emit_byte(0xa4);
|
||||||
methodlen += acpigen_write_byte(0xf);
|
acpigen_write_byte(0xf);
|
||||||
|
acpigen_pop_len();
|
||||||
|
|
||||||
acpigen_patch_len(methodlen);
|
acpigen_pop_len();
|
||||||
devicelen += methodlen;
|
|
||||||
|
|
||||||
acpigen_patch_len(devicelen - 1);
|
|
||||||
scopelen += devicelen;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (have_dock_serial) {
|
if (have_dock_serial) {
|
||||||
/* Device op. */
|
/* Device op. */
|
||||||
scopelen += acpigen_emit_byte(0x5b);
|
acpigen_emit_byte(0x5b);
|
||||||
scopelen += acpigen_emit_byte(0x82);
|
acpigen_emit_byte(0x82);
|
||||||
devicelen = acpigen_write_len_f();
|
acpigen_write_len_f();
|
||||||
devicelen += acpigen_emit_namestring("COMA");
|
acpigen_emit_namestring("COMA");
|
||||||
|
|
||||||
devicelen += acpigen_write_name("_HID");
|
acpigen_write_name("_HID");
|
||||||
devicelen += acpigen_emit_eisaid("PNP0501");
|
acpigen_emit_eisaid("PNP0501");
|
||||||
devicelen += acpigen_write_name("_UID");
|
acpigen_write_name("_UID");
|
||||||
/* Byte */
|
/* Byte */
|
||||||
devicelen += acpigen_write_byte(0x2);
|
acpigen_write_byte(0x2);
|
||||||
|
|
||||||
devicelen += acpigen_write_name("_CRS");
|
acpigen_write_name("_CRS");
|
||||||
|
|
||||||
reslen = acpigen_write_resourcetemplate_header();
|
reslen = acpigen_write_resourcetemplate_header();
|
||||||
reslen += acpigen_write_io16(0x3f8, 0x3f8, 1, 8, 1);
|
reslen += acpigen_write_io16(0x3f8, 0x3f8, 1, 8, 1);
|
||||||
reslen += acpigen_write_irq(1 << 4);
|
reslen += acpigen_write_irq(1 << 4);
|
||||||
|
|
||||||
devicelen += reslen;
|
acpigen_write_resourcetemplate_footer(reslen);
|
||||||
devicelen += acpigen_write_resourcetemplate_footer(reslen);
|
|
||||||
|
|
||||||
/* method op */
|
/* method op */
|
||||||
devicelen += acpigen_emit_byte(0x14);
|
acpigen_emit_byte(0x14);
|
||||||
methodlen = acpigen_write_len_f();
|
acpigen_write_len_f();
|
||||||
methodlen += acpigen_emit_namestring("_STA");
|
acpigen_emit_namestring("_STA");
|
||||||
/* no fnarg */
|
/* no fnarg */
|
||||||
methodlen += acpigen_emit_byte(0x00);
|
acpigen_emit_byte(0x00);
|
||||||
/* return */
|
/* return */
|
||||||
methodlen += acpigen_emit_byte(0xa4);
|
acpigen_emit_byte(0xa4);
|
||||||
methodlen += acpigen_write_byte(0xf);
|
acpigen_write_byte(0xf);
|
||||||
acpigen_patch_len(methodlen);
|
acpigen_pop_len();
|
||||||
|
|
||||||
devicelen += methodlen;
|
acpigen_pop_len();
|
||||||
|
|
||||||
acpigen_patch_len(devicelen - 1);
|
|
||||||
scopelen += devicelen;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
acpigen_patch_len(scopelen - 1);
|
acpigen_pop_len();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue