From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lee Jones Subject: Re: [RFC PATCH] mfd: syscon: add child device support Date: Tue, 17 Jun 2014 15:25:06 +0100 Message-ID: <20140617142506.GA29841@lee--X1> References: <1401198917-16077-1-git-send-email-p.zabel@pengutronix.de> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: Content-Disposition: inline In-Reply-To: <1401198917-16077-1-git-send-email-p.zabel@pengutronix.de> Sender: linux-kernel-owner@vger.kernel.org To: Philipp Zabel Cc: devicetree@vger.kernel.org, Rob Herring , Pawel Moll , Mark Rutland , linux-kernel@vger.kernel.org, kernel@pengutronix.de List-Id: devicetree@vger.kernel.org =46AO DT chaps, I'd be interested to hear your opinion about this. > For devices which have a complete register for themselves, it is poss= ible to > place them next to the syscon device with overlapping reg ranges. The= same is > not possible for devices which only occupy bitfields in registers sha= red with > other users. > For devices that are completely controlled by bitfields in the syscon= address > range, such as multiplexers or voltage regulators, allow to put child= devices > into the syscon device node. >=20 > Signed-off-by: Philipp Zabel > --- > Documentation/devicetree/bindings/mfd/syscon.txt | 11 +++++++++++ > drivers/mfd/syscon.c | 2 ++ > 2 files changed, 13 insertions(+) >=20 > diff --git a/Documentation/devicetree/bindings/mfd/syscon.txt b/Docum= entation/devicetree/bindings/mfd/syscon.txt > index fe8150b..a7e11d5 100644 > --- a/Documentation/devicetree/bindings/mfd/syscon.txt > +++ b/Documentation/devicetree/bindings/mfd/syscon.txt > @@ -9,10 +9,21 @@ using a specific compatible value), interrogate the= node (or associated > OS driver) to determine the location of the registers, and access th= e > registers directly. > =20 > +Optionally, devices that are only controlled through single syscon > +registers or bitfields can also be added as child nodes to the sysco= n > +device node. These devices can implicitly assume their parent node > +as syscon provider without referencing it explicitly via phandle. > +In this case, the syscon node should have #address-cells =3D <1> and > +#size-cells =3D <0> and no ranges property. > + > Required properties: > - compatible: Should contain "syscon". > - reg: the register region can be accessed from syscon > =20 > +Optional properties: > +- #address-cells: Should be 1. > +- #size-cells: Should be 0. > + > Examples: > gpr: iomuxc-gpr@020e0000 { > compatible =3D "fsl,imx6q-iomuxc-gpr", "syscon"; > diff --git a/drivers/mfd/syscon.c b/drivers/mfd/syscon.c > index dbea55d..1dde475 100644 > --- a/drivers/mfd/syscon.c > +++ b/drivers/mfd/syscon.c > @@ -147,6 +147,8 @@ static int syscon_probe(struct platform_device *p= dev) > =20 > dev_dbg(dev, "regmap %pR registered\n", res); > =20 > + of_platform_populate(pdev->dev.of_node, NULL, NULL, &pdev->dev); > + > return 0; > } > =20 --=20 Lee Jones Linaro STMicroelectronics Landing Team Lead Linaro.org =E2=94=82 Open source software for ARM SoCs =46ollow Linaro: Facebook | Twitter | Blog