All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] mfd: syscon: add child device support
@ 2014-11-03  9:16 Philipp Zabel
  2014-11-17  2:18   ` Flora Fu
  2014-11-24 11:11 ` Philipp Zabel
  0 siblings, 2 replies; 4+ messages in thread
From: Philipp Zabel @ 2014-11-03  9:16 UTC (permalink / raw)
  To: Rob Herring, Lee Jones, Arnd Bergmann
  Cc: Pawel Moll, Mark Rutland, Flora Fu, linux-kernel, devicetree,
	kernel, 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@pengutronix.de>
---
Changes since v1:
 - Reworded binding documentation to allow #size-cells = <1>, which is useful
   for syscon children that are controlled through a (possibly shared) register
   range.
---
 Documentation/devicetree/bindings/mfd/syscon.txt | 13 +++++++++++++
 drivers/mfd/syscon.c                             |  3 +++
 2 files changed, 16 insertions(+)

diff --git a/Documentation/devicetree/bindings/mfd/syscon.txt b/Documentation/devicetree/bindings/mfd/syscon.txt
index fe8150b..0c6b497 100644
--- a/Documentation/devicetree/bindings/mfd/syscon.txt
+++ b/Documentation/devicetree/bindings/mfd/syscon.txt
@@ -9,12 +9,25 @@ 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 controlled exclusively through syscon registers,
+or even bitfields in shared syscon registers, can also be added as child nodes
+to the syscon device node. These devices can implicitly assume their parent
+node is a syscon provider without referencing it explicitly via phandle.
+In this case, the syscon node should have #address-cells = <1> and
+#size-cells = <0> or <1> 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 or 1.
+
 Examples:
 gpr: iomuxc-gpr@020e0000 {
+	#address-cells = <1>;
+	#size-cells = <0>;
 	compatible = "fsl,imx6q-iomuxc-gpr", "syscon";
 	reg = <0x020e0000 0x38>;
 };
diff --git a/drivers/mfd/syscon.c b/drivers/mfd/syscon.c
index ca15878..38da178 100644
--- a/drivers/mfd/syscon.c
+++ b/drivers/mfd/syscon.c
@@ -155,6 +155,9 @@ static int syscon_probe(struct platform_device *pdev)
 
 	dev_dbg(dev, "regmap %pR registered\n", res);
 
+	if (!of_device_is_compatible(pdev->dev.of_node, "simple-bus"))
+		of_platform_populate(pdev->dev.of_node, NULL, NULL, &pdev->dev);
+
 	return 0;
 }
 
-- 
2.1.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] mfd: syscon: add child device support
  2014-11-03  9:16 [PATCH v2] mfd: syscon: add child device support Philipp Zabel
@ 2014-11-17  2:18   ` Flora Fu
  2014-11-24 11:11 ` Philipp Zabel
  1 sibling, 0 replies; 4+ messages in thread
From: Flora Fu @ 2014-11-17  2:18 UTC (permalink / raw)
  To: Philipp Zabel
  Cc: Rob Herring, Lee Jones, Arnd Bergmann, Pawel Moll, Mark Rutland,
	linux-kernel, devicetree, kernel, srv_heupstream

Hi, Philipp,

How is the status of syscon patch in
https://lkml.org/lkml/2014/5/27/422 ?
Will this patch be accepted in feature release 3.19?

Thanks,
Flora

