Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8626ada8 authored by Philipp Zabel's avatar Philipp Zabel Committed by Linus Walleij
Browse files

pinctrl: imx: attach iomuxc device to gpr syscon



Commit bdb0066d ("mfd: syscon: Decouple syscon interface from platform
devices") added the possibility to register syscon devices without
associated platform device. This also removed regmap debugfs facilities,
which don't work without a device. This patch associates the syscon regmap
that handles the IOMUX controller's general purpose registers with the
pinctrl device so that the GPR registers appear in the regmap debugfs
directory again. For example, on i.MX6Q the GPR registers now can be
read from /sys/kernel/debug/regmap/20e0000.iomuxc-gpr/registers.

Signed-off-by: default avatarPhilipp Zabel <p.zabel@pengutronix.de>
Acked-by: default avatarShawn Guo <shawnguo@kernel.org>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 2c7e3306
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -15,6 +15,7 @@
#include <linux/err.h>
#include <linux/init.h>
#include <linux/io.h>
#include <linux/mfd/syscon.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/of_device.h>
@@ -24,6 +25,7 @@
#include <linux/pinctrl/pinctrl.h>
#include <linux/pinctrl/pinmux.h>
#include <linux/slab.h>
#include <linux/regmap.h>

#include "../core.h"
#include "pinctrl-imx.h"
@@ -718,10 +720,12 @@ static int imx_pinctrl_probe_dt(struct platform_device *pdev,
int imx_pinctrl_probe(struct platform_device *pdev,
		      struct imx_pinctrl_soc_info *info)
{
	struct regmap_config config = { .name = "gpr" };
	struct device_node *dev_np = pdev->dev.of_node;
	struct device_node *np;
	struct imx_pinctrl *ipctl;
	struct resource *res;
	struct regmap *gpr;
	int ret, i;

	if (!info || !info->pins || !info->npins) {
@@ -730,6 +734,12 @@ int imx_pinctrl_probe(struct platform_device *pdev,
	}
	info->dev = &pdev->dev;

	if (info->gpr_compatible) {
		gpr = syscon_regmap_lookup_by_compatible(info->gpr_compatible);
		if (!IS_ERR(gpr))
			regmap_attach_dev(&pdev->dev, gpr, &config);
	}

	/* Create state holders etc for this driver */
	ipctl = devm_kzalloc(&pdev->dev, sizeof(*ipctl), GFP_KERNEL);
	if (!ipctl)
+1 −0
Original line number Diff line number Diff line
@@ -82,6 +82,7 @@ struct imx_pinctrl_soc_info {
	struct imx_pmx_func *functions;
	unsigned int nfunctions;
	unsigned int flags;
	const char *gpr_compatible;
};

#define SHARE_MUX_CONF_REG	0x1
+1 −0
Original line number Diff line number Diff line
@@ -389,6 +389,7 @@ static const struct pinctrl_pin_desc imx50_pinctrl_pads[] = {
static struct imx_pinctrl_soc_info imx50_pinctrl_info = {
	.pins = imx50_pinctrl_pads,
	.npins = ARRAY_SIZE(imx50_pinctrl_pads),
	.gpr_compatible = "fsl,imx50-iomuxc-gpr",
};

static const struct of_device_id imx50_pinctrl_of_match[] = {
+1 −0
Original line number Diff line number Diff line
@@ -452,6 +452,7 @@ static const struct pinctrl_pin_desc imx53_pinctrl_pads[] = {
static struct imx_pinctrl_soc_info imx53_pinctrl_info = {
	.pins = imx53_pinctrl_pads,
	.npins = ARRAY_SIZE(imx53_pinctrl_pads),
	.gpr_compatible = "fsl,imx53-iomuxc-gpr",
};

static const struct of_device_id imx53_pinctrl_of_match[] = {
+1 −0
Original line number Diff line number Diff line
@@ -458,6 +458,7 @@ static const struct pinctrl_pin_desc imx6dl_pinctrl_pads[] = {
static struct imx_pinctrl_soc_info imx6dl_pinctrl_info = {
	.pins = imx6dl_pinctrl_pads,
	.npins = ARRAY_SIZE(imx6dl_pinctrl_pads),
	.gpr_compatible = "fsl,imx6q-iomuxc-gpr",
};

static const struct of_device_id imx6dl_pinctrl_of_match[] = {
Loading