LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH v2 00/10] ARM: berlin: refactor chip and system controllers
@ 2015-03-06 15:05 Antoine Tenart
  2015-03-06 15:05 ` [PATCH v2 01/10] Documentation: bindings: update the Berlin controllers documentation Antoine Tenart
                   ` (10 more replies)
  0 siblings, 11 replies; 25+ messages in thread
From: Antoine Tenart @ 2015-03-06 15:05 UTC (permalink / raw)
  To: sebastian.hesselbarth, sameo, lee.jones, p.zabel, linus.walleij
  Cc: Antoine Tenart, jszhang, zmxu, linux-arm-kernel, linux-kernel

Hi,

Marvell Berlin SoCs have a chip control register set providing several
individual registers dealing with various controllers (pinctrl, reset,
clk). This chip controller is described by a single DT node since the
individual registers are spread among the chip control register bank.

Marvell Berlin also have a system control register set providing several
individual registers for pinctrl or adc.

Prior to this series, there was no proper way of probing properly the
devices using one of the chip and system controller nodes. The pinctrl
driver was probed using the DT and the reset controller had an initcall.

This series aims to handle these two nodes correctly, by using the newly
available simple-mfd compatible, to register all the sub-devices. Syscon
is also used to provide a regmap to the sub-node drivers, so that they
can access the registers of the controllers safely. In addition, the
clock driver will need the regmap early during the boot, so syscon is a
good choice here.

Reworks were done in the Berlin pin controller and in the Berlin reset
driver, to take the changes into account (proper compatibles, syscon
helpers, regmap use).

The actual clock driver still works with these modifications, and a
dedicated series will follow to convert the Berlin clock drivers to use
the regmap provided by syscon.

Applies on top of v4.0-rc1 and [1]. Tested on the Marvell BG2Q DMP.

Thanks!

Antoine

[1] https://patchwork.kernel.org/patch/5920831/

Changes since v1:
	- Removed the custom MFD driver for Berlin and use simple-mfd
	  instead.

Antoine Tenart (10):
  Documentation: bindings: update the Berlin controllers documentation
  ARM: berlin: select MFD_SYSCON by default
  reset: berlin: convert to a platform driver
  Documentation: bindings: move the Berlin reset documentation
  pinctrl: berlin: use the regmap provided by syscon
  pinctrl: berlin: use proper compatibles
  Documentation: bindings: move the Berlin pinctrl documentation
  ARM: berlin: rework chip and system controller nodes for BG2
  ARM: berlin: rework chip and system controller nodes for BG2CD
  ARM: berlin: rework chip and system controller nodes for BG2Q

 .../devicetree/bindings/arm/marvell,berlin.txt     | 73 +++++-----------------
 .../devicetree/bindings/pinctrl/berlin,pinctrl.txt | 43 +++++++++++++
 .../devicetree/bindings/reset/berlin,reset.txt     | 23 +++++++
 arch/arm/boot/dts/berlin2.dtsi                     | 50 +++++++++------
 arch/arm/boot/dts/berlin2cd.dtsi                   | 32 +++++++---
 arch/arm/boot/dts/berlin2q.dtsi                    | 70 ++++++++++++---------
 arch/arm/mach-berlin/Kconfig                       |  1 +
 drivers/pinctrl/berlin/berlin-bg2.c                | 26 +-------
 drivers/pinctrl/berlin/berlin-bg2cd.c              | 26 +-------
 drivers/pinctrl/berlin/berlin-bg2q.c               | 26 +-------
 drivers/pinctrl/berlin/berlin.c                    |  9 ++-
 drivers/reset/reset-berlin.c                       | 71 ++++++++-------------
 12 files changed, 216 insertions(+), 234 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/pinctrl/berlin,pinctrl.txt
 create mode 100644 Documentation/devicetree/bindings/reset/berlin,reset.txt

-- 
2.3.1


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

* [PATCH v2 01/10] Documentation: bindings: update the Berlin controllers documentation
  2015-03-06 15:05 [PATCH v2 00/10] ARM: berlin: refactor chip and system controllers Antoine Tenart
@ 2015-03-06 15:05 ` Antoine Tenart
  2015-03-06 15:05 ` [PATCH v2 02/10] ARM: berlin: select MFD_SYSCON by default Antoine Tenart
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 25+ messages in thread
From: Antoine Tenart @ 2015-03-06 15:05 UTC (permalink / raw)
  To: sebastian.hesselbarth
  Cc: Antoine Tenart, jszhang, zmxu, linux-arm-kernel, linux-kernel

We're moving from a single node for multiple devices to a node with one
sub-node per sub-device, registered by simple-mfd. Update the
documentation to reflect the changes.

Signed-off-by: Antoine Tenart <antoine.tenart@free-electrons.com>
---
 .../devicetree/bindings/arm/marvell,berlin.txt     | 26 +++++++++++++---------
 1 file changed, 16 insertions(+), 10 deletions(-)

diff --git a/Documentation/devicetree/bindings/arm/marvell,berlin.txt b/Documentation/devicetree/bindings/arm/marvell,berlin.txt
index a99eb9eb14c0..3a7fce4dc4af 100644
--- a/Documentation/devicetree/bindings/arm/marvell,berlin.txt
+++ b/Documentation/devicetree/bindings/arm/marvell,berlin.txt
@@ -49,10 +49,13 @@ chip control registers, so there should be a single DT node only providing the
 different functions which are described below.
 
 Required properties:
-- compatible: shall be one of
-	"marvell,berlin2-chip-ctrl" for BG2
-	"marvell,berlin2cd-chip-ctrl" for BG2CD
-	"marvell,berlin2q-chip-ctrl" for BG2Q
+- compatible:
+	* the first value should be one of:
+		"marvell,berlin2-chip-ctrl" for BG2
+		"marvell,berlin2cd-chip-ctrl" for BG2CD
+		"marvell,berlin2q-chip-ctrl" for BG2Q
+	* the second and third values must be:
+		"simple-mfd", "syscon"
 - reg: address and length of following register sets for
   BG2/BG2CD: chip control register set
   BG2Q: chip control register set and cpu pll registers
@@ -63,10 +66,13 @@ Marvell Berlin SoCs have a system control register set providing several
 individual registers dealing with pinmux, padmux, and reset.
 
 Required properties:
-- compatible: should be one of
-	"marvell,berlin2-system-ctrl" for BG2
-	"marvell,berlin2cd-system-ctrl" for BG2CD
-	"marvell,berlin2q-system-ctrl" for BG2Q
+- compatible:
+	* the first value should be one of:
+		"marvell,berlin2-system-ctrl" for BG2
+		"marvell,berlin2cd-system-ctrl" for BG2CD
+		"marvell,berlin2q-system-ctrl" for BG2Q
+	* the second and third values must be:
+		"simple-mfd", "syscon"
 - reg: address and length of the system control register set
 
 * Clock provider binding
