mfd: core: propagate device properties to sub devices drivers
PATCH 1/1 mfd: core: propagate device properties to sub devices drivers
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.
--- drivers/mfd/mfd-core.c | 3 +++ include/linux/mfd/core.h | 5 +++++ 2 files changed, 8 insertions(+)
drivers/mfd/mfd-core.c +3 -0
@@ -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;
include/linux/mfd/core.h +5 -0
@@ -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
Signature · 1 line
2.4.6
A message that is not in the archive (sent off-list or not yet received): 20150810155156.GC12631@x1
Quoted 10 lines · Lee Jones
Quoted 8 lines · Andy Shevchenko
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.
Quoted 7 lines
Quoted 5 lines
Signed-off-by Andy Shevchenko <[email protected]>--- 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.
Signature · 2 lines
Andy Shevchenko <[email protected]> Intel Finland Oy