[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v3 5/8] hw/acpi/aml-build: Add a wrapper for GPIO In
From: |
shannon . zhao |
Subject: |
[Qemu-devel] [PATCH v3 5/8] hw/acpi/aml-build: Add a wrapper for GPIO Interrupt Connection |
Date: |
Mon, 16 Nov 2015 21:23:06 +0800 |
From: Shannon Zhao <address@hidden>
Signed-off-by: Shannon Zhao <address@hidden>
Signed-off-by: Shannon Zhao <address@hidden>
Tested-by: Wei Huang <address@hidden>
---
hw/acpi/aml-build.c | 18 ++++++++++++++++++
include/hw/acpi/aml-build.h | 6 ++++++
2 files changed, 24 insertions(+)
diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c
index 60d4703..8e18b22 100644
--- a/hw/acpi/aml-build.c
+++ b/hw/acpi/aml-build.c
@@ -626,6 +626,24 @@ static Aml *aml_gpio_connection(AmlGpioConnectionType type,
}
/*
+ * ACPI 5.0: 19.5.53
+ * GpioInt(GPIO Interrupt Connection Resource Descriptor Macro)
+ */
+Aml *aml_gpio_int(AmlConsumerAndProducer con_and_pro,
+ AmlLevelAndEdge level_and_edge,
+ AmlActiveHighAndLow high_and_low, AmlShared shared,
+ AmlPinConfig pin_cfg, int16_t debounce_timeout,
+ int32_t pin_num[], int32_t pin_count, const char *name,
+ const char *vendor_data)
+{
+ uint8_t flags = level_and_edge | (high_and_low << 1) | (shared << 3);
+
+ return aml_gpio_connection(AML_INTERRUPT_CONNECTION, con_and_pro, flags,
+ pin_cfg, 0, debounce_timeout, pin_num,
pin_count,
+ name, vendor_data);
+}
+
+/*
* ACPI 1.0b: 6.4.3.4 32-Bit Fixed Location Memory Range Descriptor
* (Type 1, Large Item Name 0x6)
*/
diff --git a/include/hw/acpi/aml-build.h b/include/hw/acpi/aml-build.h
index 4e88882..bce813b 100644
--- a/include/hw/acpi/aml-build.h
+++ b/include/hw/acpi/aml-build.h
@@ -232,6 +232,12 @@ Aml *aml_call1(const char *method, Aml *arg1);
Aml *aml_call2(const char *method, Aml *arg1, Aml *arg2);
Aml *aml_call3(const char *method, Aml *arg1, Aml *arg2, Aml *arg3);
Aml *aml_call4(const char *method, Aml *arg1, Aml *arg2, Aml *arg3, Aml *arg4);
+Aml *aml_gpio_int(AmlConsumerAndProducer con_and_pro,
+ AmlLevelAndEdge level_and_edge,
+ AmlActiveHighAndLow high_and_low, AmlShared shared,
+ AmlPinConfig pin_cfg, int16_t debounce_timeout,
+ int32_t pin_num[], int32_t pin_count, const char *name,
+ const char *vendor_data);
Aml *aml_memory32_fixed(uint32_t addr, uint32_t size,
AmlReadAndWrite read_and_write);
Aml *aml_interrupt(AmlConsumerAndProducer con_and_pro,
--
2.1.0
- [Qemu-devel] [PATCH v3 0/8] Add system_powerdown support on ARM for ACPI and DT, shannon . zhao, 2015/11/16
- [Qemu-devel] [PATCH v3 8/8] hw/arm/virt: Add gpio-keys node for Poweroff using DT, shannon . zhao, 2015/11/16
- [Qemu-devel] [PATCH v3 3/8] hw/arm/virt-acpi-build: Add power button device in ACPI DSDT table, shannon . zhao, 2015/11/16
- [Qemu-devel] [PATCH v3 4/8] hw/acpi/aml-build: Add GPIO Connection Descriptor, shannon . zhao, 2015/11/16
- [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
- [Qemu-devel] [PATCH v3 2/8] hw/arm/virt-acpi-build: Add GPIO controller in ACPI DSDT table, shannon . zhao, 2015/11/16
- [Qemu-devel] [PATCH v3 5/8] hw/acpi/aml-build: Add a wrapper for GPIO Interrupt Connection,
shannon . zhao <=
- [Qemu-devel] [PATCH v3 1/8] hw/arm/virt: Add a GPIO controller, shannon . zhao, 2015/11/16
- [Qemu-devel] [PATCH v3 6/8] hw/arm/virt-acpi-build: Add _E03 for Power Button, shannon . zhao, 2015/11/16
- Re: [Qemu-devel] [PATCH v3 0/8] Add system_powerdown support on ARM for ACPI and DT, Shannon Zhao, 2015/11/16