From patchwork Thu Dec 17 11:50:07 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 58571 Delivered-To: patch@linaro.org Received: by 10.112.89.199 with SMTP id bq7csp314326lbb; Thu, 17 Dec 2015 03:56:24 -0800 (PST) X-Received: by 10.140.43.9 with SMTP id d9mr66174136qga.51.1450353384068; Thu, 17 Dec 2015 03:56:24 -0800 (PST) Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id o23si8929409qkl.17.2015.12.17.03.56.23 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 17 Dec 2015 03:56:24 -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]:52443 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a9XAV-0005qo-FV for patch@linaro.org; Thu, 17 Dec 2015 06:56:23 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58629) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a9X4x-0005mN-SB for qemu-devel@nongnu.org; Thu, 17 Dec 2015 06:50:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a9X4t-0002Jw-2i for qemu-devel@nongnu.org; Thu, 17 Dec 2015 06:50:39 -0500 Received: from mnementh.archaic.org.uk ([2001:8b0:1d0::1]:59156) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a9X4s-0002FS-QN for qemu-devel@nongnu.org; Thu, 17 Dec 2015 06:50:34 -0500 Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.80) (envelope-from ) id 1a9X4f-0003Q9-EF for qemu-devel@nongnu.org; Thu, 17 Dec 2015 11:50:21 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Date: Thu, 17 Dec 2015 11:50:07 +0000 Message-Id: <1450353020-13076-13-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1450353020-13076-1-git-send-email-peter.maydell@linaro.org> References: <1450353020-13076-1-git-send-email-peter.maydell@linaro.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 2001:8b0:1d0::1 Subject: [Qemu-devel] [PULL 12/25] ACPI: Add aml_gpio_int() wrapper for GPIO Interrupt Connection 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 Signed-off-by: Shannon Zhao Signed-off-by: Shannon Zhao Tested-by: Wei Huang Reviewed-by: Igor Mammedov Message-id: 1449804086-3464-8-git-send-email-zhaoshenglong@huawei.com Signed-off-by: Peter Maydell --- hw/acpi/aml-build.c | 20 ++++++++++++++++++++ include/hw/acpi/aml-build.h | 7 +++++++ 2 files changed, 27 insertions(+) -- 1.9.1 diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c index d8c33a2..302cf01 100644 --- a/hw/acpi/aml-build.c +++ b/hw/acpi/aml-build.c @@ -633,6 +633,26 @@ 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 edge_level, + AmlActiveHighAndLow active_level, AmlShared shared, + AmlPinConfig pin_config, uint16_t debounce_timeout, + const uint32_t pin_list[], uint32_t pin_count, + const char *resource_source_name, + const uint8_t *vendor_data, uint16_t vendor_data_len) +{ + uint8_t flags = edge_level | (active_level << 1) | (shared << 3); + + return aml_gpio_connection(AML_INTERRUPT_CONNECTION, con_and_pro, flags, + pin_config, 0, debounce_timeout, pin_list, + pin_count, resource_source_name, vendor_data, + vendor_data_len); +} + +/* * 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 f1817e4..0d36453 100644 --- a/include/hw/acpi/aml-build.h +++ b/include/hw/acpi/aml-build.h @@ -238,6 +238,13 @@ 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 edge_level, + AmlActiveHighAndLow active_level, AmlShared shared, + AmlPinConfig pin_config, uint16_t debounce_timeout, + const uint32_t pin_list[], uint32_t pin_count, + const char *resource_source_name, + const uint8_t *vendor_data, uint16_t vendor_data_len); Aml *aml_memory32_fixed(uint32_t addr, uint32_t size, AmlReadAndWrite read_and_write); Aml *aml_interrupt(AmlConsumerAndProducer con_and_pro,