From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: ","@black.fi.intel.com, linux-kernel@vger.kernel.org,
Lee Jones <lee.jones@linaro.org>,
Mika Westerberg <mika.westerberg@linux.intel.com>,
Heikki Krogerus <heikki.krogerus@linux.intel.com>,
"Rafael J . Wysocki" <rjw@rjwysocki.net>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Subject: [PATCH 1/1] mfd: core: propagate device properties to sub devices drivers
Date: Wed, 5 Aug 2015 16:55:05 +0300 [thread overview]
Message-ID: <1438782905-10758-1-git-send-email-andriy.shevchenko@linux.intel.com> (raw)
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
next reply other threads:[~2015-08-05 13:55 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-05 13:55 Andy Shevchenko [this message]
[not found] ` <20150810155156.GC12631@x1>
2015-08-10 16:03 ` [PATCH 1/1] mfd: core: propagate device properties to sub devices drivers Andy Shevchenko
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=1438782905-10758-1-git-send-email-andriy.shevchenko@linux.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=","@black.fi.intel.com \
--cc=heikki.krogerus@linux.intel.com \
--cc=lee.jones@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mika.westerberg@linux.intel.com \
--cc=rjw@rjwysocki.net \
/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;
as well as URLs for NNTP newsgroup(s).