From patchwork Mon Apr 16 12:56:25 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 133462 Delivered-To: patch@linaro.org Received: by 10.46.84.18 with SMTP id i18csp3536873ljb; Mon, 16 Apr 2018 05:57:37 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/cyps9RqbHyXNY7fBqMHpbpFaamzz02n8XZ0WDHqh7iMp8nXZCyGKBHxSW7SIaLspFLU+P X-Received: by 2002:a17:902:284b:: with SMTP id e69-v6mr3680492plb.240.1523883457620; Mon, 16 Apr 2018 05:57:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523883457; cv=none; d=google.com; s=arc-20160816; b=NxWvg8Rt7bbo9yigOKqX57KxQk8E1w786KmRAWV4y/tqrXqNJ46US3fdkRrUHwGnEo 7DpulmPIQ2kP/PwhS+iYEDvM+TsrooEUNXjAI+AdGYR/LYp3L63UJIGHmeakkBboZZ9I woxKTMnCAlhIgaBd5aR2oF2RZ6MsTCl1FisyxUc0mNc3gZJ0t+2gciE64PAHrguVGpXc h9gYnwy04lTsBg/O+qQ4A3dLJVfyp92syW9czvqGkgIU29ISRmDvsrhwM1bKTrRPpNph 4Z3IHqNyXTLiBtutzLdi/ZF9LThyS6QITo/HRNPsT0U0jCZ7V/yVayt/i40HwHh2iPzF IFPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=ke3GUk3zI9jw6rHKQNY6Y9Wzchlxcnmna8V/J1FTI3E=; b=0mPSvZnx9aI2QtoSYDRgYWvRZtLRBMt5dCCOo7py62tG7CBRZMJJUyxS6MxzNzim2O MmOPa1kjqxu/8I+8qC0GW8Q8ywx9TS4yyGB27SFCkmqYoC7Afb93RgpX2MoCZE6EcRZ1 eNByAM2RvI06FAtrdAZgW4REsxZ2vm/4MocqVAdH58qzhdUJId6G7jBUgVX9vdbG8JQ9 yCDMkJHnYHxuTofA15hOPpL633XtN9E4LBeU9nMjgExWj99QJ0w1AylDL5DyoIYFpH9w AUWxDimVOOLOd5DQHA/aGUKta2fOubNNOMH0kPE0pjZPpMjlYGSSk3ffkJIITFzPkKNb /8BQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Z+t2oM0P; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i1-v6si5110252plt.178.2018.04.16.05.57.37; Mon, 16 Apr 2018 05:57:37 -0700 (PDT) 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; dkim=pass header.i=@linaro.org header.s=google header.b=Z+t2oM0P; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754758AbeDPM5f (ORCPT + 29 others); Mon, 16 Apr 2018 08:57:35 -0400 Received: from mail-wr0-f196.google.com ([209.85.128.196]:38640 "EHLO mail-wr0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753149AbeDPM5B (ORCPT ); Mon, 16 Apr 2018 08:57:01 -0400 Received: by mail-wr0-f196.google.com with SMTP id h3so13103812wrh.5 for ; Mon, 16 Apr 2018 05:57:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ke3GUk3zI9jw6rHKQNY6Y9Wzchlxcnmna8V/J1FTI3E=; b=Z+t2oM0PLEB/3xQ2DfEygXH/dKb4dI3m/J4ePwXeSPTUKnBn3O9U7PoaAzHOpMjWDJ nxzeIAUrHGgnJ9ArJvZrwQHyGE3pnsFtVgv4LxvT8WA8OYWteuH6hZMEsNRmQmXbzzZR 13I4gzr4dOZ/jYtLnW6qyVqoycyvWyRimZdwI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=ke3GUk3zI9jw6rHKQNY6Y9Wzchlxcnmna8V/J1FTI3E=; b=mjzmmTk4at7Z28Yl/aiUE2+6NOHyy8ZS0TCRw6pdSik8c/C6EPo+bCxHCQX+YVMMWQ DbDSWRtPz8lKeA4R3nTCTmFF5ly/dtmFxRiRZlz+I1Pxcu/+BRaB7vSbkdcC5KpXxa21 fMa8ey3rtEhC3+b3Ok/fB491fE4FBXcnP5otbph3Who0HULSfNXoiYW2qebTfzsPkGPR D1koj/J4p9+sdiX9Vr57X7Hxqo0ecQNxRhOAR355tKEnr8eLus98lq9rv+OmRvWfmPK6 XF+rugYkF2nJD95feRuOhH6fx50+OShT1XzI4funrQkmWjEvcde2Ihe55U0UX+ixwfcB n46A== X-Gm-Message-State: ALQs6tAJtGN/Vu1n9T/J1t1iITznK4JZwUL/RvN52nxO5uxo3P5h4FYK pW4bZhVrF6QVagM4vErfDqhV6g== X-Received: by 10.28.19.13 with SMTP id 13mr11065891wmt.89.1523883420699; Mon, 16 Apr 2018 05:57:00 -0700 (PDT) Received: from localhost.localdomain ([2.27.167.70]) by smtp.gmail.com with ESMTPSA id m35sm15615174wrm.59.2018.04.16.05.56.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 16 Apr 2018 05:57:00 -0700 (PDT) From: Lee Jones To: linus.walleij@linaro.org, ldewangan@nvidia.com Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Lee Jones Subject: [PATCH v2 1/3] mfd: Provide MACRO to declare commonly defined MFD cell attributes Date: Mon, 16 Apr 2018 13:56:25 +0100 Message-Id: <20180416125627.22156-2-lee.jones@linaro.org> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180416125627.22156-1-lee.jones@linaro.org> References: <20180416125627.22156-1-lee.jones@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Signed-off-by: Lee Jones Acked-by: Laxman Dewangan Tested-by: Laxman Dewangan --- include/linux/mfd/core.h | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) -- 2.14.1 diff --git a/include/linux/mfd/core.h b/include/linux/mfd/core.h index 99c0395fe1f9..2bdae891fd24 100644 --- a/include/linux/mfd/core.h +++ b/include/linux/mfd/core.h @@ -16,6 +16,35 @@ #include +#define MFD_RES_SIZE(arr) (sizeof(arr) / sizeof(struct resource)) + +#define MFD_CELL_ALL(_name, _res, _pdata, _pdsize, _id, _compat, _match)\ + { \ + .name = (_name), \ + .resources = (_res), \ + .num_resources = MFD_RES_SIZE((_res)), \ + .platform_data = (_pdata), \ + .pdata_size = (_pdsize), \ + .of_compatible = (_compat), \ + .acpi_match = (_match), \ + .id = (_id), \ + } + +#define OF_MFD_CELL(_name, _res, _pdata, _pdsize,_id, _compat) \ + MFD_CELL_ALL(_name, _res, _pdata, _pdsize, _id, _compat, NULL) \ + +#define ACPI_MFD_CELL(_name, _res, _pdata, _pdsize, _id, _match) \ + MFD_CELL_ALL(_name, _res, _pdata, _pdsize, _id, NULL, _match) \ + +#define MFD_CELL_BASIC(_name, _res, _pdata, _pdsize, _id) \ + MFD_CELL_ALL(_name, _res, _pdata, _pdsize, _id, NULL, NULL) \ + +#define MFD_CELL_RES(_name, _res) \ + MFD_CELL_ALL(_name, _res, NULL, 0, 0, NULL, NULL) \ + +#define MFD_CELL_NAME(_name) \ + MFD_CELL_ALL(_name, NULL, NULL, 0, 0, NULL, NULL) \ + struct irq_domain; struct property_entry;