From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753059AbcBXMof (ORCPT ); Wed, 24 Feb 2016 07:44:35 -0500 Received: from metis.ext.4.pengutronix.de ([92.198.50.35]:45101 "EHLO metis.ext.4.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750763AbcBXMoe (ORCPT ); Wed, 24 Feb 2016 07:44:34 -0500 Message-ID: <1456317864.3396.41.camel@pengutronix.de> Subject: Re: [PATCH v2] mfd: syscon: allow to register syscon with a device From: Philipp Zabel To: Arnd Bergmann Cc: Lee Jones , Alexander Shiyan , Pankaj Dubey , Pawel Moll , Wolfram Sang , Peter Seiderer , Tushar Behera , linux-kernel@vger.kernel.org, kernel@pengutronix.de Date: Wed, 24 Feb 2016 13:44:24 +0100 In-Reply-To: <2470261.O5caHJeW3o@wuerfel> References: <1456312741-7658-1-git-send-email-p.zabel@pengutronix.de> <2470261.O5caHJeW3o@wuerfel> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.12.9-1+b1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 2001:67c:670:100:96de:80ff:fec2:9969 X-SA-Exim-Mail-From: p.zabel@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Arnd, Am Mittwoch, den 24.02.2016, 13:18 +0100 schrieb Arnd Bergmann: > On Wednesday 24 February 2016 12:19:01 Philipp Zabel wrote: > > Commit bdb0066df96e ("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. Since there is no replacement, this > > patch allows again to register syscon regions with an associated device > > where that this device exists anyway. > > > > Signed-off-by: Philipp Zabel > > Can you elaborate how you want to use the new interface? I use this patch to attach the regmap to the IOMUXC device, which the GPR (syscon) region on i.MX6 is a part of: diff --git a/drivers/pinctrl/freescale/pinctrl-imx6q.c b/drivers/pinctrl/freescale/pinctrl-imx6q.c index 4d1fcb8..74a68ec 100644 --- a/drivers/pinctrl/freescale/pinctrl-imx6q.c +++ b/drivers/pinctrl/freescale/pinctrl-imx6q.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include @@ -473,6 +474,12 @@ static const struct of_device_id imx6q_pinctrl_of_match[] = { static int imx6q_pinctrl_probe(struct platform_device *pdev) { + struct device_node *syscon_np; + + syscon_np = of_find_compatible_node(NULL, NULL, "fsl,imx6q-iomuxc-gpr"); + if (syscon_np) + syscon_register(&pdev->dev, syscon_np); + return imx_pinctrl_probe(pdev, &imx6q_pinctrl_info); } The pinctrl driver is probed at arch_initcall time. > My immediate reaction would be that drivers calling syscon_register() > are probably doing something wrong. If we want to restore the > debugfs interfaces, there might be a better way to do this automatically. Do you have any suggestion? regards Philipp