qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Igor Mammedov <imammedo@redhat.com>
To: Shannon Zhao <zhaoshenglong@huawei.com>
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
Subject: Re: [Qemu-devel] [PATCH v5 08/10] ARM: ACPI: Add _E03 for Power Button
Date: Wed, 16 Dec 2015 16:51:15 +0100	[thread overview]
Message-ID: <20151216165115.09fa7939@igors-macbook-pro.local> (raw)
In-Reply-To: <1449804086-3464-9-git-send-email-zhaoshenglong@huawei.com>

On Fri, 11 Dec 2015 11:21:24 +0800
Shannon Zhao <zhaoshenglong@huawei.com> wrote:

> From: Shannon Zhao <shannon.zhao@linaro.org>
> 
> Here GPIO pin 3 is used for Power Button, add _E03 in ACPI DSDT table.
> 
> Signed-off-by: Shannon Zhao <zhaoshenglong@huawei.com>
> Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>
> Tested-by: Wei Huang <wei@redhat.com>
> ---
>  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);
>  }
>  

  reply	other threads:[~2015-12-16 15:51 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-11  3:21 [Qemu-devel] [PATCH v5 00/10] Add system_powerdown support on ARM for ACPI and DT Shannon Zhao
2015-12-11  3:21 ` [Qemu-devel] [PATCH v5 01/10] acpi: support serialized method Shannon Zhao
2015-12-15 16:54   ` Peter Maydell
2015-12-15 16:58     ` Shannon Zhao
2015-12-11  3:21 ` [Qemu-devel] [PATCH v5 02/10] acpi: extend aml_interrupt() to support multiple irqs Shannon Zhao
2015-12-15 16:55   ` Peter Maydell
2015-12-15 16:59     ` Shannon Zhao
2015-12-11  3:21 ` [Qemu-devel] [PATCH v5 03/10] ARM: Virt: Add a GPIO controller Shannon Zhao
2015-12-11  3:21 ` [Qemu-devel] [PATCH v5 04/10] ARM: ACPI: Add GPIO controller in ACPI DSDT table Shannon Zhao
2015-12-16 15:48   ` Igor Mammedov
2015-12-11  3:21 ` [Qemu-devel] [PATCH v5 05/10] ARM: ACPI: Add power button device " Shannon Zhao
2015-12-11  3:21 ` [Qemu-devel] [PATCH v5 06/10] ACPI: Add GPIO Connection Descriptor Shannon Zhao
2015-12-11  3:21 ` [Qemu-devel] [PATCH v5 07/10] ACPI: Add aml_gpio_int() wrapper for GPIO Interrupt Connection Shannon Zhao
2015-12-11  3:21 ` [Qemu-devel] [PATCH v5 08/10] ARM: ACPI: Add _E03 for Power Button Shannon Zhao
2015-12-16 15:51   ` Igor Mammedov [this message]
2015-12-16 16:07     ` Peter Maydell
2015-12-11  3:21 ` [Qemu-devel] [PATCH v5 09/10] ARM: Virt: Add QEMU powerdown notifier and hook it to GPIO Pin 3 Shannon Zhao
2015-12-11  3:21 ` [Qemu-devel] [PATCH v5 10/10] ARM: Virt: Add gpio-keys node for Poweroff using DT Shannon Zhao
2015-12-17 13:39   ` Peter Maydell
2015-12-17 13:43     ` Shannon Zhao
2015-12-15 18:36 ` [Qemu-devel] [PATCH v5 00/10] Add system_powerdown support on ARM for ACPI and DT Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20151216165115.09fa7939@igors-macbook-pro.local \
    --to=imammedo@redhat.com \
    --cc=graeme.gregory@linaro.org \
    --cc=mst@redhat.com \
    --cc=peter.huangpeng@huawei.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=shannon.zhao@linaro.org \
    --cc=wei@redhat.com \
    --cc=zhaoshenglong@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).