diff options
author | Pawel Moll <pawel.moll@arm.com> | 2014-02-12 10:47:10 +0000 |
---|---|---|
committer | Pawel Moll <pawel.moll@arm.com> | 2014-05-15 17:02:19 +0100 |
commit | 29f9b6cf7bff6a118130163c848811e14f8022da (patch) | |
tree | 2338d5da72d937abc15a68ddb18465a1795407a5 /drivers/mfd/syscon.c | |
parent | 3b9334ac835bb431e2186645230c9f1eb94b5d49 (diff) | |
download | blackbird-obmc-linux-29f9b6cf7bff6a118130163c848811e14f8022da.tar.gz blackbird-obmc-linux-29f9b6cf7bff6a118130163c848811e14f8022da.zip |
mfd: syscon: Add platform data with a regmap config name
Define syscon platform data structure that can be used
to define a regmap config name. This is particularly useful
in the regmap debugfs when there is more than one syscon
device registered, to distinguish the register blocks.
Signed-off-by: Pawel Moll <pawel.moll@arm.com>
Acked-by: Lee Jones <lee.jones@linaro.org>
Diffstat (limited to 'drivers/mfd/syscon.c')
-rw-r--r-- | drivers/mfd/syscon.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/mfd/syscon.c b/drivers/mfd/syscon.c index dbea55de4397..e2a04bb8bc1e 100644 --- a/drivers/mfd/syscon.c +++ b/drivers/mfd/syscon.c @@ -18,6 +18,7 @@ #include <linux/of.h> #include <linux/of_address.h> #include <linux/of_platform.h> +#include <linux/platform_data/syscon.h> #include <linux/platform_device.h> #include <linux/regmap.h> #include <linux/mfd/syscon.h> @@ -119,6 +120,7 @@ static struct regmap_config syscon_regmap_config = { static int syscon_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; + struct syscon_platform_data *pdata = dev_get_platdata(dev); struct syscon *syscon; struct resource *res; void __iomem *base; @@ -136,6 +138,8 @@ static int syscon_probe(struct platform_device *pdev) return -ENOMEM; syscon_regmap_config.max_register = res->end - res->start - 3; + if (pdata) + syscon_regmap_config.name = pdata->label; syscon->regmap = devm_regmap_init_mmio(dev, base, &syscon_regmap_config); if (IS_ERR(syscon->regmap)) { |