public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: lee.jones@linaro.org (Lee Jones)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2] mfd: Provide MACRO to declare commonly defined MFD cell attributes
Date: Wed, 10 Feb 2016 15:38:46 +0000	[thread overview]
Message-ID: <20160210153846.GB26950@x1> (raw)
In-Reply-To: <1455028027-1527-1-git-send-email-lee.jones@linaro.org>

mfd: Provide MACRO to declare commonly defined MFD cell attributes
    
Cc: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>

---
 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 <linux/platform_device.h>
 
+#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;

  parent reply	other threads:[~2016-02-10 15:38 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-09 14:27 [PATCH] mfd: Provide MACRO to declare commonly defined MFD cell attributes Lee Jones
2016-02-09 15:20 ` Laxman Dewangan
2016-02-10 12:38 ` Laxman Dewangan
2016-02-10 15:38 ` Lee Jones [this message]
2016-02-10 17:50   ` [PATCH v2] " Laxman Dewangan
2016-02-11  9:10     ` Lee Jones
2016-02-11  9:01       ` Laxman Dewangan
2016-02-11  9:46         ` Lee Jones
2016-02-26 10:43   ` Andy Shevchenko
2016-02-10 15:39 ` [PATCH v2] mfd: ab8500: Provide a small example using new MFD cell MACROs Lee Jones
2016-02-15  9:58   ` Linus Walleij

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160210153846.GB26950@x1 \
    --to=lee.jones@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox