devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] mfd: allow mfd_cell association with device tree node
@ 2011-09-21 12:01 Daniel Drake
       [not found] ` <20110921120148.4A81E9D401D-k/4jFdqg8LLlyo9zxV8I99HuzzzSOjJt@public.gmane.org>
  0 siblings, 1 reply; 25+ messages in thread
From: Daniel Drake @ 2011-09-21 12:01 UTC (permalink / raw)
  To: grant.likely-s3s/WqlpOiPyB63q8FvJNQ, sameo-VuQAYsv1563Yd54FQh9/CA
  Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	dilinger-pFFUokh25LWsTnJN9+BGXg

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-2X9k7bc8m7Mdnm+yROfE0A@public.gmane.org>
---
 drivers/mfd/mfd-core.c   |    1 +
 include/linux/mfd/core.h |    4 ++++
 2 files changed, 5 insertions(+), 0 deletions(-)

I think this is what is being suggested at 
http://lists.ozlabs.org/pipermail/devicetree-discuss/2011-September/008235.html

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

^ permalink raw reply related	[flat|nested] 25+ messages in thread
* [PATCH 1/3] mfd: allow mfd_cell association with device tree node
@ 2011-09-28  9:08 Daniel Drake
  0 siblings, 0 replies; 25+ messages in thread
From: Daniel Drake @ 2011-09-28  9:08 UTC (permalink / raw)
  To: sameo-VuQAYsv1563Yd54FQh9/CA, grant.likely-s3s/WqlpOiPyB63q8FvJNQ
  Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	broonie-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	dilinger-pFFUokh25LWsTnJN9+BGXg

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-2X9k7bc8m7Mdnm+yROfE0A@public.gmane.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

^ permalink raw reply related	[flat|nested] 25+ messages in thread
* [PATCH 1/3] mfd: allow mfd_cell association with device tree node
@ 2011-09-28  9:08 Daniel Drake
  0 siblings, 0 replies; 25+ messages in thread
From: Daniel Drake @ 2011-09-28  9:08 UTC (permalink / raw)
  To: sameo, grant.likely; +Cc: devicetree-discuss, linux-kernel, dilinger, broonie

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

^ permalink raw reply related	[flat|nested] 25+ messages in thread
* [PATCH 1/3] mfd: allow mfd_cell association with device tree node
@ 2011-09-21 12:01 Daniel Drake
  0 siblings, 0 replies; 25+ messages in thread
From: Daniel Drake @ 2011-09-21 12:01 UTC (permalink / raw)
  To: grant.likely, sameo; +Cc: linux-kernel, devicetree-discuss, dilinger

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(-)

I think this is what is being suggested at 
http://lists.ozlabs.org/pipermail/devicetree-discuss/2011-September/008235.html

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

^ permalink raw reply related	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2011-10-03 12:53 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-21 12:01 [PATCH 1/3] mfd: allow mfd_cell association with device tree node Daniel Drake
     [not found] ` <20110921120148.4A81E9D401D-k/4jFdqg8LLlyo9zxV8I99HuzzzSOjJt@public.gmane.org>
2011-09-21 12:49   ` Mark Brown
     [not found]     ` <20110921124936.GA25620-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
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
     [not found]                     ` <CAMLZHHSuoeAJ-AC9daxb83+EANV=YGK-aiYpQ_j2wFiyQa5ytw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-09-27 18:26                       ` Mark Brown
     [not found]                         ` <20110927182636.GR4289-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>
2011-09-27 18:28                           ` Daniel Drake
     [not found]                             ` <CAMLZHHR0rMZct2E91X8k+Lhv_y-pY_5+vshZw6dj194o9vSCJQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
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
     [not found]                                         ` <20111003102846.GA23811-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2011-10-03 10:39                                           ` Daniel Drake
2011-10-03 12:16                                             ` Mark Brown
     [not found]                                               ` <20111003121655.GB3731-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>
2011-10-03 12:30                                                 ` Daniel Drake
     [not found]                                                   ` <CAMLZHHS+fFzuWtwOwt-g2y38g93uaZFyUGsooZyYLMT=mdWQFQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-10-03 12:40                                                     ` Mark Brown
     [not found]                                                       ` <20111003124044.GF3731-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>
2011-10-03 12:53                                                         ` Daniel Drake
  -- strict thread matches above, loose matches on Subject: below --
2011-09-28  9:08 Daniel Drake
2011-09-28  9:08 Daniel Drake
2011-09-21 12:01 Daniel Drake

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).