mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Daniel Drake <dsd@laptop.org>
To: sameo@linux.intel.com
To: grant.likely@secretlab.ca
Cc: devicetree-discuss@lists.ozlabs.org
Cc: linux-kernel@vger.kernel.org
Cc: dilinger@queued.net
Cc: broonie@opensource.wolfsonmicro.com
Subject: [PATCH 1/3] mfd: allow mfd_cell association with device tree node
Date: Wed, 28 Sep 2011 10:08:10 +0100 (BST)	[thread overview]
Message-ID: <20110928090810.6ECC19D401D@zog.reactivated.net> (raw)

This allows a mfd_cell to be linked with a device tree node, which
then allows child drivers to have easy access to that handle.

Signed-off-by: Daniel Drake <dsd@laptop.org>
---
 drivers/mfd/mfd-core.c   |    1 +
 include/linux/mfd/core.h |    4 ++++
 2 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/drivers/mfd/mfd-core.c b/drivers/mfd/mfd-core.c
index 0902523..7d22dcd 100644
--- a/drivers/mfd/mfd-core.c
+++ b/drivers/mfd/mfd-core.c
@@ -87,6 +87,7 @@ static int mfd_add_device(struct device *parent, int id,
 		goto fail_device;
 
 	pdev->dev.parent = parent;
+	pdev->dev.of_node = cell->of_node;
 
 	if (cell->pdata_size) {
 		ret = platform_device_add_data(pdev,
diff --git a/include/linux/mfd/core.h b/include/linux/mfd/core.h
index 4e76163..9b836f9 100644
--- a/include/linux/mfd/core.h
+++ b/include/linux/mfd/core.h
@@ -15,6 +15,7 @@
 #define MFD_CORE_H
 
 #include <linux/platform_device.h>
+#include <linux/of.h>
 
 /*
  * This struct describes the MFD part ("cell").
@@ -37,6 +38,9 @@ struct mfd_cell {
 	void			*platform_data;
 	size_t			pdata_size;
 
+	/* association with device tree node (optional) */
+	struct device_node	*of_node;
+
 	/*
 	 * These resources can be specified relative to the parent device.
 	 * For accessing hardware you should use resources from the platform dev
-- 
1.7.6.2


             reply	other threads:[~2011-09-28  9:52 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-28  9:08 Daniel Drake [this message]
  -- strict thread matches above, loose matches on Subject: below --
2011-09-21 12:01 Daniel Drake
2011-09-21 12:49 ` Mark Brown
2011-09-21 13:02   ` Daniel Drake
2011-09-21 13:16     ` Mark Brown
2011-09-27 14:44       ` Daniel Drake
2011-09-27 15:05         ` Grant Likely
2011-09-27 15:18           ` Mark Brown
2011-09-27 16:44           ` Daniel Drake
2011-09-27 18:14             ` Mark Brown
2011-09-27 18:25               ` Daniel Drake
2011-09-27 18:26                 ` Mark Brown
2011-09-27 18:28                   ` Daniel Drake
2011-09-27 18:38                     ` Mark Brown
2011-09-28  9:07                       ` Daniel Drake
2011-09-28 12:31                         ` Mark Brown
2011-10-03  8:40                           ` Daniel Drake
2011-10-03 10:28                             ` Mark Brown
2011-10-03 10:39                               ` Daniel Drake
2011-10-03 12:16                                 ` Mark Brown
2011-10-03 12:30                                   ` Daniel Drake
2011-10-03 12:40                                     ` Mark Brown
2011-10-03 12:53                                       ` Daniel Drake

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=20110928090810.6ECC19D401D@zog.reactivated.net \
    --to=dsd@laptop.org \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=sameo@linux.intel.com \
    /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

all inboxes | Powered by JetHome®