From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54248) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ys1kW-0005l6-7T for qemu-devel@nongnu.org; Tue, 12 May 2015 00:25:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ys1kS-0006wH-8E for qemu-devel@nongnu.org; Tue, 12 May 2015 00:24:56 -0400 Received: from mail-pd0-f170.google.com ([209.85.192.170]:32870) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ys1kS-0006wB-2t for qemu-devel@nongnu.org; Tue, 12 May 2015 00:24:52 -0400 Received: by pdbnk13 with SMTP id nk13so167017449pdb.0 for ; Mon, 11 May 2015 21:24:51 -0700 (PDT) From: shannon.zhao@linaro.org Date: Tue, 12 May 2015 12:24:14 +0800 Message-Id: <1431404656-7180-6-git-send-email-shannon.zhao@linaro.org> In-Reply-To: <1431404656-7180-1-git-send-email-shannon.zhao@linaro.org> References: <1431404656-7180-1-git-send-email-shannon.zhao@linaro.org> Subject: [Qemu-devel] [PATCH 5/7] hw/arm/virt-acpi-build: Add _E03 for Power Button List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, peter.maydell@linaro.org, imammedo@redhat.com, mst@redhat.com, pbonzini@redhat.com, wei@redhat.com, arnd@arndb.de, christoffer.dall@linaro.org Cc: hangaohuai@huawei.com, peter.huangpeng@huawei.com, zhaoshenglong@huawei.com From: Shannon Zhao Here GPIO pin 3 is used for Power Button, add _E03 in ACPI DSDT table. Signed-off-by: Shannon Zhao Signed-off-by: Shannon Zhao --- hw/arm/virt-acpi-build.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c index b582047..1fcdd74 100644 --- a/hw/arm/virt-acpi-build.c +++ b/hw/arm/virt-acpi-build.c @@ -316,6 +316,17 @@ static void acpi_dsdt_add_gpio(Aml *scope, const MemMapEntry *gpio_memmap, aml_interrupt(aml_consumer, aml_edge, aml_active_high, aml_exclusive, aml_not_wake_capable, gpio_irq + 32)); aml_append(dev, aml_name_decl("_CRS", crs)); + + Aml *aei = aml_resource_template(); + /* Pin 3 for power button */ + aml_append(aei, aml_gpio_int(aml_edge, aml_active_high, aml_exclusive, + aml_wake_capable, aml_pull_up, 3, "GPO0")); + aml_append(dev, aml_name_decl("_AEI", aei)); + + /* _E03 is handle for power button */ + Aml *method = aml_method("_E03", 0); + aml_append(method, aml_notify(aml_name("PWRB"), aml_int(0x80))); + aml_append(dev, method); aml_append(scope, dev); } -- 2.1.0