From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51354) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a9EMT-0003oV-3F for qemu-devel@nongnu.org; Wed, 16 Dec 2015 10:51:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a9EMS-0006oP-0u for qemu-devel@nongnu.org; Wed, 16 Dec 2015 10:51:29 -0500 Date: Wed, 16 Dec 2015 16:51:15 +0100 From: Igor Mammedov Message-ID: <20151216165115.09fa7939@igors-macbook-pro.local> In-Reply-To: <1449804086-3464-9-git-send-email-zhaoshenglong@huawei.com> References: <1449804086-3464-1-git-send-email-zhaoshenglong@huawei.com> <1449804086-3464-9-git-send-email-zhaoshenglong@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v5 08/10] ARM: ACPI: Add _E03 for Power Button List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Shannon Zhao Cc: wei@redhat.com, peter.maydell@linaro.org, graeme.gregory@linaro.org, mst@redhat.com, qemu-devel@nongnu.org, peter.huangpeng@huawei.com, qemu-arm@nongnu.org, shannon.zhao@linaro.org On Fri, 11 Dec 2015 11:21:24 +0800 Shannon Zhao wrote: > 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(+) > > 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}; Sorry, just noticed, do we allow declarations in the middle of the block? The same applies to 'Aml *method' below. > + 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); > } >