From patchwork Fri Dec 11 03:21:24 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Zhao X-Patchwork-Id: 58251 Delivered-To: patch@linaro.org Received: by 10.112.147.194 with SMTP id tm2csp890408lbb; Thu, 10 Dec 2015 19:23:06 -0800 (PST) X-Received: by 10.55.42.233 with SMTP id q102mr557069qkq.99.1449804186098; Thu, 10 Dec 2015 19:23:06 -0800 (PST) Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id e8si18194363qga.128.2015.12.10.19.23.05 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 10 Dec 2015 19:23:06 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org Received: from localhost ([::1]:45610 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a7EIT-0008Ji-KU for patch@linaro.org; Thu, 10 Dec 2015 22:23:05 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37617) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a7EHq-0007bu-8a for qemu-devel@nongnu.org; Thu, 10 Dec 2015 22:22:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a7EHp-0008FG-Es for qemu-devel@nongnu.org; Thu, 10 Dec 2015 22:22:26 -0500 Received: from szxga02-in.huawei.com ([119.145.14.65]:9814) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a7EHj-0008DA-T8; Thu, 10 Dec 2015 22:22:20 -0500 Received: from 172.24.1.48 (EHLO szxeml427-hub.china.huawei.com) ([172.24.1.48]) by szxrg02-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id CXU92709; Fri, 11 Dec 2015 11:22:07 +0800 (CST) Received: from HGHY1Z002260041.china.huawei.com (10.177.16.142) by szxeml427-hub.china.huawei.com (10.82.67.182) with Microsoft SMTP Server id 14.3.235.1; Fri, 11 Dec 2015 11:21:53 +0800 From: Shannon Zhao To: , , , , Date: Fri, 11 Dec 2015 11:21:24 +0800 Message-ID: <1449804086-3464-9-git-send-email-zhaoshenglong@huawei.com> X-Mailer: git-send-email 1.9.0.msysgit.0 In-Reply-To: <1449804086-3464-1-git-send-email-zhaoshenglong@huawei.com> References: <1449804086-3464-1-git-send-email-zhaoshenglong@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.177.16.142] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020202.566A4160.012A, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0, ip=0.0.0.0, so=2013-06-18 04:22:30, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: db96e890b52b99f23ed965a01ce7c76c X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 119.145.14.65 Cc: peter.huangpeng@huawei.com, zhaoshenglong@huawei.com, qemu-devel@nongnu.org, graeme.gregory@linaro.org, shannon.zhao@linaro.org Subject: [Qemu-devel] [PATCH v5 08/10] ARM: ACPI: Add _E03 for Power Button X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org 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 Tested-by: Wei Huang --- hw/arm/virt-acpi-build.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) -- 2.0.4 diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c index e5dc2d5..1ffff62 100644 --- a/hw/arm/virt-acpi-build.c +++ b/hw/arm/virt-acpi-build.c @@ -339,6 +339,20 @@ static void acpi_dsdt_add_gpio(Aml *scope, const MemMapEntry *gpio_memmap, aml_append(crs, aml_interrupt(AML_CONSUMER, AML_LEVEL, AML_ACTIVE_HIGH, AML_EXCLUSIVE, &gpio_irq, 1)); aml_append(dev, aml_name_decl("_CRS", crs)); + + Aml *aei = aml_resource_template(); + /* Pin 3 for power button */ + const uint32_t pin_list[1] = {3}; + aml_append(aei, aml_gpio_int(AML_CONSUMER, AML_EDGE, AML_ACTIVE_HIGH, + AML_EXCLUSIVE, AML_PULL_UP, 0, pin_list, 1, + "GPO0", NULL, 0)); + aml_append(dev, aml_name_decl("_AEI", aei)); + + /* _E03 is handle for power button */ + Aml *method = aml_method("_E03", 0, AML_NOTSERIALIZED); + aml_append(method, aml_notify(aml_name(ACPI_POWER_BUTTON_DEVICE), + aml_int(0x80))); + aml_append(dev, method); aml_append(scope, dev); }