From patchwork Thu Oct 29 14:27:32 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Zhao X-Patchwork-Id: 55786 Delivered-To: patch@linaro.org Received: by 10.202.175.130 with SMTP id y124csp457191oie; Thu, 29 Oct 2015 07:34:08 -0700 (PDT) X-Received: by 10.55.198.23 with SMTP id b23mr2636199qkj.92.1446129248182; Thu, 29 Oct 2015 07:34:08 -0700 (PDT) Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id t89si1464999qkl.35.2015.10.29.07.34.08 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 29 Oct 2015 07:34:08 -0700 (PDT) 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; dkim=fail header.i=@linaro_org.20150623.gappssmtp.com Received: from localhost ([::1]:44426 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZroHH-0006ZI-Qj for patch@linaro.org; Thu, 29 Oct 2015 10:34:07 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56325) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZroCX-0008So-R4 for qemu-devel@nongnu.org; Thu, 29 Oct 2015 10:29:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZroCW-0000L3-QT for qemu-devel@nongnu.org; Thu, 29 Oct 2015 10:29:13 -0400 Received: from mail-pa0-x231.google.com ([2607:f8b0:400e:c03::231]:33551) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZroCW-0000Ky-LR for qemu-devel@nongnu.org; Thu, 29 Oct 2015 10:29:12 -0400 Received: by padhy1 with SMTP id hy1so36664690pad.0 for ; Thu, 29 Oct 2015 07:29:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro_org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=9iiqgV26q9lE5YzrOKuOyGzthfR02uZ5VCJQB+mx/ZU=; b=j/W4APNSZ0+Hd42RxsvE2GwC8qTluand8aRpn/0RLKPiAcdPmIRPwvJdqcULNrSCO5 msYRJMrnNQMZtlzKhitKgP4k+GTP5BnN+AYDpsrlp2z4KbSGA3dmwBwv9TxReMaDgsC7 vmagg0mYISESbbhJ9iYMqBOKFcqbTjPKFiVa8mhQvEc9FkDUBuVa08Is1yPeioopH3PL 79AYjLIjxB4ul3DtnF43OdMx0ft/gagUgh9kBJ8HB0N03o+d7TMxkoKwo6DCtygouJVi mkpV9tKNRWcvGOAvbwvJ5QB0MvUPCrkviW5CnQTnHpQ4ic+afgESsQ1T0a/z5kzQXp+3 bRWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=9iiqgV26q9lE5YzrOKuOyGzthfR02uZ5VCJQB+mx/ZU=; b=NAZvfFtH6nl+Sfe82CMBbIkQTHFPQBBMTipz4IURbWm9/qebBlDJEH71A/+p8VZNpp FbamlXiO2gW8eCReIEmm0se+Gv7jSDD0Rh8pQlO2vg6QLMo8SnocdN268UZYQFHrBQga ozB6c87UdG3X6+YlVoG308p8jvwIkcTz62+2JU7dqjNPaa+F6D7+N02c8kuHAPgLAnH9 pi/GY4QhNiTfZwuGnZD3yYQxfio1kTaOlkx79eukiI0fcSqHB56rmU1vGVO3+BQnGQuT HI5Uu5Iq7X6vn9RqF29jfPRCRsq+0aEXGInm/lF7QXtwPggOyBR1vxwjxJBrePHaMB3q n54g== X-Gm-Message-State: ALoCoQkxWChHYS7gHNgvfpviI3uNzVtwPk7oaHRWz6RBrJUm8Ig03me/gJVUwC6aU/ms5zN+JKcM X-Received: by 10.66.66.166 with SMTP id g6mr2205447pat.152.1446128952265; Thu, 29 Oct 2015 07:29:12 -0700 (PDT) Received: from localhost.localdomain ([180.150.157.4]) by smtp.gmail.com with ESMTPSA id a5sm1805986pbu.55.2015.10.29.07.29.07 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 29 Oct 2015 07:29:11 -0700 (PDT) From: Shannon Zhao To: qemu-devel@nongnu.org, peter.maydell@linaro.org, mst@redhat.com, imammedo@redhat.com Date: Thu, 29 Oct 2015 22:27:32 +0800 Message-Id: <1446128855-26637-6-git-send-email-shannon.zhao@linaro.org> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1446128855-26637-1-git-send-email-shannon.zhao@linaro.org> References: <1446128855-26637-1-git-send-email-shannon.zhao@linaro.org> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:400e:c03::231 Cc: zhaoshenglong@huawei.com, peter.huangpeng@huawei.com, shannon.zhao@linaro.org Subject: [Qemu-devel] [PATCH v2 5/8] hw/acpi/aml-build: Add a 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 Signed-off-by: Shannon Zhao Signed-off-by: Shannon Zhao --- hw/acpi/aml-build.c | 18 ++++++++++++++++++ include/hw/acpi/aml-build.h | 6 ++++++ 2 files changed, 24 insertions(+) -- 2.1.0 diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c index 250941f..895f82d 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,