Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1200790 > unrolled thread

[PATCH 1/1] mfd: core: propagate device properties to sub devices drivers

Started byAndy Shevchenko <andriy.shevchenko@linux.intel.com>
First post2015-08-05 16:00 +0200
Last post2015-08-10 18:10 +0200
Articles 2 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH 1/1] mfd: core: propagate device properties to sub devices drivers Andy Shevchenko <andriy.shevchenko@linux.intel.com> - 2015-08-05 16:00 +0200
    Re: [PATCH 1/1] mfd: core: propagate device properties to sub  devices drivers Andy Shevchenko <andriy.shevchenko@linux.intel.com> - 2015-08-10 18:10 +0200

#1200790 — [PATCH 1/1] mfd: core: propagate device properties to sub devices drivers

FromAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Date2015-08-05 16:00 +0200
Subject[PATCH 1/1] mfd: core: propagate device properties to sub devices drivers
Message-ID<pU7oB-38E-9@gated-at.bofh.it>
In the similar way like we do for the platform data we propagate the device
properties. For example, in case of Intel LPSS drivers we may provide a
specific property to tell the actual device driver an additional information
such as platform name.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/mfd/mfd-core.c   | 3 +++
 include/linux/mfd/core.h | 5 +++++
 2 files changed, 8 insertions(+)

diff --git a/drivers/mfd/mfd-core.c b/drivers/mfd/mfd-core.c
index c17635d..f0d6e45 100644
--- a/drivers/mfd/mfd-core.c
+++ b/drivers/mfd/mfd-core.c
@@ -14,6 +14,7 @@
 #include <linux/kernel.h>
 #include <linux/platform_device.h>
 #include <linux/acpi.h>
+#include <linux/property.h>
 #include <linux/mfd/core.h>
 #include <linux/pm_runtime.h>
 #include <linux/slab.h>
@@ -172,6 +173,8 @@ static int mfd_add_device(struct device *parent, int id,
 			goto fail_alias;
 	}
 
+	device_add_property_set(&pdev->dev, cell->pset);
+
 	ret = mfd_platform_add_cell(pdev, cell, usage_count);
 	if (ret)
 		goto fail_alias;
diff --git a/include/linux/mfd/core.h b/include/linux/mfd/core.h
index a76bc10..5009522 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/property.h>
 
 struct irq_domain;
 
@@ -38,6 +39,10 @@ struct mfd_cell {
 	/* platform data passed to the sub devices drivers */
 	void			*platform_data;
 	size_t			pdata_size;
+
+	/* device properties passed to the sub devices drivers */
+	struct property_set	*pset;
+
 	/*
 	 * Device Tree compatible string
 	 * See: Documentation/devicetree/usage-model.txt Chapter 2.2 for details
-- 
2.4.6

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1204400 — Re: [PATCH 1/1] mfd: core: propagate device properties to sub devices drivers

FromAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Date2015-08-10 18:10 +0200
SubjectRe: [PATCH 1/1] mfd: core: propagate device properties to sub devices drivers
Message-ID<pVXOa-2OQ-17@gated-at.bofh.it>
In reply to#1200790
On Mon, 2015-08-10 at 16:51 +0100, Lee Jones wrote:
> On Wed, 05 Aug 2015, Andy Shevchenko wrote:
> 
> > In the similar way like we do for the platform data we propagate 
> > the device
> > properties. For example, in case of Intel LPSS drivers we may 
> > provide a
> > specific property to tell the actual device driver an additional 
> > information
> > such as platform name.
> > 
> > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> > ---
> >  drivers/mfd/mfd-core.c   | 3 +++
> >  include/linux/mfd/core.h | 5 +++++
> >  2 files changed, 8 insertions(+)
> 
> Please submit a user as well.

Will do. We are now doing another approach on built-in property
storage, I guess we append this patch to the update series along with
usage example.

-- 
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Intel Finland Oy
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web