From patchwork Thu Jun 11 19:45:09 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Al Stone X-Patchwork-Id: 49769 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f199.google.com (mail-lb0-f199.google.com [209.85.217.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 19F3024616 for ; Thu, 11 Jun 2015 19:45:30 +0000 (UTC) Received: by lbcak1 with SMTP id ak1sf4374987lbc.2 for ; Thu, 11 Jun 2015 12:45:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=P9wGaRAqyKqmaTZHRCgUV3rNH1bz5p78VDCuim2Q0uk=; b=PHWAKT7LFL/JJ6pmpNCLLJVS1vc96XHGkXy7xCg1ID8VjGIlQpguCJKH0qMvnsUF6h hPlWFi00OozW3NC0Sd++HXuHmzuYCFMuGx2/n7MzlfmZTovgsEJAxeMFSnF9Y9GoUVP9 jr4l8m0OzgnOyP0B1E5QV1eXGVYzZkX130h5qQfJ0nR3y/n661hjEqxSMtBuu8BMS4Xu nnG63ef/fxRjOiICEXJNJVrLX1EUF/RQDcrJOZolBXQaEaITgEyiXHvMCtY3pFQC2nPB mNUstfNbUZDuC7spmdTOnsXbnKPNwXsRH/mfUTIgzWxsJQbiLiJ9nt0NguUsmbdJjc5Y I4Aw== X-Gm-Message-State: ALoCoQlyWfnnjMXf0MW35VNjwj8l7LgrHMXx2W7ujs5pwxLd6f3aa+RxKT6s6uVR0+AJtYSIBFfd X-Received: by 10.180.37.198 with SMTP id a6mr10898152wik.7.1434051929051; Thu, 11 Jun 2015 12:45:29 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.245.43 with SMTP id xl11ls481975lac.21.gmail; Thu, 11 Jun 2015 12:45:28 -0700 (PDT) X-Received: by 10.152.42.230 with SMTP id r6mr11520275lal.30.1434051928884; Thu, 11 Jun 2015 12:45:28 -0700 (PDT) Received: from mail-lb0-f178.google.com (mail-lb0-f178.google.com. [209.85.217.178]) by mx.google.com with ESMTPS id th3si1451042lbb.146.2015.06.11.12.45.28 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 11 Jun 2015 12:45:28 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.178 as permitted sender) client-ip=209.85.217.178; Received: by lbcmx3 with SMTP id mx3so8653522lbc.1 for ; Thu, 11 Jun 2015 12:45:28 -0700 (PDT) X-Received: by 10.112.131.98 with SMTP id ol2mr11931250lbb.56.1434051928770; Thu, 11 Jun 2015 12:45:28 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.112.108.230 with SMTP id hn6csp49789lbb; Thu, 11 Jun 2015 12:45:27 -0700 (PDT) X-Received: by 10.107.9.228 with SMTP id 97mr2685675ioj.26.1434051927361; Thu, 11 Jun 2015 12:45:27 -0700 (PDT) Received: from mail-ig0-f178.google.com (mail-ig0-f178.google.com. [209.85.213.178]) by mx.google.com with ESMTPS id k6si1520407ige.37.2015.06.11.12.45.26 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 11 Jun 2015 12:45:27 -0700 (PDT) Received-SPF: pass (google.com: domain of al.stone@linaro.org designates 209.85.213.178 as permitted sender) client-ip=209.85.213.178; Received: by igbpi8 with SMTP id pi8so60224729igb.0 for ; Thu, 11 Jun 2015 12:45:26 -0700 (PDT) X-Received: by 10.107.169.157 with SMTP id f29mr13547471ioj.74.1434051926573; Thu, 11 Jun 2015 12:45:26 -0700 (PDT) Received: from fidelio.ahs3.com (c-50-134-239-249.hsd1.co.comcast.net. [50.134.239.249]) by mx.google.com with ESMTPSA id z195sm1009685iod.33.2015.06.11.12.45.24 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 11 Jun 2015 12:45:25 -0700 (PDT) From: al.stone@linaro.org To: linux-acpi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: linaro-acpi@lists.linaro.org, patches@linaro.org, linaro-kernel@lists.linaro.org Subject: [PATCH 1/3] ACPI: introduce macros for using the ACPI specification version Date: Thu, 11 Jun 2015 13:45:09 -0600 Message-Id: <1434051911-14665-2-git-send-email-al.stone@linaro.org> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1434051911-14665-1-git-send-email-al.stone@linaro.org> References: <1434051911-14665-1-git-send-email-al.stone@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: al.stone@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.178 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Al Stone Add the ACPI_SPEC_VERSION() macro to build a proper version number from a major and minor revision number. Add also the ACPI_FADT_SPEC_VERSION that constructs a proper version number from the entries in the current FADT. These macros are added in order to simplify retrieving and comparing ACPI specification version numbers, since this is becoming a more frequent need. In particular, there are some architectures that require at least a certain version of the spec, and there are differences in some structure sizes that have changed with recent versions but can only be tracked by spec version number. Signed-off-by: Al Stone Reviewed-by: Hanjun Guo Reviewed-by: Graeme Gregory CC: Rafael J. Wysocki CC: Len Brown --- include/linux/acpi.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/linux/acpi.h b/include/linux/acpi.h index a4acb55..33ed313 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h @@ -48,6 +48,11 @@ #include #include +#define ACPI_SPEC_VERSION(major, minor) ((major<<8)|minor) +#define ACPI_FADT_SPEC_VERSION \ + ACPI_SPEC_VERSION(acpi_gbl_FADT.header.revision, \ + acpi_gbl_FADT.minor_revision) + static inline acpi_handle acpi_device_handle(struct acpi_device *adev) { return adev ? adev->handle : NULL;