* [RFC PATCH] mfd: syscon: add child device support
@ 2014-05-27 13:55 Philipp Zabel
2014-06-17 14:25 ` Lee Jones
2014-06-17 16:57 ` Rob Herring
0 siblings, 2 replies; 5+ messages in thread
From: Philipp Zabel @ 2014-05-27 13:55 UTC (permalink / raw)
To: devicetree-u79uwXL29TY76Z2rM5mHXA
Cc: Rob Herring, Pawel Moll, Mark Rutland, Lee Jones,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
kernel-bIcnvbaLZ9MEGnE8C9+IrQ, Philipp Zabel
For devices which have a complete register for themselves, it is possible 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 shared 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.
Signed-off-by: Philipp Zabel <p.zabel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
---
Documentation/devicetree/bindings/mfd/syscon.txt | 11 +++++++++++
drivers/mfd/syscon.c | 2 ++
2 files changed, 13 insertions(+)
diff --git a/Documentation/devicetree/bindings/mfd/syscon.txt b/Documentation/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 the
registers directly.
+Optionally, devices that are only controlled through single syscon
+registers or bitfields can also be added as child nodes to the syscon
+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 = <1> and
+#size-cells = <0> and no ranges property.
+
Required properties:
- compatible: Should contain "syscon".
- reg: the register region can be accessed from syscon
+Optional properties:
+- #address-cells: Should be 1.
+- #size-cells: Should be 0.
+
Examples:
gpr: iomuxc-gpr@020e0000 {
compatible = "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 *pdev)
dev_dbg(dev, "regmap %pR registered\n", res);
+ of_platform_populate(pdev->dev.of_node, NULL, NULL, &pdev->dev);
+
return 0;
}
--
2.0.0.rc2
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [RFC PATCH] mfd: syscon: add child device support
2014-05-27 13:55 [RFC PATCH] mfd: syscon: add child device support Philipp Zabel
@ 2014-06-17 14:25 ` Lee Jones
2014-10-30 9:03 ` Philipp Zabel
2014-06-17 16:57 ` Rob Herring
1 sibling, 1 reply; 5+ messages in thread
From: Lee Jones @ 2014-06-17 14:25 UTC (permalink / raw)
To: Philipp Zabel
Cc: devicetree, Rob Herring, Pawel Moll, Mark Rutland, linux-kernel,
kernel
FAO DT chaps,
I'd be interested to hear your opinion about this.
> For devices which have a complete register for themselves, it is possible 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 shared 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.
>
> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
> ---
> Documentation/devicetree/bindings/mfd/syscon.txt | 11 +++++++++++
> drivers/mfd/syscon.c | 2 ++
> 2 files changed, 13 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/mfd/syscon.txt b/Documentation/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 the
> registers directly.
>
> +Optionally, devices that are only controlled through single syscon
> +registers or bitfields can also be added as child nodes to the syscon
> +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 = <1> and
> +#size-cells = <0> and no ranges property.
> +
> Required properties:
> - compatible: Should contain "syscon".
> - reg: the register region can be accessed from syscon
>
> +Optional properties:
> +- #address-cells: Should be 1.
> +- #size-cells: Should be 0.
> +
> Examples:
> gpr: iomuxc-gpr@020e0000 {
> compatible = "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 *pdev)
>
> dev_dbg(dev, "regmap %pR registered\n", res);
>
> + of_platform_populate(pdev->dev.of_node, NULL, NULL, &pdev->dev);
> +
> return 0;
> }
>
--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [RFC PATCH] mfd: syscon: add child device support
2014-06-17 14:25 ` Lee Jones
@ 2014-10-30 9:03 ` Philipp Zabel
0 siblings, 0 replies; 5+ messages in thread
From: Philipp Zabel @ 2014-10-30 9:03 UTC (permalink / raw)
To: Lee Jones
Cc: devicetree-u79uwXL29TY76Z2rM5mHXA, Rob Herring, Pawel Moll,
Mark Rutland, linux-kernel-u79uwXL29TY76Z2rM5mHXA,
kernel-bIcnvbaLZ9MEGnE8C9+IrQ
Hi,
Am Dienstag, den 17.06.2014, 15:25 +0100 schrieb Lee Jones:
> FAO DT chaps,
>
> I'd be interested to hear your opinion about this.
any thoughts on this? With the MediaTek Reset Controller series
(https://lkml.org/lkml/2014/10/29/1008) another possible use case for
this feature came just up.
> > For devices which have a complete register for themselves, it is possible 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 shared 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.
> >
> > Signed-off-by: Philipp Zabel <p.zabel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
regards
Philipp
> > ---
> > Documentation/devicetree/bindings/mfd/syscon.txt | 11 +++++++++++
> > drivers/mfd/syscon.c | 2 ++
> > 2 files changed, 13 insertions(+)
> >
> > diff --git a/Documentation/devicetree/bindings/mfd/syscon.txt b/Documentation/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 the
> > registers directly.
> >
> > +Optionally, devices that are only controlled through single syscon
> > +registers or bitfields can also be added as child nodes to the syscon
> > +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 = <1> and
> > +#size-cells = <0> and no ranges property.
> > +
> > Required properties:
> > - compatible: Should contain "syscon".
> > - reg: the register region can be accessed from syscon
> >
> > +Optional properties:
> > +- #address-cells: Should be 1.
> > +- #size-cells: Should be 0.
> > +
> > Examples:
> > gpr: iomuxc-gpr@020e0000 {
> > compatible = "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 *pdev)
> >
> > dev_dbg(dev, "regmap %pR registered\n", res);
> >
> > + of_platform_populate(pdev->dev.of_node, NULL, NULL, &pdev->dev);
> > +
> > return 0;
> > }
> >
>
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [RFC PATCH] mfd: syscon: add child device support
2014-05-27 13:55 [RFC PATCH] mfd: syscon: add child device support Philipp Zabel
2014-06-17 14:25 ` Lee Jones
@ 2014-06-17 16:57 ` Rob Herring
[not found] ` <CAL_JsqLjyNQfjs4cDf8Eh1WeVGauym=qbF_pEAMu7ASVMqaccg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
1 sibling, 1 reply; 5+ messages in thread
From: Rob Herring @ 2014-06-17 16:57 UTC (permalink / raw)
To: Philipp Zabel
Cc: devicetree@vger.kernel.org, Rob Herring, Pawel Moll, Mark Rutland,
Lee Jones, linux-kernel@vger.kernel.org, kernel@pengutronix.de
On Tue, May 27, 2014 at 8:55 AM, Philipp Zabel <p.zabel@pengutronix.de> wrote:
> For devices which have a complete register for themselves, it is possible to
> place them next to the syscon device with overlapping reg ranges. The same is
We want to avoid overlapping ranges.
> not possible for devices which only occupy bitfields in registers shared with
> other users.
You are addressing the latter case here?
> 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.
>
> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
> ---
> Documentation/devicetree/bindings/mfd/syscon.txt | 11 +++++++++++
> drivers/mfd/syscon.c | 2 ++
> 2 files changed, 13 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/mfd/syscon.txt b/Documentation/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 the
> registers directly.
>
> +Optionally, devices that are only controlled through single syscon
> +registers or bitfields can also be added as child nodes to the syscon
> +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 = <1> and
> +#size-cells = <0> and no ranges property.
> +
I'd like to see an example. What does reg in the child contain? The
register address?
What if the child device needs 3 bitfields from 3 different registers?
It seems to me that you could then want to describe every single
bitfield of a block in the DT. That seems like too much information in
DT much like trying to describe every single clock in DT.
Rob
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2014-10-30 9:03 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-27 13:55 [RFC PATCH] mfd: syscon: add child device support Philipp Zabel
2014-06-17 14:25 ` Lee Jones
2014-10-30 9:03 ` Philipp Zabel
2014-06-17 16:57 ` Rob Herring
[not found] ` <CAL_JsqLjyNQfjs4cDf8Eh1WeVGauym=qbF_pEAMu7ASVMqaccg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-06-23 8:59 ` Philipp Zabel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).