From patchwork Wed Feb 10 15:38:46 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 61677 Delivered-To: patch@linaro.org Received: by 10.112.43.199 with SMTP id y7csp2715540lbl; Wed, 10 Feb 2016 07:38:55 -0800 (PST) X-Received: by 10.66.119.71 with SMTP id ks7mr59981578pab.151.1455118735732; Wed, 10 Feb 2016 07:38:55 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 4si5745610pfn.180.2016.02.10.07.38.54; Wed, 10 Feb 2016 07:38:55 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dkim=pass header.i=@linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752159AbcBJPiw (ORCPT + 30 others); Wed, 10 Feb 2016 10:38:52 -0500 Received: from mail-wm0-f52.google.com ([74.125.82.52]:33711 "EHLO mail-wm0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751060AbcBJPiv (ORCPT ); Wed, 10 Feb 2016 10:38:51 -0500 Received: by mail-wm0-f52.google.com with SMTP id g62so32242700wme.0 for ; Wed, 10 Feb 2016 07:38:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=04q81vHSChAyjMIiw0gl4mhHauqm0itGpPGFKlSg86U=; b=CyMiJKRfky+i9Yp3uC5vw2Ln6EGZt/Y4cbFa7zTULuABqNjdQAme50QBdPZm0gCI4h KxaVFCj54FLenQBbcD64qTNjyOVN+OdAs6n8nQRyLQ/bOgYUdCzWMg6wQKJU/iAoOwGC ElGSnvyTJQvzzrM4CtULOzlqx+nVhJEehfYxk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; bh=04q81vHSChAyjMIiw0gl4mhHauqm0itGpPGFKlSg86U=; b=IFXA0LbwwK/EDrXGXyP0CrInKwI8VLhVbQj+0COdxGhbBmNxtRC4U+0c5jiirM6cN7 kL6ZmpUCSDutWE355O2TdiJrBMJbJSHWXjpSNWk8l/bCdXukd3IJ6Y91QwTUZuKTi7wj l8njpmwNV/5UlkaZ4XSHUp4heZsp74+tNEm/sl8AmJAEbdziTr7sXvD45lO9jcef2ROY Ft1TQzg11sN975/nRyLRHeDUPaDH2P5OhDmOxY7XSNl7tiyZkYD+1ow41QUlb51mGdEU HUowLmqxpR5rCIEtExzO2o4e5PkOebtPlbAVCilN2Y3q7dgtLFPjwcT1psgC8adu6gfz BOzw== X-Gm-Message-State: AG10YORd+hwJYGvZQF7ZjAIxHr3gDfnFDtqqqTB9oECTeDjmvVjya+OLUkyDENY9HaLgFDNY X-Received: by 10.28.148.130 with SMTP id w124mr12051577wmd.71.1455118729927; Wed, 10 Feb 2016 07:38:49 -0800 (PST) Received: from x1 (host81-129-170-149.range81-129.btcentralplus.com. [81.129.170.149]) by smtp.gmail.com with ESMTPSA id av3sm3458365wjc.44.2016.02.10.07.38.48 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 10 Feb 2016 07:38:49 -0800 (PST) Date: Wed, 10 Feb 2016 15:38:46 +0000 From: Lee Jones To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: ldewangan@nvidia.com, Linus Walleij Subject: [PATCH v2] mfd: Provide MACRO to declare commonly defined MFD cell attributes Message-ID: <20160210153846.GB26950@x1> References: <1455028027-1527-1-git-send-email-lee.jones@linaro.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1455028027-1527-1-git-send-email-lee.jones@linaro.org> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org mfd: Provide MACRO to declare commonly defined MFD cell attributes Cc: Laxman Dewangan Signed-off-by: Lee Jones --- include/linux/mfd/core.h | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/include/linux/mfd/core.h b/include/linux/mfd/core.h index bc6f7e0..1a5a87f 100644 --- a/include/linux/mfd/core.h +++ b/include/linux/mfd/core.h @@ -16,6 +16,32 @@ #include +#define MFD_ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0])) + +#define MFD_CELL_ALL(_name, _res, _pdata, _id, _compat, _match) \ + { \ + .name = (_name), \ + .resources = (_res), \ + .num_resources = MFD_ARRAY_SIZE((_res)), \ + .platform_data = (_pdata), \ + .pdata_size = MFD_ARRAY_SIZE((_pdata)), \ + .of_compatible = (_compat), \ + .acpi_match = (_match), \ + .id = _id, \ + } + +#define OF_MFD_CELL(_name, _res, _pdata, _id, _compat) \ + MFD_CELL_ALL(_name, _res, _pdata, _id, _compat, NULL) \ + +#define ACPI_MFD_CELL(_name, _res, _pdata, _id, _match) \ + MFD_CELL_ALL(_name, _res, _pdata, _id, NULL, _match) \ + +#define MFD_CELL_BASIC(_name, _res, _pdata, _id) \ + MFD_CELL_ALL(_name, _res, _pdata, _id, NULL, NULL) \ + +#define MFD_CELL_NAME(_name) \ + MFD_CELL_ALL(_name, NULL, NULL, 0, NULL, NULL) \ + struct irq_domain; struct property_set;