Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935857AbdGTOow (ORCPT ); Thu, 20 Jul 2017 10:44:52 -0400 Received: from foss.arm.com ([217.140.101.70]:55050 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754825AbdGTOnf (ORCPT ); Thu, 20 Jul 2017 10:43:35 -0400 From: Lorenzo Pieralisi To: linux-acpi@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Lorenzo Pieralisi , Robert Moore , Zhang Rui , "Rafael J. Wysocki" , Will Deacon , Robin Murphy , Hanjun Guo , Feng Kan , Jon Masters , Nate Watterson Subject: [PATCH 1/4] ACPI: Allow _DMA method in walk resources Date: Thu, 20 Jul 2017 15:45:13 +0100 Message-Id: <20170720144517.32529-2-lorenzo.pieralisi@arm.com> X-Mailer: git-send-email 2.10.0 In-Reply-To: <20170720144517.32529-1-lorenzo.pieralisi@arm.com> References: <20170720144517.32529-1-lorenzo.pieralisi@arm.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2334 Lines: 56 The _DMA object contains a resource template, this change adds support for the walk resources function so that ACPI devices containing a _DMA object can actually parse it to detect DMA ranges for the respective bus. Signed-off-by: Lorenzo Pieralisi Cc: Robert Moore Cc: Zhang Rui Cc: "Rafael J. Wysocki" --- drivers/acpi/acpica/rsxface.c | 7 ++++--- include/acpi/acnames.h | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/acpi/acpica/rsxface.c b/drivers/acpi/acpica/rsxface.c index 59a4f9e..be65e65 100644 --- a/drivers/acpi/acpica/rsxface.c +++ b/drivers/acpi/acpica/rsxface.c @@ -615,7 +615,7 @@ ACPI_EXPORT_SYMBOL(acpi_walk_resource_buffer) * device we are querying * name - Method name of the resources we want. * (METHOD_NAME__CRS, METHOD_NAME__PRS, or - * METHOD_NAME__AEI) + * METHOD_NAME__AEI or METHOD_NAME__DMA) * user_function - Called for each resource * context - Passed to user_function * @@ -641,11 +641,12 @@ acpi_walk_resources(acpi_handle device_handle, if (!device_handle || !user_function || !name || (!ACPI_COMPARE_NAME(name, METHOD_NAME__CRS) && !ACPI_COMPARE_NAME(name, METHOD_NAME__PRS) && - !ACPI_COMPARE_NAME(name, METHOD_NAME__AEI))) { + !ACPI_COMPARE_NAME(name, METHOD_NAME__AEI) && + !ACPI_COMPARE_NAME(name, METHOD_NAME__DMA))) { return_ACPI_STATUS(AE_BAD_PARAMETER); } - /* Get the _CRS/_PRS/_AEI resource list */ + /* Get the _CRS/_PRS/_AEI/_DMA resource list */ buffer.length = ACPI_ALLOCATE_LOCAL_BUFFER; status = acpi_rs_get_method_data(device_handle, name, &buffer); diff --git a/include/acpi/acnames.h b/include/acpi/acnames.h index b421584..d8dd3bf 100644 --- a/include/acpi/acnames.h +++ b/include/acpi/acnames.h @@ -54,6 +54,7 @@ #define METHOD_NAME__CLS "_CLS" #define METHOD_NAME__CRS "_CRS" #define METHOD_NAME__DDN "_DDN" +#define METHOD_NAME__DMA "_DMA" #define METHOD_NAME__HID "_HID" #define METHOD_NAME__INI "_INI" #define METHOD_NAME__PLD "_PLD" -- 2.10.0