On Mon, 2014-11-03 at 10:16 +0100, Philipp Zabel 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
> 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>
> ---
> Changes since v1:
>  - Reworded binding documentation to allow #size-cells = <1>, which is useful
>    for syscon children that are controlled through a (possibly shared) register
>    range.
> ---
>  Documentation/devicetree/bindings/mfd/syscon.txt | 13 +++++++++++++
>  drivers/mfd/syscon.c                             |  3 +++
>  2 files changed, 16 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/mfd/syscon.txt b/Documentation/devicetree/bindings/mfd/syscon.txt
> index fe8150b..0c6b497 100644
> --- a/Documentation/devicetree/bindings/mfd/syscon.txt
> +++ b/Documentation/devicetree/bindings/mfd/syscon.txt
> @@ -9,12 +9,25 @@ 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 controlled exclusively through syscon registers,
> +or even bitfields in shared syscon registers, can also be added as child nodes
> +to the syscon device node. These devices can implicitly assume their parent
> +node is a syscon provider without referencing it explicitly via phandle.
> +In this case, the syscon node should have #address-cells = <1> and
> +#size-cells = <0> or <1> 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 or 1.
> +
>  Examples:
>  gpr: iomuxc-gpr@020e0000 {
> +	#address-cells = <1>;
> +	#size-cells = <0>;
>  	compatible = "fsl,imx6q-iomuxc-gpr", "syscon";
>  	reg = <0x020e0000 0x38>;
>  };
> diff --git a/drivers/mfd/syscon.c b/drivers/mfd/syscon.c
> index ca15878..38da178 100644
> --- a/drivers/mfd/syscon.c
> +++ b/drivers/mfd/syscon.c
> @@ -155,6 +155,9 @@ static int syscon_probe(struct platform_device *pdev)
>  
>  	dev_dbg(dev, "regmap %pR registered\n", res);
>  
> +	if (!of_device_is_compatible(pdev->dev.of_node, "simple-bus"))
> +		of_platform_populate(pdev->dev.of_node, NULL, NULL, &pdev->dev);
> +
>  	return 0;
>  }
>  



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] mfd: syscon: add child device support
@ 2014-11-17  2:18   ` Flora Fu
  0 siblings, 0 replies; 4+ messages in thread
From: Flora Fu @ 2014-11-17  2:18 UTC (permalink / raw)
  To: Philipp Zabel
  Cc: Rob Herring, Lee Jones, Arnd Bergmann, Pawel Moll, Mark Rutland,
	linux-kernel, devicetree, kernel, srv_heupstream

Hi, Philipp,

How is the status of syscon patch in
https://lkml.org/lkml/2014/5/27/422 ?
Will this patch be accepted in feature release 3.19?

Thanks,
Flora

On Mon, 2014-11-03 at 10:16 +0100, Philipp Zabel 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
> 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>
> ---
> Changes since v1:
>  - Reworded binding documentation to allow #size-cells = <1>, which is useful
>    for syscon children that are controlled through a (possibly shared) register
>    range.
> ---
>  Documentation/devicetree/bindings/mfd/syscon.txt | 13 +++++++++++++
>  drivers/mfd/syscon.c                             |  3 +++
>  2 files changed, 16 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/mfd/syscon.txt b/Documentation/devicetree/bindings/mfd/syscon.txt
> index fe8150b..0c6b497 100644
> --- a/Documentation/devicetree/bindings/mfd/syscon.txt
> +++ b/Documentation/devicetree/bindings/mfd/syscon.txt
> @@ -9,12 +9,25 @@ 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 controlled exclusively through syscon registers,
> +or even bitfields in shared syscon registers, can also be added as child nodes
> +to the syscon device node. These devices can implicitly assume their parent
> +node is a syscon provider without referencing it explicitly via phandle.
> +In this case, the syscon node should have #address-cells = <1> and
> +#size-cells = <0> or <1> 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 or 1.
> +
>  Examples:
>  gpr: iomuxc-gpr@020e0000 {
> +	#address-cells = <1>;
> +	#size-cells = <0>;
>  	compatible = "fsl,imx6q-iomuxc-gpr", "syscon";
>  	reg = <0x020e0000 0x38>;
>  };
> diff --git a/drivers/mfd/syscon.c b/drivers/mfd/syscon.c
> index ca15878..38da178 100644
> --- a/drivers/mfd/syscon.c
> +++ b/drivers/mfd/syscon.c
> @@ -155,6 +155,9 @@ static int syscon_probe(struct platform_device *pdev)
>  
>  	dev_dbg(dev, "regmap %pR registered\n", res);
>  
> +	if (!of_device_is_compatible(pdev->dev.of_node, "simple-bus"))
> +		of_platform_populate(pdev->dev.of_node, NULL, NULL, &pdev->dev);
> +
>  	return 0;
>  }
>  

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] mfd: syscon: add child device support
  2014-11-03  9:16 [PATCH v2] mfd: syscon: add child device support Philipp Zabel
  2014-11-17  2:18   ` Flora Fu
@ 2014-11-24 11:11 ` Philipp Zabel
  1 sibling, 0 replies; 4+ messages in thread
From: Philipp Zabel @ 2014-11-24 11:11 UTC (permalink / raw)
  To: Rob Herring
  Cc: Lee Jones, Arnd Bergmann, Pawel Moll, Mark Rutland, Flora Fu,
	linux-kernel, devicetree, kernel

Hi,

On Mon, 2014-11-03 at 10:16 +0100, Philipp Zabel 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
> 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.

Could I please get an ack for the device tree binding change so the MFD
maintainers can take this patch? I'd like to queue the Mediatek reset
driver, which depends on this.

regards
Philipp

> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
> ---
> Changes since v1:
>  - Reworded binding documentation to allow #size-cells = <1>, which is useful
>    for syscon children that are controlled through a (possibly shared) register
>    range.
> ---
>  Documentation/devicetree/bindings/mfd/syscon.txt | 13 +++++++++++++
>  drivers/mfd/syscon.c                             |  3 +++
>  2 files changed, 16 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/mfd/syscon.txt b/Documentation/devicetree/bindings/mfd/syscon.txt
> index fe8150b..0c6b497 100644
> --- a/Documentation/devicetree/bindings/mfd/syscon.txt
> +++ b/Documentation/devicetree/bindings/mfd/syscon.txt
> @@ -9,12 +9,25 @@ 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 controlled exclusively through syscon registers,
> +or even bitfields in shared syscon registers, can also be added as child nodes
> +to the syscon device node. These devices can implicitly assume their parent
> +node is a syscon provider without referencing it explicitly via phandle.
> +In this case, the syscon node should have #address-cells = <1> and
> +#size-cells = <0> or <1> 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 or 1.
> +
>  Examples:
>  gpr: iomuxc-gpr@020e0000 {
> +	#address-cells = <1>;
> +	#size-cells = <0>;
>  	compatible = "fsl,imx6q-iomuxc-gpr", "syscon";
>  	reg = <0x020e0000 0x38>;
>  };
> diff --git a/drivers/mfd/syscon.c b/drivers/mfd/syscon.c
> index ca15878..38da178 100644
> --- a/drivers/mfd/syscon.c
> +++ b/drivers/mfd/syscon.c
> @@ -155,6 +155,9 @@ static int syscon_probe(struct platform_device *pdev)
>  
>  	dev_dbg(dev, "regmap %pR registered\n", res);
>  
> +	if (!of_device_is_compatible(pdev->dev.of_node, "simple-bus"))
> +		of_platform_populate(pdev->dev.of_node, NULL, NULL, &pdev->dev);
> +
>  	return 0;
>  }
>  



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-11-24 11:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-03  9:16 [PATCH v2] mfd: syscon: add child device support Philipp Zabel
2014-11-17  2:18 ` Flora Fu
2014-11-17  2:18   ` Flora Fu
2014-11-24 11:11 ` Philipp Zabel

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.