@@ -118,7 +124,7 @@ Required property:
 Example:
 
 chip: chip-control@ea0000 {
-	compatible = "marvell,berlin2-chip-ctrl";
+	compatible = "marvell,berlin2-chip-ctrl", "simple-mfd", "syscon";
 	#clock-cells = <1>;
 	#reset-cells = <2>;
 	reg = <0xea0000 0x400>;
@@ -132,7 +138,7 @@ chip: chip-control@ea0000 {
 };
 
 sysctrl: system-controller@d000 {
-	compatible = "marvell,berlin2-system-ctrl";
+	compatible = "marvell,berlin2-system-ctrl", "simple-mfd", "syscon";
 	reg = <0xd000 0x100>;
 
 	uart0_pmux: uart0-pmux {
-- 
2.3.1


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

* [PATCH v2 02/10] ARM: berlin: select MFD_SYSCON by default
  2015-03-06 15:05 [PATCH v2 00/10] ARM: berlin: refactor chip and system controllers Antoine Tenart
  2015-03-06 15:05 ` [PATCH v2 01/10] Documentation: bindings: update the Berlin controllers documentation Antoine Tenart
@ 2015-03-06 15:05 ` Antoine Tenart
  2015-03-06 15:05 ` [PATCH v2 03/10] reset: berlin: convert to a platform driver Antoine Tenart
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 25+ messages in thread
From: Antoine Tenart @ 2015-03-06 15:05 UTC (permalink / raw)
  To: sebastian.hesselbarth
  Cc: Antoine Tenart, jszhang, zmxu, linux-arm-kernel, linux-kernel

The chip and system controller nodes handle sub-devices, such as the
clock, pinctrl or reset controllers. The drivers handling them need a
regmap provided by syscon. Select it by default when using a Berlin SoC.

Signed-off-by: Antoine Tenart <antoine.tenart@free-electrons.com>
---
 arch/arm/mach-berlin/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/mach-berlin/Kconfig b/arch/arm/mach-berlin/Kconfig
index 3e40a947f3ea..742d53a5f7f9 100644
--- a/arch/arm/mach-berlin/Kconfig
+++ b/arch/arm/mach-berlin/Kconfig
@@ -6,6 +6,7 @@ menuconfig ARCH_BERLIN
 	select DW_APB_ICTL
 	select DW_APB_TIMER_OF
 	select GENERIC_IRQ_CHIP
+	select MFD_SYSCON
 	select PINCTRL
 
 if ARCH_BERLIN
-- 
2.3.1


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

* [PATCH v2 03/10] reset: berlin: convert to a platform driver
  2015-03-06 15:05 [PATCH v2 00/10] ARM: berlin: refactor chip and system controllers Antoine Tenart
  2015-03-06 15:05 ` [PATCH v2 01/10] Documentation: bindings: update the Berlin controllers documentation Antoine Tenart
  2015-03-06 15:05 ` [PATCH v2 02/10] ARM: berlin: select MFD_SYSCON by default Antoine Tenart
@ 2015-03-06 15:05 ` Antoine Tenart
  2015-03-09 10:16   ` Philipp Zabel
  2015-03-06 15:05 ` [PATCH v2 04/10] Documentation: bindings: move the Berlin reset documentation Antoine Tenart
                   ` (7 subsequent siblings)
  10 siblings, 1 reply; 25+ messages in thread
From: Antoine Tenart @ 2015-03-06 15:05 UTC (permalink / raw)
  To: sebastian.hesselbarth, p.zabel
  Cc: Antoine Tenart, jszhang, zmxu, linux-arm-kernel, linux-kernel

The Berlin reset controller was introduced without being a platform
driver because of a needed DT rework: the node describing the reset
controller also describes the pinctrl and clk controllers...

The DT issue being solved thanks to the addition of the Berlin
controller mfd driver, it is now possible to convert the Berlin reset
driver to a plaftorm driver.

Signed-off-by: Antoine Tenart <antoine.tenart@free-electrons.com>
---
 drivers/reset/reset-berlin.c | 71 +++++++++++++++++---------------------------
 1 file changed, 27 insertions(+), 44 deletions(-)

diff --git a/drivers/reset/reset-berlin.c b/drivers/reset/reset-berlin.c
index f8b48a13cf0b..5f414fa142ff 100644
--- a/drivers/reset/reset-berlin.c
+++ b/drivers/reset/reset-berlin.c
@@ -12,10 +12,12 @@
 #include <linux/delay.h>
 #include <linux/io.h>
 #include <linux/module.h>
+#include <linux/mfd/syscon.h>
 #include <linux/of.h>
 #include <linux/of_address.h>
 #include <linux/platform_device.h>
 #include <linux/reset-controller.h>
+#include <linux/regmap.h>
 #include <linux/slab.h>
 #include <linux/types.h>
 
@@ -25,8 +27,7 @@
 	container_of((p), struct berlin_reset_priv, rcdev)
 
 struct berlin_reset_priv {
-	void __iomem			*base;
-	unsigned int			size;
+	struct regmap			*regmap;
 	struct reset_controller_dev	rcdev;
 };
 
@@ -37,7 +38,7 @@ static int berlin_reset_reset(struct reset_controller_dev *rcdev,
 	int offset = id >> 8;
 	int mask = BIT(id & 0x1f);
 
-	writel(mask, priv->base + offset);
+	regmap_write(priv->regmap, offset, mask);
 
 	/* let the reset be effective */
 	udelay(10);
@@ -52,7 +53,6 @@ static struct reset_control_ops berlin_reset_ops = {
 static int berlin_reset_xlate(struct reset_controller_dev *rcdev,
 			      const struct of_phandle_args *reset_spec)
 {
-	struct berlin_reset_priv *priv = to_berlin_reset_priv(rcdev);
 	unsigned offset, bit;
 
 	if (WARN_ON(reset_spec->args_count != rcdev->of_reset_n_cells))
@@ -61,71 +61,54 @@ static int berlin_reset_xlate(struct reset_controller_dev *rcdev,
 	offset = reset_spec->args[0];
 	bit = reset_spec->args[1];
 
-	if (offset >= priv->size)
-		return -EINVAL;
-
 	if (bit >= BERLIN_MAX_RESETS)
 		return -EINVAL;
 
 	return (offset << 8) | bit;
 }
 
-static int __berlin_reset_init(struct device_node *np)
+static int berlin2_reset_probe(struct platform_device *pdev)
 {
+	struct device_node *parent_np = of_get_parent(pdev->dev.of_node);
 	struct berlin_reset_priv *priv;
-	struct resource res;
-	resource_size_t size;
-	int ret;
 
-	priv = kzalloc(sizeof(*priv), GFP_KERNEL);
+	priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
 	if (!priv)
 		return -ENOMEM;
 
-	ret = of_address_to_resource(np, 0, &res);
-	if (ret)
-		goto err;
-
-	size = resource_size(&res);
-	priv->base = ioremap(res.start, size);
-	if (!priv->base) {
-		ret = -ENOMEM;
-		goto err;
-	}
-	priv->size = size;
+	priv->regmap = syscon_node_to_regmap(parent_np);
+	of_node_put(parent_np);
+	if (IS_ERR(priv->regmap))
+		return PTR_ERR(priv->regmap);
 
 	priv->rcdev.owner = THIS_MODULE;
 	priv->rcdev.ops = &berlin_reset_ops;
-	priv->rcdev.of_node = np;
+	priv->rcdev.of_node = pdev->dev.of_node;
 	priv->rcdev.of_reset_n_cells = 2;
 	priv->rcdev.of_xlate = berlin_reset_xlate;
 
 	reset_controller_register(&priv->rcdev);
 
 	return 0;
-
-err:
-	kfree(priv);
-	return ret;
 }
 
-static const struct of_device_id berlin_reset_of_match[] __initconst = {
-	{ .compatible = "marvell,berlin2-chip-ctrl" },
-	{ .compatible = "marvell,berlin2cd-chip-ctrl" },
-	{ .compatible = "marvell,berlin2q-chip-ctrl" },
+static const struct of_device_id berlin_reset_of_match[] = {
+	{ .compatible = "marvell,berlin2-reset" },
 	{ },
 };
+MODULE_DEVICE_TABLE(of, berlin_reset_of_match);
 
-static int __init berlin_reset_init(void)
-{
-	struct device_node *np;
-	int ret;
+static struct platform_driver berlin_reset_driver = {
+	.probe	= berlin2_reset_probe,
+	.driver	= {
+		.name = "berlin2-reset",
+		.of_match_table = berlin_reset_of_match,
+	},
 
-	for_each_matching_node(np, berlin_reset_of_match) {
-		ret = __berlin_reset_init(np);
-		if (ret)
-			return ret;
-	}
+};
+module_platform_driver(berlin_reset_driver);
 
-	return 0;
-}
-arch_initcall(berlin_reset_init);
+MODULE_AUTHOR("Antoine Tenart <antoine.tenart@free-electrons.com>");
+MODULE_AUTHOR("Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>");
+MODULE_DESCRIPTION("Marvell Berlin reset driver");
+MODULE_LICENSE("GPL");
-- 
2.3.1


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

* [PATCH v2 04/10] Documentation: bindings: move the Berlin reset documentation
  2015-03-06 15:05 [PATCH v2 00/10] ARM: berlin: refactor chip and system controllers Antoine Tenart
                   ` (2 preceding siblings ...)
  2015-03-06 15:05 ` [PATCH v2 03/10] reset: berlin: convert to a platform driver Antoine Tenart
@ 2015-03-06 15:05 ` Antoine Tenart
  2015-03-09 10:16   ` Philipp Zabel
  2015-03-06 15:05 ` [PATCH v2 05/10] pinctrl: berlin: use the regmap provided by syscon Antoine Tenart
                   ` (6 subsequent siblings)
  10 siblings, 1 reply; 25+ messages in thread
From: Antoine Tenart @ 2015-03-06 15:05 UTC (permalink / raw)
  To: sebastian.hesselbarth, p.zabel
  Cc: Antoine Tenart, jszhang, zmxu, linux-arm-kernel, linux-kernel

The Berlin reset documentation was part of the Marvell Berlin SoC
documentation because the Berlin reset configuration was inside the chip
controller. With the recent rework of the chip and system controller
handling (now an MFD driver registers all sub-devices of the two soc and
system controller nodes and each device has its own sub-node), the
documentation of the Berlin reset driver can be moved to the generic
reset documentation directory.

Signed-off-by: Antoine Tenart <antoine.tenart@free-electrons.com>
---
 .../devicetree/bindings/arm/marvell,berlin.txt     | 10 ----------
 .../devicetree/bindings/reset/berlin,reset.txt     | 23 ++++++++++++++++++++++
 2 files changed, 23 insertions(+), 10 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/reset/berlin,reset.txt

diff --git a/Documentation/devicetree/bindings/arm/marvell,berlin.txt b/Documentation/devicetree/bindings/arm/marvell,berlin.txt
index 3a7fce4dc4af..8bf3f2075233 100644
--- a/Documentation/devicetree/bindings/arm/marvell,berlin.txt
+++ b/Documentation/devicetree/bindings/arm/marvell,berlin.txt
@@ -112,21 +112,11 @@ Required subnode-properties:
 - groups: a list of strings describing the group names.
 - function: a string describing the function used to mux the groups.
 
-* Reset controller binding
-
-A reset controller is part of the chip control registers set. The chip control
-node also provides the reset. The register set is not at the same offset between
-Berlin SoCs.
-
-Required property:
-- #reset-cells: must be set to 2
-
 Example:
 
 chip: chip-control@ea0000 {
 	compatible = "marvell,berlin2-chip-ctrl", "simple-mfd", "syscon";
 	#clock-cells = <1>;
-	#reset-cells = <2>;
 	reg = <0xea0000 0x400>;
 	clocks = <&refclk>, <&externaldev 0>;
 	clock-names = "refclk", "video_ext0";
diff --git a/Documentation/devicetree/bindings/reset/berlin,reset.txt b/Documentation/devicetree/bindings/reset/berlin,reset.txt
new file mode 100644
index 000000000000..514fee098b4b
--- /dev/null
+++ b/Documentation/devicetree/bindings/reset/berlin,reset.txt
@@ -0,0 +1,23 @@
+Marvell Berlin reset controller
+===============================
+
+Please also refer to reset.txt in this directory for common reset
+controller binding usage.
+
+The reset controller node must be a sub-node of the chip controller
+node on Berlin SoCs.
+
+Required properties:
+- compatible: should be "marvell,berlin2-reset"
+- #reset-cells: must be set to 2
+
+Example:
+
+chip_rst: reset {
+	compatible = "marvell,berlin2-reset";
+	#reset-cells = <2>;
+};
+
+&usb_phy0 {
+	resets = <&chip_rst 0x104 12>;
+};
-- 
2.3.1


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

* [PATCH v2 05/10] pinctrl: berlin: use the regmap provided by syscon
  2015-03-06 15:05 [PATCH v2 00/10] ARM: berlin: refactor chip and system controllers Antoine Tenart
                   ` (3 preceding siblings ...)
  2015-03-06 15:05 ` [PATCH v2 04/10] Documentation: bindings: move the Berlin reset documentation Antoine Tenart
@ 2015-03-06 15:05 ` Antoine Tenart
  2015-04-28 11:30   ` Sebastian Hesselbarth
  2015-05-06 14:28   ` Linus Walleij
  2015-03-06 15:05 ` [PATCH v2 06/10] pinctrl: berlin: use proper compatibles Antoine Tenart
                   ` (5 subsequent siblings)
  10 siblings, 2 replies; 25+ messages in thread
From: Antoine Tenart @ 2015-03-06 15:05 UTC (permalink / raw)
  To: sebastian.hesselbarth, linus.walleij
  Cc: Antoine Tenart, jszhang, zmxu, linux-gpio, linux-arm-kernel,
	linux-kernel

The Berlin pin controller nodes are now sub-nodes of the soc-controller
and the system-controller nodes. The register bank is managed by syscon,
which provides a regmap.

Remove the regmap setup from the Berlin pinctrl driver and use the one
provided by syscon.

Signed-off-by: Antoine Tenart <antoine.tenart@free-electrons.com>
---
 drivers/pinctrl/berlin/berlin-bg2.c   | 22 ----------------------
 drivers/pinctrl/berlin/berlin-bg2cd.c | 22 ----------------------
 drivers/pinctrl/berlin/berlin-bg2q.c  | 22 ----------------------
 drivers/pinctrl/berlin/berlin.c       |  9 ++++++---
 4 files changed, 6 insertions(+), 69 deletions(-)

diff --git a/drivers/pinctrl/berlin/berlin-bg2.c b/drivers/pinctrl/berlin/berlin-bg2.c
index b71a6fffef1b..368ec0b9b8ba 100644
--- a/drivers/pinctrl/berlin/berlin-bg2.c
+++ b/drivers/pinctrl/berlin/berlin-bg2.c
@@ -233,28 +233,6 @@ static int berlin2_pinctrl_probe(struct platform_device *pdev)
 {
 	const struct of_device_id *match =
 		of_match_device(berlin2_pinctrl_match, &pdev->dev);
-	struct regmap_config *rmconfig;
-	struct regmap *regmap;
-	struct resource *res;
-	void __iomem *base;
-
-	rmconfig = devm_kzalloc(&pdev->dev, sizeof(*rmconfig), GFP_KERNEL);
-	if (!rmconfig)
-		return -ENOMEM;
-
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	base = devm_ioremap_resource(&pdev->dev, res);
-	if (IS_ERR(base))
-		return PTR_ERR(base);
-
-	rmconfig->reg_bits = 32,
-	rmconfig->val_bits = 32,
-	rmconfig->reg_stride = 4,
-	rmconfig->max_register = resource_size(res);
-
-	regmap = devm_regmap_init_mmio(&pdev->dev, base, rmconfig);
-	if (IS_ERR(regmap))
-		return PTR_ERR(regmap);
 
 	return berlin_pinctrl_probe(pdev, match->data);
 }
diff --git a/drivers/pinctrl/berlin/berlin-bg2cd.c b/drivers/pinctrl/berlin/berlin-bg2cd.c
index 19ac5a22c947..6b9cae029ef7 100644
--- a/drivers/pinctrl/berlin/berlin-bg2cd.c
+++ b/drivers/pinctrl/berlin/berlin-bg2cd.c
@@ -176,28 +176,6 @@ static int berlin2cd_pinctrl_probe(struct platform_device *pdev)
 {
 	const struct of_device_id *match =
 		of_match_device(berlin2cd_pinctrl_match, &pdev->dev);
-	struct regmap_config *rmconfig;
-	struct regmap *regmap;
-	struct resource *res;
-	void __iomem *base;
-
-	rmconfig = devm_kzalloc(&pdev->dev, sizeof(*rmconfig), GFP_KERNEL);
-	if (!rmconfig)
-		return -ENOMEM;
-
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	base = devm_ioremap_resource(&pdev->dev, res);
-	if (IS_ERR(base))
-		return PTR_ERR(base);
-
-	rmconfig->reg_bits = 32,
-	rmconfig->val_bits = 32,
-	rmconfig->reg_stride = 4,
-	rmconfig->max_register = resource_size(res);
-
-	regmap = devm_regmap_init_mmio(&pdev->dev, base, rmconfig);
-	if (IS_ERR(regmap))
-		return PTR_ERR(regmap);
 
 	return berlin_pinctrl_probe(pdev, match->data);
 }
diff --git a/drivers/pinctrl/berlin/berlin-bg2q.c b/drivers/pinctrl/berlin/berlin-bg2q.c
index bd9662e57ad3..11aa10cc0e3e 100644
--- a/drivers/pinctrl/berlin/berlin-bg2q.c
+++ b/drivers/pinctrl/berlin/berlin-bg2q.c
@@ -395,28 +395,6 @@ static int berlin2q_pinctrl_probe(struct platform_device *pdev)
 {
 	const struct of_device_id *match =
 		of_match_device(berlin2q_pinctrl_match, &pdev->dev);
-	struct regmap_config *rmconfig;
-	struct regmap *regmap;
-	struct resource *res;
-	void __iomem *base;
-
-	rmconfig = devm_kzalloc(&pdev->dev, sizeof(*rmconfig), GFP_KERNEL);
-	if (!rmconfig)
-		return -ENOMEM;
-
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	base = devm_ioremap_resource(&pdev->dev, res);
-	if (IS_ERR(base))
-		return PTR_ERR(base);
-
-	rmconfig->reg_bits = 32,
-	rmconfig->val_bits = 32,
-	rmconfig->reg_stride = 4,
-	rmconfig->max_register = resource_size(res);
-
-	regmap = devm_regmap_init_mmio(&pdev->dev, base, rmconfig);
-	if (IS_ERR(regmap))
-		return PTR_ERR(regmap);
 
 	return berlin_pinctrl_probe(pdev, match->data);
 }
diff --git a/drivers/pinctrl/berlin/berlin.c b/drivers/pinctrl/berlin/berlin.c
index 7f0b0f93242b..2e3a8b8858ec 100644
--- a/drivers/pinctrl/berlin/berlin.c
+++ b/drivers/pinctrl/berlin/berlin.c
@@ -12,6 +12,7 @@
 
 #include <linux/io.h>
 #include <linux/module.h>
+#include <linux/mfd/syscon.h>
 #include <linux/of.h>
 #include <linux/of_address.h>
 #include <linux/of_device.h>
@@ -295,13 +296,15 @@ int berlin_pinctrl_probe(struct platform_device *pdev,
 			 const struct berlin_pinctrl_desc *desc)
 {
 	struct device *dev = &pdev->dev;
+	struct device_node *parent_np = of_get_parent(dev->of_node);
 	struct berlin_pinctrl *pctrl;
 	struct regmap *regmap;
 	int ret;
 
-	regmap = dev_get_regmap(&pdev->dev, NULL);
-	if (!regmap)
-		return -ENODEV;
+	regmap = syscon_node_to_regmap(parent_np);
+	of_node_put(parent_np);
+	if (IS_ERR(regmap))
+		return PTR_ERR(regmap);
 
 	pctrl = devm_kzalloc(dev, sizeof(*pctrl), GFP_KERNEL);
 	if (!pctrl)
-- 
2.3.1


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

* [PATCH v2 06/10] pinctrl: berlin: use proper compatibles
  2015-03-06 15:05 [PATCH v2 00/10] ARM: berlin: refactor chip and system controllers Antoine Tenart
                   ` (4 preceding siblings ...)
  2015-03-06 15:05 ` [PATCH v2 05/10] pinctrl: berlin: use the regmap provided by syscon Antoine Tenart
@ 2015-03-06 15:05 ` Antoine Tenart
  2015-06-10  7:13   ` Linus Walleij
  2015-03-06 15:05 ` [PATCH v2 07/10] Documentation: bindings: move the Berlin pinctrl documentation Antoine Tenart
                   ` (4 subsequent siblings)
  10 siblings, 1 reply; 25+ messages in thread
From: Antoine Tenart @ 2015-03-06 15:05 UTC (permalink / raw)
  To: sebastian.hesselbarth, linus.walleij
  Cc: Antoine Tenart, jszhang, zmxu, linux-gpio, linux-arm-kernel,
	linux-kernel

The Berlin pin-controller driver was sharing the chip and system
controller nodes with the clock and the reset drivers. They all shared
the same compatible. With the introduction of the Marvell Berlin MFD
controller, the Berlin pin-controller driver has now its own node.
Update its compatibles to not share anymore the ones of the chip and
system controllers.

Signed-off-by: Antoine Tenart <antoine.tenart@free-electrons.com>
---
 drivers/pinctrl/berlin/berlin-bg2.c   | 4 ++--
 drivers/pinctrl/berlin/berlin-bg2cd.c | 4 ++--
 drivers/pinctrl/berlin/berlin-bg2q.c  | 4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/pinctrl/berlin/berlin-bg2.c b/drivers/pinctrl/berlin/berlin-bg2.c
index 368ec0b9b8ba..3769eaedf519 100644
--- a/drivers/pinctrl/berlin/berlin-bg2.c
+++ b/drivers/pinctrl/berlin/berlin-bg2.c
@@ -218,11 +218,11 @@ static const struct berlin_pinctrl_desc berlin2_sysmgr_pinctrl_data = {
 
 static const struct of_device_id berlin2_pinctrl_match[] = {
 	{
-		.compatible = "marvell,berlin2-chip-ctrl",
+		.compatible = "marvell,berlin2-soc-pinctrl",
 		.data = &berlin2_soc_pinctrl_data
 	},
 	{
-		.compatible = "marvell,berlin2-system-ctrl",
+		.compatible = "marvell,berlin2-system-pinctrl",
 		.data = &berlin2_sysmgr_pinctrl_data
 	},
 	{}
diff --git a/drivers/pinctrl/berlin/berlin-bg2cd.c b/drivers/pinctrl/berlin/berlin-bg2cd.c
index 6b9cae029ef7..9e11f191d643 100644
--- a/drivers/pinctrl/berlin/berlin-bg2cd.c
+++ b/drivers/pinctrl/berlin/berlin-bg2cd.c
@@ -161,11 +161,11 @@ static const struct berlin_pinctrl_desc berlin2cd_sysmgr_pinctrl_data = {
 
 static const struct of_device_id berlin2cd_pinctrl_match[] = {
 	{
-		.compatible = "marvell,berlin2cd-chip-ctrl",
+		.compatible = "marvell,berlin2cd-soc-pinctrl",
 		.data = &berlin2cd_soc_pinctrl_data
 	},
 	{
-		.compatible = "marvell,berlin2cd-system-ctrl",
+		.compatible = "marvell,berlin2cd-system-pinctrl",
 		.data = &berlin2cd_sysmgr_pinctrl_data
 	},
 	{}
diff --git a/drivers/pinctrl/berlin/berlin-bg2q.c b/drivers/pinctrl/berlin/berlin-bg2q.c
index 11aa10cc0e3e..ba7a8a8ad010 100644
--- a/drivers/pinctrl/berlin/berlin-bg2q.c
+++ b/drivers/pinctrl/berlin/berlin-bg2q.c
@@ -380,11 +380,11 @@ static const struct berlin_pinctrl_desc berlin2q_sysmgr_pinctrl_data = {
 
 static const struct of_device_id berlin2q_pinctrl_match[] = {
 	{
-		.compatible = "marvell,berlin2q-chip-ctrl",
+		.compatible = "marvell,berlin2q-soc-pinctrl",
 		.data = &berlin2q_soc_pinctrl_data,
 	},
 	{
-		.compatible = "marvell,berlin2q-system-ctrl",
+		.compatible = "marvell,berlin2q-system-pinctrl",
 		.data = &berlin2q_sysmgr_pinctrl_data,
 	},
 	{}
-- 
2.3.1


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

* [PATCH v2 07/10] Documentation: bindings: move the Berlin pinctrl documentation
  2015-03-06 15:05 [PATCH v2 00/10] ARM: berlin: refactor chip and system controllers Antoine Tenart
                   ` (5 preceding siblings ...)
  2015-03-06 15:05 ` [PATCH v2 06/10] pinctrl: berlin: use proper compatibles Antoine Tenart
@ 2015-03-06 15:05 ` Antoine Tenart
  2015-06-10  7:14   ` Linus Walleij
  2015-03-06 15:05 ` [PATCH v2 08/10] ARM: berlin: rework chip and system controller nodes for BG2 Antoine Tenart
                   ` (3 subsequent siblings)
  10 siblings, 1 reply; 25+ messages in thread
From: Antoine Tenart @ 2015-03-06 15:05 UTC (permalink / raw)
  To: sebastian.hesselbarth, linus.walleij
  Cc: Antoine Tenart, jszhang, zmxu, linux-gpio, linux-arm-kernel,
	linux-kernel

The Berlin pinctrl documentation was part of the Marvell Berlin SoC
documentation because the Berlin pinctrl configuration was inside the
chip and the system controllers. With the recent rework of the chip and
system controller handling (now an MFD driver registers all sub-devices
of the two soc and system controller nodes and each device has its own
sub-node), the documentation of the Berlin pinctrl driver can be moved
to the generic pinctrl documentation directory.

Signed-off-by: Antoine Tenart <antoine.tenart@free-electrons.com>
---
 .../devicetree/bindings/arm/marvell,berlin.txt     | 37 -------------------
 .../devicetree/bindings/pinctrl/berlin,pinctrl.txt | 43 ++++++++++++++++++++++
 2 files changed, 43 insertions(+), 37 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/pinctrl/berlin,pinctrl.txt

diff --git a/Documentation/devicetree/bindings/arm/marvell,berlin.txt b/Documentation/devicetree/bindings/arm/marvell,berlin.txt
index 8bf3f2075233..ece73c6ad973 100644
--- a/Documentation/devicetree/bindings/arm/marvell,berlin.txt
+++ b/Documentation/devicetree/bindings/arm/marvell,berlin.txt
@@ -95,23 +95,6 @@ Clocks provided by core clocks shall be referenced by a clock specifier
 indexing one of the provided clocks. Refer to dt-bindings/clock/berlin<soc>.h
 for the corresponding index mapping.
 
-* Pin controller binding
-
-Pin control registers are part of both register sets, chip control and system
-control. The pins controlled are organized in groups, so no actual pin
-information is needed.
-
-A pin-controller node should contain subnodes representing the pin group
-configurations, one per function. Each subnode has the group name and the muxing
-function used.
-
-Be aware the Marvell Berlin datasheets use the keyword 'mode' for what is called
-a 'function' in the pin-controller subsystem.
-
-Required subnode-properties:
-- groups: a list of strings describing the group names.
-- function: a string describing the function used to mux the groups.
-
 Example:
 
 chip: chip-control@ea0000 {
@@ -120,29 +103,9 @@ chip: chip-control@ea0000 {
 	reg = <0xea0000 0x400>;
 	clocks = <&refclk>, <&externaldev 0>;
 	clock-names = "refclk", "video_ext0";
-
-	spi1_pmux: spi1-pmux {
-		groups = "G0";
-		function = "spi1";
-	};
 };
 
 sysctrl: system-controller@d000 {
 	compatible = "marvell,berlin2-system-ctrl", "simple-mfd", "syscon";
 	reg = <0xd000 0x100>;
-
-	uart0_pmux: uart0-pmux {
-		groups = "GSM4";
-		function = "uart0";
-	};
-
-	uart1_pmux: uart1-pmux {
-		groups = "GSM5";
-		function = "uart1";
-	};
-
-	uart2_pmux: uart2-pmux {
-		groups = "GSM3";
-		function = "uart2";
-	};
 };
diff --git a/Documentation/devicetree/bindings/pinctrl/berlin,pinctrl.txt b/Documentation/devicetree/bindings/pinctrl/berlin,pinctrl.txt
new file mode 100644
index 000000000000..a8bb5e26019c
--- /dev/null
+++ b/Documentation/devicetree/bindings/pinctrl/berlin,pinctrl.txt
@@ -0,0 +1,43 @@
+* Pin-controller driver for the Marvell Berlin SoCs
+
+Pin control registers are part of both chip controller and system
+controller register sets. Pin controller nodes should be a sub-node of
+either the chip controller or system controller node. The pins
+controlled are organized in groups, so no actual pin information is
+needed.
+
+A pin-controller node should contain subnodes representing the pin group
+configurations, one per function. Each subnode has the group name and
+the muxing function used.
+
+Be aware the Marvell Berlin datasheets use the keyword 'mode' for what
+is called a 'function' in the pin-controller subsystem.
+
+Required properties:
+- compatible: should be one of:
+	"marvell,berlin2-soc-pinctrl",
+	"marvell,berlin2-system-pinctrl",
+	"marvell,berlin2cd-soc-pinctrl",
+	"marvell,berlin2cd-system-pinctrl",
+	"marvell,berlin2q-soc-pinctrl",
+	"marvell,berlin2q-system-pinctrl"
+
+Required subnode-properties:
+- groups: a list of strings describing the group names.
+- function: a string describing the function used to mux the groups.
+
+Example:
+
+sys_pinctrl: pin-controller {
+	compatible = "marvell,berlin2q-system-pinctrl";
+
+	uart0_pmux: uart0-pmux {
+		groups = "GSM12";
+		function = "uart0";
+	};
+};
+
+&uart0 {
+	pinctrl-0 = <&uart0_pmux>;
+	pinctrl-names = "default";
+};
-- 
2.3.1


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

* [PATCH v2 08/10] ARM: berlin: rework chip and system controller nodes for BG2
  2015-03-06 15:05 [PATCH v2 00/10] ARM: berlin: refactor chip and system controllers Antoine Tenart
                   ` (6 preceding siblings ...)
  2015-03-06 15:05 ` [PATCH v2 07/10] Documentation: bindings: move the Berlin pinctrl documentation Antoine Tenart
@ 2015-03-06 15:05 ` Antoine Tenart
  2015-03-06 15:05 ` [PATCH v2 09/10] ARM: berlin: rework chip and system controller nodes for BG2CD Antoine Tenart
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 25+ messages in thread
From: Antoine Tenart @ 2015-03-06 15:05 UTC (permalink / raw)
  To: sebastian.hesselbarth
  Cc: Antoine Tenart, jszhang, zmxu, linux-arm-kernel, linux-kernel

The chip and system controller nodes are now handled by the Berlin
controller mfd driver. Its sub-devices are then registered by the mfd
driver and let the drivers be probed properly, using their own
sub-nodes.

Rework the device tree to take this changes into account.

Signed-off-by: Antoine Tenart <antoine.tenart@free-electrons.com>
---
 arch/arm/boot/dts/berlin2.dtsi | 50 ++++++++++++++++++++++++++----------------
 1 file changed, 31 insertions(+), 19 deletions(-)

diff --git a/arch/arm/boot/dts/berlin2.dtsi b/arch/arm/boot/dts/berlin2.dtsi
index 63d00a63cfa6..fbe5c6b6502d 100644
--- a/arch/arm/boot/dts/berlin2.dtsi
+++ b/arch/arm/boot/dts/berlin2.dtsi
@@ -350,17 +350,25 @@
 			};
 		};
 
-		chip: chip-control@ea0000 {
-			compatible = "marvell,berlin2-chip-ctrl";
-			#clock-cells = <1>;
-			#reset-cells = <2>;
+		chip: chip-controller@ea0000 {
+			compatible = "marvell,berlin2-chip-ctrl", "simple-mfd", "syscon";
 			reg = <0xea0000 0x400>;
+			#clock-cells = <1>;
 			clocks = <&refclk>;
 			clock-names = "refclk";
 
-			emmc_pmux: emmc-pmux {
-				groups = "G26";
-				function = "emmc";
+			soc_pinctrl: pin-controller {
+				compatible = "marvell,berlin2-soc-pinctrl";
+
+				emmc_pmux: emmc-pmux {
+					groups = "G26";
+					function = "emmc";
+				};
+			};
+
+			chip_rst: reset {
+				compatible = "marvell,berlin2-reset";
+				#reset-cells = <2>;
 			};
 		};
 
@@ -442,22 +450,26 @@
 			};
 
 			sysctrl: system-controller@d000 {
-				compatible = "marvell,berlin2-system-ctrl";
+				compatible = "marvell,berlin2-system-ctrl", "simple-mfd", "syscon";
 				reg = <0xd000 0x100>;
 
-				uart0_pmux: uart0-pmux {
-					groups = "GSM4";
-					function = "uart0";
-				};
+				sys_pinctrl: pin-controller {
+					compatible = "marvell,berlin2-system-pinctrl";
 
-				uart1_pmux: uart1-pmux {
-					groups = "GSM5";
-					function = "uart1";
-				};
+					uart0_pmux: uart0-pmux {
+						groups = "GSM4";
+						function = "uart0";
+					};
+
+					uart1_pmux: uart1-pmux {
+						groups = "GSM5";
+						function = "uart1";
+					};
 
-				uart2_pmux: uart2-pmux {
-					groups = "GSM3";
-					function = "uart2";
+					uart2_pmux: uart2-pmux {
+						groups = "GSM3";
+						function = "uart2";
+					};
 				};
 			};
 
-- 
2.3.1


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

* [PATCH v2 09/10] ARM: berlin: rework chip and system controller nodes for BG2CD
  2015-03-06 15:05 [PATCH v2 00/10] ARM: berlin: refactor chip and system controllers Antoine Tenart
                   ` (7 preceding siblings ...)
  2015-03-06 15:05 ` [PATCH v2 08/10] ARM: berlin: rework chip and system controller nodes for BG2 Antoine Tenart
@ 2015-03-06 15:05 ` Antoine Tenart
  2015-03-06 15:05 ` [PATCH v2 10/10] ARM: berlin: rework chip and system controller nodes for BG2Q Antoine Tenart
  2015-03-09 17:13 ` [PATCH v2 00/10] ARM: berlin: refactor chip and system controllers Linus Walleij
  10 siblings, 0 replies; 25+ messages in thread
From: Antoine Tenart @ 2015-03-06 15:05 UTC (permalink / raw)
  To: sebastian.hesselbarth
  Cc: Antoine Tenart, jszhang, zmxu, linux-arm-kernel, linux-kernel

The chip and system controller nodes are now handled by the Berlin
controller mfd driver. Its sub-devices are then registered by the mfd
driver and let the drivers be probed properly, using their own
sub-nodes.

Rework the device tree to take this changes into account.

Signed-off-by: Antoine Tenart <antoine.tenart@free-electrons.com>
---
 arch/arm/boot/dts/berlin2cd.dtsi | 32 ++++++++++++++++++++++----------
 1 file changed, 22 insertions(+), 10 deletions(-)

diff --git a/arch/arm/boot/dts/berlin2cd.dtsi b/arch/arm/boot/dts/berlin2cd.dtsi
index 81b670ac494a..4bca01ee94d6 100644
--- a/arch/arm/boot/dts/berlin2cd.dtsi
+++ b/arch/arm/boot/dts/berlin2cd.dtsi
@@ -84,7 +84,7 @@
 			compatible = "marvell,berlin2cd-usb-phy";
 			reg = <0xb74000 0x128>;
 			#phy-cells = <0>;
-			resets = <&chip 0x178 23>;
+			resets = <&chip_rst 0x178 23>;
 			status = "disabled";
 		};
 
@@ -92,7 +92,7 @@
 			compatible = "marvell,berlin2cd-usb-phy";
 			reg = <0xb78000 0x128>;
 			#phy-cells = <0>;
-			resets = <&chip 0x178 24>;
+			resets = <&chip_rst 0x178 24>;
 			status = "disabled";
 		};
 
@@ -294,17 +294,25 @@
 			};
 		};
 
-		chip: chip-control@ea0000 {
-			compatible = "marvell,berlin2cd-chip-ctrl";
-			#clock-cells = <1>;
-			#reset-cells = <2>;
+		chip: chip-controller@ea0000 {
+			compatible = "marvell,berlin2cd-chip-ctrl", "simple-mfd", "syscon";
 			reg = <0xea0000 0x400>;
+			#clock-cells = <1>;
 			clocks = <&refclk>;
 			clock-names = "refclk";
 
-			uart0_pmux: uart0-pmux {
-				groups = "G6";
-				function = "uart0";
+			soc_pinctrl: pin-controller {
+				compatible = "marvell,berlin2cd-soc-pinctrl";
+
+				uart0_pmux: uart0-pmux {
+					groups = "G6";
+					function = "uart0";
+				};
+			};
+
+			chip_rst: reset {
+				compatible = "marvell,berlin2-reset";
+				#reset-cells = <2>;
 			};
 		};
 
@@ -389,8 +397,12 @@
 			};
 
 			sysctrl: system-controller@d000 {
-				compatible = "marvell,berlin2cd-system-ctrl";
+				compatible = "marvell,berlin2cd-system-ctrl", "simple-mfd", "syscon";
 				reg = <0xd000 0x100>;
+
+				sys_pinctrl: pin-controller {
+					compatible = "marvell,berlin2cd-system-pinctrl";
+				};
 			};
 
 			sic: interrupt-controller@e000 {
-- 
2.3.1


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

* [PATCH v2 10/10] ARM: berlin: rework chip and system controller nodes for BG2Q
  2015-03-06 15:05 [PATCH v2 00/10] ARM: berlin: refactor chip and system controllers Antoine Tenart
                   ` (8 preceding siblings ...)
  2015-03-06 15:05 ` [PATCH v2 09/10] ARM: berlin: rework chip and system controller nodes for BG2CD Antoine Tenart
@ 2015-03-06 15:05 ` Antoine Tenart
  2015-03-09 17:13 ` [PATCH v2 00/10] ARM: berlin: refactor chip and system controllers Linus Walleij
  10 siblings, 0 replies; 25+ messages in thread
From: Antoine Tenart @ 2015-03-06 15:05 UTC (permalink / raw)
  To: sebastian.hesselbarth
  Cc: Antoine Tenart, jszhang, zmxu, linux-arm-kernel, linux-kernel

The chip and system controller nodes are now handled by the Berlin
controller mfd driver. Its sub-devices are then registered by the mfd
driver and let the drivers be probed properly, using their own
sub-nodes.

Rework the device tree to take this changes into account.

Signed-off-by: Antoine Tenart <antoine.tenart@free-electrons.com>
---
 arch/arm/boot/dts/berlin2q.dtsi | 70 ++++++++++++++++++++++++-----------------
 1 file changed, 41 insertions(+), 29 deletions(-)

diff --git a/arch/arm/boot/dts/berlin2q.dtsi b/arch/arm/boot/dts/berlin2q.dtsi
index be5397288d24..006d382d44ff 100644
--- a/arch/arm/boot/dts/berlin2q.dtsi
+++ b/arch/arm/boot/dts/berlin2q.dtsi
@@ -127,7 +127,7 @@
 			compatible = "marvell,berlin2-usb-phy";
 			reg = <0xa2f400 0x128>;
 			#phy-cells = <0>;
-			resets = <&chip 0x104 14>;
+			resets = <&chip_rst 0x104 14>;
 			status = "disabled";
 		};
 
@@ -145,7 +145,7 @@
 			compatible = "marvell,berlin2-usb-phy";
 			reg = <0xb74000 0x128>;
 			#phy-cells = <0>;
-			resets = <&chip 0x104 12>;
+			resets = <&chip_rst 0x104 12>;
 			status = "disabled";
 		};
 
@@ -359,22 +359,30 @@
 			};
 		};
 
-		chip: chip-control@ea0000 {
-			compatible = "marvell,berlin2q-chip-ctrl";
-			#clock-cells = <1>;
-			#reset-cells = <2>;
+		chip: chip-controller@ea0000 {
+			compatible = "marvell,berlin2q-chip-ctrl", "simple-mfd", "syscon";
 			reg = <0xea0000 0x400>, <0xdd0170 0x10>;
+			#clock-cells = <1>;
 			clocks = <&refclk>;
 			clock-names = "refclk";
 
-			twsi0_pmux: twsi0-pmux {
-				groups = "G6";
-				function = "twsi0";
+			soc_pinctrl: pin-controller {
+				compatible = "marvell,berlin2q-soc-pinctrl";
+
+				twsi0_pmux: twsi0-pmux {
+					groups = "G6";
+					function = "twsi0";
+				};
+
+				twsi1_pmux: twsi1-pmux {
+					groups = "G7";
+					function = "twsi1";
+				};
 			};
 
-			twsi1_pmux: twsi1-pmux {
-				groups = "G7";
-				function = "twsi1";
+			chip_rst: reset {
+				compatible = "marvell,berlin2-reset";
+				#reset-cells = <2>;
 			};
 		};
 
@@ -525,28 +533,32 @@
 				};
 			};
 
-			sysctrl: pin-controller@d000 {
-				compatible = "marvell,berlin2q-system-ctrl";
+			sysctrl: system-controller@d000 {
+				compatible = "marvell,berlin2q-system-ctrl", "simple-mfd", "syscon";
 				reg = <0xd000 0x100>;
 
-				uart0_pmux: uart0-pmux {
-					groups = "GSM12";
-					function = "uart0";
-				};
+				sys_pinctrl: pin-controller {
+					compatible = "marvell,berlin2q-system-pinctrl";
 
-				uart1_pmux: uart1-pmux {
-					groups = "GSM14";
-					function = "uart1";
-				};
+					uart0_pmux: uart0-pmux {
+						groups = "GSM12";
+						function = "uart0";
+					};
 
-				twsi2_pmux: twsi2-pmux {
-					groups = "GSM13";
-					function = "twsi2";
-				};
+					uart1_pmux: uart1-pmux {
+						groups = "GSM14";
+						function = "uart1";
+					};
+
+					twsi2_pmux: twsi2-pmux {
+						groups = "GSM13";
+						function = "twsi2";
+					};
 
-				twsi3_pmux: twsi3-pmux {
-					groups = "GSM14";
-					function = "twsi3";
+					twsi3_pmux: twsi3-pmux {
+						groups = "GSM14";
+						function = "twsi3";
+					};
 				};
 			};
 
-- 
2.3.1


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

* Re: [PATCH v2 03/10] reset: berlin: convert to a platform driver
  2015-03-06 15:05 ` [PATCH v2 03/10] reset: berlin: convert to a platform driver Antoine Tenart
@ 2015-03-09 10:16   ` Philipp Zabel
  2015-03-10  9:57     ` Antoine Tenart
  0 siblings, 1 reply; 25+ messages in thread
From: Philipp Zabel @ 2015-03-09 10:16 UTC (permalink / raw)
  To: Antoine Tenart
  Cc: sebastian.hesselbarth, jszhang, zmxu, linux-arm-kernel, linux-kernel

Hi Antoine,

Am Freitag, den 06.03.2015, 16:05 +0100 schrieb Antoine Tenart:
> The Berlin reset controller was introduced without being a platform
> driver because of a needed DT rework: the node describing the reset
> controller also describes the pinctrl and clk controllers...
> 
> The DT issue being solved thanks to the addition of the Berlin
> controller mfd driver, it is now possible to convert the Berlin reset
> driver to a plaftorm driver.
> 
> Signed-off-by: Antoine Tenart <antoine.tenart@free-electrons.com>

Looks good to me. Do you want to merge this together with the rest of
the series, or should I queue the reset patch?

Acked-by: Philipp Zabel <p.zabel@pengutronix.de>

regards
Philipp

> ---
>  drivers/reset/reset-berlin.c | 71 +++++++++++++++++---------------------------
>  1 file changed, 27 insertions(+), 44 deletions(-)
> 
> diff --git a/drivers/reset/reset-berlin.c b/drivers/reset/reset-berlin.c
> index f8b48a13cf0b..5f414fa142ff 100644
> --- a/drivers/reset/reset-berlin.c
> +++ b/drivers/reset/reset-berlin.c
> @@ -12,10 +12,12 @@
>  #include <linux/delay.h>
>  #include <linux/io.h>
>  #include <linux/module.h>
> +#include <linux/mfd/syscon.h>
>  #include <linux/of.h>
>  #include <linux/of_address.h>
>  #include <linux/platform_device.h>
>  #include <linux/reset-controller.h>
> +#include <linux/regmap.h>
>  #include <linux/slab.h>
>  #include <linux/types.h>
>  
> @@ -25,8 +27,7 @@
>  	container_of((p), struct berlin_reset_priv, rcdev)
>  
>  struct berlin_reset_priv {
> -	void __iomem			*base;
> -	unsigned int			size;
> +	struct regmap			*regmap;
>  	struct reset_controller_dev	rcdev;
>  };
>  
> @@ -37,7 +38,7 @@ static int berlin_reset_reset(struct reset_controller_dev *rcdev,
>  	int offset = id >> 8;
>  	int mask = BIT(id & 0x1f);
>  
> -	writel(mask, priv->base + offset);
> +	regmap_write(priv->regmap, offset, mask);
>  
>  	/* let the reset be effective */
>  	udelay(10);
> @@ -52,7 +53,6 @@ static struct reset_control_ops berlin_reset_ops = {
>  static int berlin_reset_xlate(struct reset_controller_dev *rcdev,
>  			      const struct of_phandle_args *reset_spec)
>  {
> -	struct berlin_reset_priv *priv = to_berlin_reset_priv(rcdev);
>  	unsigned offset, bit;
>  
>  	if (WARN_ON(reset_spec->args_count != rcdev->of_reset_n_cells))
> @@ -61,71 +61,54 @@ static int berlin_reset_xlate(struct reset_controller_dev *rcdev,
>  	offset = reset_spec->args[0];
>  	bit = reset_spec->args[1];
>  
> -	if (offset >= priv->size)
> -		return -EINVAL;
> -
>  	if (bit >= BERLIN_MAX_RESETS)
>  		return -EINVAL;
>  
>  	return (offset << 8) | bit;
>  }
>  
> -static int __berlin_reset_init(struct device_node *np)
> +static int berlin2_reset_probe(struct platform_device *pdev)
>  {
> +	struct device_node *parent_np = of_get_parent(pdev->dev.of_node);
>  	struct berlin_reset_priv *priv;
> -	struct resource res;
> -	resource_size_t size;
> -	int ret;
>  
> -	priv = kzalloc(sizeof(*priv), GFP_KERNEL);
> +	priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
>  	if (!priv)
>  		return -ENOMEM;
>  
> -	ret = of_address_to_resource(np, 0, &res);
> -	if (ret)
> -		goto err;
> -
> -	size = resource_size(&res);
> -	priv->base = ioremap(res.start, size);
> -	if (!priv->base) {
> -		ret = -ENOMEM;
> -		goto err;
> -	}
> -	priv->size = size;
> +	priv->regmap = syscon_node_to_regmap(parent_np);
> +	of_node_put(parent_np);
> +	if (IS_ERR(priv->regmap))
> +		return PTR_ERR(priv->regmap);
>  
>  	priv->rcdev.owner = THIS_MODULE;
>  	priv->rcdev.ops = &berlin_reset_ops;
> -	priv->rcdev.of_node = np;
> +	priv->rcdev.of_node = pdev->dev.of_node;
>  	priv->rcdev.of_reset_n_cells = 2;
>  	priv->rcdev.of_xlate = berlin_reset_xlate;
>  
>  	reset_controller_register(&priv->rcdev);
>  
>  	return 0;
> -
> -err:
> -	kfree(priv);
> -	return ret;
>  }
>  
> -static const struct of_device_id berlin_reset_of_match[] __initconst = {
> -	{ .compatible = "marvell,berlin2-chip-ctrl" },
> -	{ .compatible = "marvell,berlin2cd-chip-ctrl" },
> -	{ .compatible = "marvell,berlin2q-chip-ctrl" },
> +static const struct of_device_id berlin_reset_of_match[] = {
> +	{ .compatible = "marvell,berlin2-reset" },
>  	{ },
>  };
> +MODULE_DEVICE_TABLE(of, berlin_reset_of_match);
>  
> -static int __init berlin_reset_init(void)
> -{
> -	struct device_node *np;
> -	int ret;
> +static struct platform_driver berlin_reset_driver = {
> +	.probe	= berlin2_reset_probe,
> +	.driver	= {
> +		.name = "berlin2-reset",
> +		.of_match_table = berlin_reset_of_match,
> +	},
>  
> -	for_each_matching_node(np, berlin_reset_of_match) {
> -		ret = __berlin_reset_init(np);
> -		if (ret)
> -			return ret;
> -	}
> +};
> +module_platform_driver(berlin_reset_driver);
>  
> -	return 0;
> -}
> -arch_initcall(berlin_reset_init);
> +MODULE_AUTHOR("Antoine Tenart <antoine.tenart@free-electrons.com>");
> +MODULE_AUTHOR("Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>");
> +MODULE_DESCRIPTION("Marvell Berlin reset driver");
> +MODULE_LICENSE("GPL");



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

* Re: [PATCH v2 04/10] Documentation: bindings: move the Berlin reset documentation
  2015-03-06 15:05 ` [PATCH v2 04/10] Documentation: bindings: move the Berlin reset documentation Antoine Tenart
@ 2015-03-09 10:16   ` Philipp Zabel
  0 siblings, 0 replies; 25+ messages in thread
From: Philipp Zabel @ 2015-03-09 10:16 UTC (permalink / raw)
  To: Antoine Tenart
  Cc: sebastian.hesselbarth, jszhang, zmxu, linux-arm-kernel, linux-kernel

Am Freitag, den 06.03.2015, 16:05 +0100 schrieb Antoine Tenart:
> The Berlin reset documentation was part of the Marvell Berlin SoC
> documentation because the Berlin reset configuration was inside the chip
> controller. With the recent rework of the chip and system controller
> handling (now an MFD driver registers all sub-devices of the two soc and
> system controller nodes and each device has its own sub-node), the
> documentation of the Berlin reset driver can be moved to the generic
> reset documentation directory.
> 
> Signed-off-by: Antoine Tenart <antoine.tenart@free-electrons.com>

Acked-by: Philipp Zabel <p.zabel@pengutronix.de>

regards
Philipp


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

* Re: [PATCH v2 00/10] ARM: berlin: refactor chip and system controllers
  2015-03-06 15:05 [PATCH v2 00/10] ARM: berlin: refactor chip and system controllers Antoine Tenart
                   ` (9 preceding siblings ...)
  2015-03-06 15:05 ` [PATCH v2 10/10] ARM: berlin: rework chip and system controller nodes for BG2Q Antoine Tenart
@ 2015-03-09 17:13 ` Linus Walleij
  10 siblings, 0 replies; 25+ messages in thread
From: Linus Walleij @ 2015-03-09 17:13 UTC (permalink / raw)
  To: Antoine Tenart
  Cc: Sebastian Hesselbarth, Samuel Ortiz, Lee Jones, Philipp Zabel,
	Jisheng Zhang, zhiming Xu, linux-arm-kernel, linux-kernel

On Fri, Mar 6, 2015 at 4:05 PM, Antoine Tenart
<antoine.tenart@free-electrons.com> wrote:

> This series aims to handle these two nodes correctly, by using the newly
> available simple-mfd compatible, to register all the sub-devices.

Hm let's see if that series makes it to ARM SoC then, thanks for
supporting that design pattern!

Yours,
Linus Walleij

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

* Re: [PATCH v2 03/10] reset: berlin: convert to a platform driver
  2015-03-09 10:16   ` Philipp Zabel
@ 2015-03-10  9:57     ` Antoine Tenart
  2015-03-25  8:26       ` Linus Walleij
  2015-05-12 14:43       ` Antoine Tenart
  0 siblings, 2 replies; 25+ messages in thread
From: Antoine Tenart @ 2015-03-10  9:57 UTC (permalink / raw)
  To: Philipp Zabel
  Cc: Antoine Tenart, sebastian.hesselbarth, jszhang, zmxu,
	linux-arm-kernel, linux-kernel

Hi Philipp,

On Mon, Mar 09, 2015 at 11:16:26AM +0100, Philipp Zabel wrote:
> 
> Am Freitag, den 06.03.2015, 16:05 +0100 schrieb Antoine Tenart:
> > The Berlin reset controller was introduced without being a platform
> > driver because of a needed DT rework: the node describing the reset
> > controller also describes the pinctrl and clk controllers...
> > 
> > The DT issue being solved thanks to the addition of the Berlin
> > controller mfd driver, it is now possible to convert the Berlin reset
> > driver to a plaftorm driver.
> > 
> > Signed-off-by: Antoine Tenart <antoine.tenart@free-electrons.com>
> 
> Looks good to me. Do you want to merge this together with the rest of
> the series, or should I queue the reset patch?

I think we better wait for the simple-mfd patch to make it to ARM SoC
first.

Once this is done, you can queue the reset patch (unless Sebastian wants
to take it alongside the series).

Antoine

-- 
Antoine Ténart, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

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

* Re: [PATCH v2 03/10] reset: berlin: convert to a platform driver
  2015-03-10  9:57     ` Antoine Tenart
@ 2015-03-25  8:26       ` Linus Walleij
  2015-05-12 14:43       ` Antoine Tenart
  1 sibling, 0 replies; 25+ messages in thread
From: Linus Walleij @ 2015-03-25  8:26 UTC (permalink / raw)
  To: Antoine Tenart
  Cc: Philipp Zabel, Sebastian Hesselbarth, Jisheng Zhang, zhiming Xu,
	linux-arm-kernel, linux-kernel

On Tue, Mar 10, 2015 at 10:57 AM, Antoine Tenart
<antoine.tenart@free-electrons.com> wrote:

> I think we better wait for the simple-mfd patch to make it to ARM SoC
> first.

I got impatient waiting for subsys ACKs and sent a pull request for
this today.

Yours,
Linus Walleij

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

* Re: [PATCH v2 05/10] pinctrl: berlin: use the regmap provided by syscon
  2015-03-06 15:05 ` [PATCH v2 05/10] pinctrl: berlin: use the regmap provided by syscon Antoine Tenart
@ 2015-04-28 11:30   ` Sebastian Hesselbarth
  2015-05-06 14:28   ` Linus Walleij
  1 sibling, 0 replies; 25+ messages in thread
From: Sebastian Hesselbarth @ 2015-04-28 11:30 UTC (permalink / raw)
  To: Antoine Tenart, linus.walleij
  Cc: jszhang, zmxu, linux-gpio, linux-arm-kernel, linux-kernel

On 06.03.2015 16:05, Antoine Tenart wrote:
> The Berlin pin controller nodes are now sub-nodes of the soc-controller
> and the system-controller nodes. The register bank is managed by syscon,
> which provides a regmap.
>
> Remove the regmap setup from the Berlin pinctrl driver and use the one
> provided by syscon.
>
> Signed-off-by: Antoine Tenart <antoine.tenart@free-electrons.com>

Linus,

would you mind to give your Acked-by for this and the next patch and
let me take this through Berlin and ARM-SoC tree? The patches only
touch berlin-specific subdirectories in pinctrl/ so there should be
no merge issues expected.

Sebastian

> ---
>   drivers/pinctrl/berlin/berlin-bg2.c   | 22 ----------------------
>   drivers/pinctrl/berlin/berlin-bg2cd.c | 22 ----------------------
>   drivers/pinctrl/berlin/berlin-bg2q.c  | 22 ----------------------
>   drivers/pinctrl/berlin/berlin.c       |  9 ++++++---
>   4 files changed, 6 insertions(+), 69 deletions(-)
>
> diff --git a/drivers/pinctrl/berlin/berlin-bg2.c b/drivers/pinctrl/berlin/berlin-bg2.c
> index b71a6fffef1b..368ec0b9b8ba 100644
> --- a/drivers/pinctrl/berlin/berlin-bg2.c
> +++ b/drivers/pinctrl/berlin/berlin-bg2.c
> @@ -233,28 +233,6 @@ static int berlin2_pinctrl_probe(struct platform_device *pdev)
>   {
>   	const struct of_device_id *match =
>   		of_match_device(berlin2_pinctrl_match, &pdev->dev);
> -	struct regmap_config *rmconfig;
> -	struct regmap *regmap;
> -	struct resource *res;
> -	void __iomem *base;
> -
> -	rmconfig = devm_kzalloc(&pdev->dev, sizeof(*rmconfig), GFP_KERNEL);
> -	if (!rmconfig)
> -		return -ENOMEM;
> -
> -	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -	base = devm_ioremap_resource(&pdev->dev, res);
> -	if (IS_ERR(base))
> -		return PTR_ERR(base);
> -
> -	rmconfig->reg_bits = 32,
> -	rmconfig->val_bits = 32,
> -	rmconfig->reg_stride = 4,
> -	rmconfig->max_register = resource_size(res);
> -
> -	regmap = devm_regmap_init_mmio(&pdev->dev, base, rmconfig);
> -	if (IS_ERR(regmap))
> -		return PTR_ERR(regmap);
>
>   	return berlin_pinctrl_probe(pdev, match->data);
>   }
> diff --git a/drivers/pinctrl/berlin/berlin-bg2cd.c b/drivers/pinctrl/berlin/berlin-bg2cd.c
> index 19ac5a22c947..6b9cae029ef7 100644
> --- a/drivers/pinctrl/berlin/berlin-bg2cd.c
> +++ b/drivers/pinctrl/berlin/berlin-bg2cd.c
> @@ -176,28 +176,6 @@ static int berlin2cd_pinctrl_probe(struct platform_device *pdev)
>   {
>   	const struct of_device_id *match =
>   		of_match_device(berlin2cd_pinctrl_match, &pdev->dev);
> -	struct regmap_config *rmconfig;
> -	struct regmap *regmap;
> -	struct resource *res;
> -	void __iomem *base;
> -
> -	rmconfig = devm_kzalloc(&pdev->dev, sizeof(*rmconfig), GFP_KERNEL);
> -	if (!rmconfig)
> -		return -ENOMEM;
> -
> -	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -	base = devm_ioremap_resource(&pdev->dev, res);
> -	if (IS_ERR(base))
> -		return PTR_ERR(base);
> -
> -	rmconfig->reg_bits = 32,
> -	rmconfig->val_bits = 32,
> -	rmconfig->reg_stride = 4,
> -	rmconfig->max_register = resource_size(res);
> -
> -	regmap = devm_regmap_init_mmio(&pdev->dev, base, rmconfig);
> -	if (IS_ERR(regmap))
> -		return PTR_ERR(regmap);
>
>   	return berlin_pinctrl_probe(pdev, match->data);
>   }
> diff --git a/drivers/pinctrl/berlin/berlin-bg2q.c b/drivers/pinctrl/berlin/berlin-bg2q.c
> index bd9662e57ad3..11aa10cc0e3e 100644
> --- a/drivers/pinctrl/berlin/berlin-bg2q.c
> +++ b/drivers/pinctrl/berlin/berlin-bg2q.c
> @@ -395,28 +395,6 @@ static int berlin2q_pinctrl_probe(struct platform_device *pdev)
>   {
>   	const struct of_device_id *match =
>   		of_match_device(berlin2q_pinctrl_match, &pdev->dev);
> -	struct regmap_config *rmconfig;
> -	struct regmap *regmap;
> -	struct resource *res;
> -	void __iomem *base;
> -
> -	rmconfig = devm_kzalloc(&pdev->dev, sizeof(*rmconfig), GFP_KERNEL);
> -	if (!rmconfig)
> -		return -ENOMEM;
> -
> -	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -	base = devm_ioremap_resource(&pdev->dev, res);
> -	if (IS_ERR(base))
> -		return PTR_ERR(base);
> -
> -	rmconfig->reg_bits = 32,
> -	rmconfig->val_bits = 32,
> -	rmconfig->reg_stride = 4,
> -	rmconfig->max_register = resource_size(res);
> -
> -	regmap = devm_regmap_init_mmio(&pdev->dev, base, rmconfig);
> -	if (IS_ERR(regmap))
> -		return PTR_ERR(regmap);
>
>   	return berlin_pinctrl_probe(pdev, match->data);
>   }
> diff --git a/drivers/pinctrl/berlin/berlin.c b/drivers/pinctrl/berlin/berlin.c
> index 7f0b0f93242b..2e3a8b8858ec 100644
> --- a/drivers/pinctrl/berlin/berlin.c
> +++ b/drivers/pinctrl/berlin/berlin.c
> @@ -12,6 +12,7 @@
>
>   #include <linux/io.h>
>   #include <linux/module.h>
> +#include <linux/mfd/syscon.h>
>   #include <linux/of.h>
>   #include <linux/of_address.h>
>   #include <linux/of_device.h>
> @@ -295,13 +296,15 @@ int berlin_pinctrl_probe(struct platform_device *pdev,
>   			 const struct berlin_pinctrl_desc *desc)
>   {
>   	struct device *dev = &pdev->dev;
> +	struct device_node *parent_np = of_get_parent(dev->of_node);
>   	struct berlin_pinctrl *pctrl;
>   	struct regmap *regmap;
>   	int ret;
>
> -	regmap = dev_get_regmap(&pdev->dev, NULL);
> -	if (!regmap)
> -		return -ENODEV;
> +	regmap = syscon_node_to_regmap(parent_np);
> +	of_node_put(parent_np);
> +	if (IS_ERR(regmap))
> +		return PTR_ERR(regmap);
>
>   	pctrl = devm_kzalloc(dev, sizeof(*pctrl), GFP_KERNEL);
>   	if (!pctrl)
>


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

* Re: [PATCH v2 05/10] pinctrl: berlin: use the regmap provided by syscon
  2015-03-06 15:05 ` [PATCH v2 05/10] pinctrl: berlin: use the regmap provided by syscon Antoine Tenart
  2015-04-28 11:30   ` Sebastian Hesselbarth
@ 2015-05-06 14:28   ` Linus Walleij
  1 sibling, 0 replies; 25+ messages in thread
From: Linus Walleij @ 2015-05-06 14:28 UTC (permalink / raw)
  To: Antoine Tenart
  Cc: Sebastian Hesselbarth, Jisheng Zhang, zhiming Xu, linux-gpio,
	linux-arm-kernel, linux-kernel

On Fri, Mar 6, 2015 at 4:05 PM, Antoine Tenart
<antoine.tenart@free-electrons.com> wrote:

> The Berlin pin controller nodes are now sub-nodes of the soc-controller
> and the system-controller nodes. The register bank is managed by syscon,
> which provides a regmap.
>
> Remove the regmap setup from the Berlin pinctrl driver and use the one
> provided by syscon.
>
> Signed-off-by: Antoine Tenart <antoine.tenart@free-electrons.com>

As requested by Sebastian:
Acked-by: Linus Walleij <linus.walleij@linaro.org>

If there are other substantial changes to this driver in this kernel
cycle they will also have to be ACKed and funneled through
Berlin and ARM SoC trees.

Yours,
Linus Walleij

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

* Re: [PATCH v2 03/10] reset: berlin: convert to a platform driver
  2015-03-10  9:57     ` Antoine Tenart
  2015-03-25  8:26       ` Linus Walleij
@ 2015-05-12 14:43       ` Antoine Tenart
  2015-05-13  8:38         ` Philipp Zabel
  1 sibling, 1 reply; 25+ messages in thread
From: Antoine Tenart @ 2015-05-12 14:43 UTC (permalink / raw)
  To: Philipp Zabel
  Cc: Antoine Tenart, sebastian.hesselbarth, jszhang, zmxu,
	linux-arm-kernel, linux-kernel

On Tue, Mar 10, 2015 at 10:57:13AM +0100, Antoine Tenart wrote:
> On Mon, Mar 09, 2015 at 11:16:26AM +0100, Philipp Zabel wrote:
> > 
> > Am Freitag, den 06.03.2015, 16:05 +0100 schrieb Antoine Tenart:
> > > The Berlin reset controller was introduced without being a platform
> > > driver because of a needed DT rework: the node describing the reset
> > > controller also describes the pinctrl and clk controllers...
> > > 
> > > The DT issue being solved thanks to the addition of the Berlin
> > > controller mfd driver, it is now possible to convert the Berlin reset
> > > driver to a plaftorm driver.
> > > 
> > > Signed-off-by: Antoine Tenart <antoine.tenart@free-electrons.com>
> > 
> > Looks good to me. Do you want to merge this together with the rest of
> > the series, or should I queue the reset patch?
> 
> I think we better wait for the simple-mfd patch to make it to ARM SoC
> first.

simple-mfd just got pulled into next/drivers.

> Once this is done, you can queue the reset patch (unless Sebastian wants
> to take it alongside the series).

Antoine

-- 
Antoine Ténart, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

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

* Re: [PATCH v2 03/10] reset: berlin: convert to a platform driver
  2015-05-12 14:43       ` Antoine Tenart
@ 2015-05-13  8:38         ` Philipp Zabel
  2015-05-15  9:14           ` Sebastian Hesselbarth
  0 siblings, 1 reply; 25+ messages in thread
From: Philipp Zabel @ 2015-05-13  8:38 UTC (permalink / raw)
  To: Antoine Tenart, sebastian.hesselbarth
  Cc: jszhang, zmxu, linux-arm-kernel, linux-kernel

Hi Antoine, Sebastian,

Am Dienstag, den 12.05.2015, 16:43 +0200 schrieb Antoine Tenart:
> On Tue, Mar 10, 2015 at 10:57:13AM +0100, Antoine Tenart wrote:
> > On Mon, Mar 09, 2015 at 11:16:26AM +0100, Philipp Zabel wrote:
> > > 
> > > Am Freitag, den 06.03.2015, 16:05 +0100 schrieb Antoine Tenart:
> > > > The Berlin reset controller was introduced without being a platform
> > > > driver because of a needed DT rework: the node describing the reset
> > > > controller also describes the pinctrl and clk controllers...
> > > > 
> > > > The DT issue being solved thanks to the addition of the Berlin
> > > > controller mfd driver, it is now possible to convert the Berlin reset
> > > > driver to a plaftorm driver.
> > > > 
> > > > Signed-off-by: Antoine Tenart <antoine.tenart@free-electrons.com>
> > > 
> > > Looks good to me. Do you want to merge this together with the rest of
> > > the series, or should I queue the reset patch?
> > 
> > I think we better wait for the simple-mfd patch to make it to ARM SoC
> > first.
> 
> simple-mfd just got pulled into next/drivers.
> 
> > Once this is done, you can queue the reset patch (unless Sebastian wants
> > to take it alongside the series).
> 
> Antoine

I just noticed that we'll create a small merge conflict in
Documentation/devicetree/bindings/arm/marvell,berlin.txt if I were to
merge patches 3 and 4.
It would be nice to have the reset driver patch merged in the vicinity
of this documentation change. Since there won't be any conflicting
changes in drivers/reset/reset-berlin.c, I'd be in favor of keeping the
series together. So patches 3 and 4

Acked-by: Philipp Zabel <p.zabel@pengutronix.de>

best regards
Philipp


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

* Re: [PATCH v2 03/10] reset: berlin: convert to a platform driver
  2015-05-13  8:38         ` Philipp Zabel
@ 2015-05-15  9:14           ` Sebastian Hesselbarth
  0 siblings, 0 replies; 25+ messages in thread
From: Sebastian Hesselbarth @ 2015-05-15  9:14 UTC (permalink / raw)
  To: Philipp Zabel, Antoine Tenart
  Cc: jszhang, zmxu, linux-arm-kernel, linux-kernel

On 13.05.2015 10:38, Philipp Zabel wrote:
> Hi Antoine, Sebastian,
>
> Am Dienstag, den 12.05.2015, 16:43 +0200 schrieb Antoine Tenart:
>> On Tue, Mar 10, 2015 at 10:57:13AM +0100, Antoine Tenart wrote:
>>> On Mon, Mar 09, 2015 at 11:16:26AM +0100, Philipp Zabel wrote:
>>>>
>>>> Am Freitag, den 06.03.2015, 16:05 +0100 schrieb Antoine Tenart:
>>>>> The Berlin reset controller was introduced without being a platform
>>>>> driver because of a needed DT rework: the node describing the reset
>>>>> controller also describes the pinctrl and clk controllers...
>>>>>
>>>>> The DT issue being solved thanks to the addition of the Berlin
>>>>> controller mfd driver, it is now possible to convert the Berlin reset
>>>>> driver to a plaftorm driver.
>>>>>
>>>>> Signed-off-by: Antoine Tenart <antoine.tenart@free-electrons.com>
>>>>
>>>> Looks good to me. Do you want to merge this together with the rest of
>>>> the series, or should I queue the reset patch?
>>>
>>> I think we better wait for the simple-mfd patch to make it to ARM SoC
>>> first.
>>
>> simple-mfd just got pulled into next/drivers.
>>
>>> Once this is done, you can queue the reset patch (unless Sebastian wants
>>> to take it alongside the series).
>>
>> Antoine
>
> I just noticed that we'll create a small merge conflict in
> Documentation/devicetree/bindings/arm/marvell,berlin.txt if I were to
> merge patches 3 and 4.
> It would be nice to have the reset driver patch merged in the vicinity
> of this documentation change. Since there won't be any conflicting
> changes in drivers/reset/reset-berlin.c, I'd be in favor of keeping the
> series together. So patches 3 and 4
>
> Acked-by: Philipp Zabel <p.zabel@pengutronix.de>

Philipp,

you already Acked that patch two months ago, so I was assuming to take
it though berlin tree anyway. But thanks for the Ack again ;)

Applied the series to berlin now.

Sebastian


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

* Re: [PATCH v2 06/10] pinctrl: berlin: use proper compatibles
  2015-03-06 15:05 ` [PATCH v2 06/10] pinctrl: berlin: use proper compatibles Antoine Tenart
@ 2015-06-10  7:13   ` Linus Walleij
  2015-06-12  9:05     ` Antoine Tenart
  0 siblings, 1 reply; 25+ messages in thread
From: Linus Walleij @ 2015-06-10  7:13 UTC (permalink / raw)
  To: Antoine Tenart
  Cc: Sebastian Hesselbarth, Jisheng Zhang, zhiming Xu, linux-gpio,
	linux-arm-kernel, linux-kernel

On Fri, Mar 6, 2015 at 4:05 PM, Antoine Tenart
<antoine.tenart@free-electrons.com> wrote:

> The Berlin pin-controller driver was sharing the chip and system
> controller nodes with the clock and the reset drivers. They all shared
> the same compatible. With the introduction of the Marvell Berlin MFD
> controller, the Berlin pin-controller driver has now its own node.
> Update its compatibles to not share anymore the ones of the chip and
> system controllers.
>
> Signed-off-by: Antoine Tenart <antoine.tenart@free-electrons.com>

Antoine, how is this series going?

If I can merge some of it to pinctrl let me know.

Acked-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij

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

* Re: [PATCH v2 07/10] Documentation: bindings: move the Berlin pinctrl documentation
  2015-03-06 15:05 ` [PATCH v2 07/10] Documentation: bindings: move the Berlin pinctrl documentation Antoine Tenart
@ 2015-06-10  7:14   ` Linus Walleij
  0 siblings, 0 replies; 25+ messages in thread
From: Linus Walleij @ 2015-06-10  7:14 UTC (permalink / raw)
  To: Antoine Tenart
  Cc: Sebastian Hesselbarth, Jisheng Zhang, zhiming Xu, linux-gpio,
	linux-arm-kernel, linux-kernel

On Fri, Mar 6, 2015 at 4:05 PM, Antoine Tenart
<antoine.tenart@free-electrons.com> wrote:

> The Berlin pinctrl documentation was part of the Marvell Berlin SoC
> documentation because the Berlin pinctrl configuration was inside the
> chip and the system controllers. With the recent rework of the chip and
> system controller handling (now an MFD driver registers all sub-devices
> of the two soc and system controller nodes and each device has its own
> sub-node), the documentation of the Berlin pinctrl driver can be moved
> to the generic pinctrl documentation directory.
>
> Signed-off-by: Antoine Tenart <antoine.tenart@free-electrons.com>

Acked-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij

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

* Re: [PATCH v2 06/10] pinctrl: berlin: use proper compatibles
  2015-06-10  7:13   ` Linus Walleij
@ 2015-06-12  9:05     ` Antoine Tenart
  2015-06-12  9:24       ` Sebastian Hesselbarth
  0 siblings, 1 reply; 25+ messages in thread
From: Antoine Tenart @ 2015-06-12  9:05 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Antoine Tenart, Sebastian Hesselbarth, Jisheng Zhang, zhiming Xu,
	linux-gpio, linux-arm-kernel, linux-kernel

On Wed, Jun 10, 2015 at 09:13:55AM +0200, Linus Walleij wrote:
> On Fri, Mar 6, 2015 at 4:05 PM, Antoine Tenart
> <antoine.tenart@free-electrons.com> wrote:
> 
> > The Berlin pin-controller driver was sharing the chip and system
> > controller nodes with the clock and the reset drivers. They all shared
> > the same compatible. With the introduction of the Marvell Berlin MFD
> > controller, the Berlin pin-controller driver has now its own node.
> > Update its compatibles to not share anymore the ones of the chip and
> > system controllers.
> >
> > Signed-off-by: Antoine Tenart <antoine.tenart@free-electrons.com>
> 
> Antoine, how is this series going?

The series should be in the berlin tree at the moment.

Antoine

-- 
Antoine Ténart, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

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

* Re: [PATCH v2 06/10] pinctrl: berlin: use proper compatibles
  2015-06-12  9:05     ` Antoine Tenart
@ 2015-06-12  9:24       ` Sebastian Hesselbarth
  0 siblings, 0 replies; 25+ messages in thread
From: Sebastian Hesselbarth @ 2015-06-12  9:24 UTC (permalink / raw)
  To: Antoine Tenart, Linus Walleij
  Cc: Jisheng Zhang, zhiming Xu, linux-gpio, linux-arm-kernel, linux-kernel

On 06/12/2015 11:05 AM, Antoine Tenart wrote:
> On Wed, Jun 10, 2015 at 09:13:55AM +0200, Linus Walleij wrote:
>> On Fri, Mar 6, 2015 at 4:05 PM, Antoine Tenart
>> <antoine.tenart@free-electrons.com> wrote:
>>
>>> The Berlin pin-controller driver was sharing the chip and system
>>> controller nodes with the clock and the reset drivers. They all shared
>>> the same compatible. With the introduction of the Marvell Berlin MFD
>>> controller, the Berlin pin-controller driver has now its own node.
>>> Update its compatibles to not share anymore the ones of the chip and
>>> system controllers.
>>>
>>> Signed-off-by: Antoine Tenart <antoine.tenart@free-electrons.com>
>>
>> Antoine, how is this series going?
>
> The series should be in the berlin tree at the moment.

Not only berlin, but also arm-soc:

[1] https://lkml.org/r/5498391.Fl346EDjWm@wuerfel
[2] https://lkml.org/r/2918562.6HiyIinobj@wuerfel

Sebastian

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

end of thread, other threads:[~2015-06-12  9:24 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-06 15:05 [PATCH v2 00/10] ARM: berlin: refactor chip and system controllers Antoine Tenart
2015-03-06 15:05 ` [PATCH v2 01/10] Documentation: bindings: update the Berlin controllers documentation Antoine Tenart
2015-03-06 15:05 ` [PATCH v2 02/10] ARM: berlin: select MFD_SYSCON by default Antoine Tenart
2015-03-06 15:05 ` [PATCH v2 03/10] reset: berlin: convert to a platform driver Antoine Tenart
2015-03-09 10:16   ` Philipp Zabel
2015-03-10  9:57     ` Antoine Tenart
2015-03-25  8:26       ` Linus Walleij
2015-05-12 14:43       ` Antoine Tenart
2015-05-13  8:38         ` Philipp Zabel
2015-05-15  9:14           ` Sebastian Hesselbarth
2015-03-06 15:05 ` [PATCH v2 04/10] Documentation: bindings: move the Berlin reset documentation Antoine Tenart
2015-03-09 10:16   ` Philipp Zabel
2015-03-06 15:05 ` [PATCH v2 05/10] pinctrl: berlin: use the regmap provided by syscon Antoine Tenart
2015-04-28 11:30   ` Sebastian Hesselbarth
2015-05-06 14:28   ` Linus Walleij
2015-03-06 15:05 ` [PATCH v2 06/10] pinctrl: berlin: use proper compatibles Antoine Tenart
2015-06-10  7:13   ` Linus Walleij
2015-06-12  9:05     ` Antoine Tenart
2015-06-12  9:24       ` Sebastian Hesselbarth
2015-03-06 15:05 ` [PATCH v2 07/10] Documentation: bindings: move the Berlin pinctrl documentation Antoine Tenart
2015-06-10  7:14   ` Linus Walleij
2015-03-06 15:05 ` [PATCH v2 08/10] ARM: berlin: rework chip and system controller nodes for BG2 Antoine Tenart
2015-03-06 15:05 ` [PATCH v2 09/10] ARM: berlin: rework chip and system controller nodes for BG2CD Antoine Tenart
2015-03-06 15:05 ` [PATCH v2 10/10] ARM: berlin: rework chip and system controller nodes for BG2Q Antoine Tenart
2015-03-09 17:13 ` [PATCH v2 00/10] ARM: berlin: refactor chip and system controllers Linus Walleij

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).