qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Igor Mammedov <imammedo@redhat.com>
To: shannon.zhao@linaro.org
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,
	zhaoshenglong@huawei.com
Subject: Re: [Qemu-devel] [PATCH v3 6/8] hw/arm/virt-acpi-build: Add _E03 for Power Button
Date: Fri, 4 Dec 2015 15:10:04 +0100	[thread overview]
Message-ID: <20151204151004.7be15b36@nial.brq.redhat.com> (raw)
In-Reply-To: <1447680189-2128-7-git-send-email-shannon.zhao@linaro.org>

On Mon, 16 Nov 2015 21:23:07 +0800
shannon.zhao@linaro.org 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 | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
> 
> diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c
> index b25c90b..12c9e8b 100644
> --- a/hw/arm/virt-acpi-build.c
> +++ b/hw/arm/virt-acpi-build.c
> @@ -337,6 +337,19 @@ 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));
>      aml_append(dev, aml_name_decl("_CRS", crs));
> +
> +    Aml *aei = aml_resource_template();
> +    /* Pin 3 for power button */
> +    int32_t pin_num[1] = {3};
> +    aml_append(aei, aml_gpio_int(AML_CONSUMER_PRODUCER, AML_EDGE,
> +                                 AML_ACTIVE_HIGH, AML_EXCLUSIVE, AML_PULL_UP, 0,
> +                                 pin_num, 1, "GPO0", NULL));
> +    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)));
you use "PWRB" here the second time, perhaps it would be better to use macro
#define ACPI_POWER_BUTTON_DEVICE "PWRB"

> +    aml_append(dev, method);
>      aml_append(scope, dev);
>  }
>  

  reply	other threads:[~2015-12-04 14:10 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-16 13:23 [Qemu-devel] [PATCH v3 0/8] Add system_powerdown support on ARM for ACPI and DT shannon.zhao
2015-11-16 13:23 ` [Qemu-devel] [PATCH v3 1/8] hw/arm/virt: Add a GPIO controller shannon.zhao
2015-12-01 13:21   ` Igor Mammedov
2015-12-01 13:49     ` Peter Maydell
2015-12-01 14:48       ` Pavel Fedin
2015-12-01 15:25         ` Shannon Zhao
2015-12-01 15:29         ` Wei Huang
2015-12-02  9:39           ` [Qemu-devel] [Qemu-arm] " Pavel Fedin
2015-11-16 13:23 ` [Qemu-devel] [PATCH v3 2/8] hw/arm/virt-acpi-build: Add GPIO controller in ACPI DSDT table shannon.zhao
2015-11-16 13:23 ` [Qemu-devel] [PATCH v3 3/8] hw/arm/virt-acpi-build: Add power button device " shannon.zhao
2015-12-01 11:41   ` Igor Mammedov
2015-12-01 12:43     ` Shannon Zhao
2015-12-01 13:05       ` Igor Mammedov
2015-12-01 13:12         ` Shannon Zhao
2015-11-16 13:23 ` [Qemu-devel] [PATCH v3 4/8] hw/acpi/aml-build: Add GPIO Connection Descriptor shannon.zhao
2015-12-03 15:15   ` Igor Mammedov
2015-11-16 13:23 ` [Qemu-devel] [PATCH v3 5/8] hw/acpi/aml-build: Add a wrapper for GPIO Interrupt Connection shannon.zhao
2015-12-03 15:34   ` Igor Mammedov
2015-12-03 15:37   ` Igor Mammedov
2015-11-16 13:23 ` [Qemu-devel] [PATCH v3 6/8] hw/arm/virt-acpi-build: Add _E03 for Power Button shannon.zhao
2015-12-04 14:10   ` Igor Mammedov [this message]
2015-12-07  7:10     ` Shannon Zhao
2015-11-16 13:23 ` [Qemu-devel] [PATCH v3 7/8] hw/arm/virt: Add QEMU powerdown notifier and hook it to GPIO Pin 3 shannon.zhao
2015-11-16 13:23 ` [Qemu-devel] [PATCH v3 8/8] hw/arm/virt: Add gpio-keys node for Poweroff using DT shannon.zhao
2015-11-27 17:16   ` Peter Maydell
2015-11-28  3:06     ` Shannon Zhao
2015-11-17  1:37 ` [Qemu-devel] [PATCH v3 0/8] Add system_powerdown support on ARM for ACPI and DT Shannon Zhao
2015-12-01 13:43 ` Igor Mammedov

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=20151204151004.7be15b36@nial.brq.redhat.com \
    --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).