Thread (12 messages) 12 messages, 2 authors, 2018-08-07
STALE2863d
Revisions (3)
  1. v1 [diff vs current]
  2. v2 current
  3. v3 [diff vs current]

[PATCH v2 03/10] clk: actions: Add syscon support for Actions Semi Owl SoCs

From: Manivannan Sadhasivam <hidden>
Date: 2018-08-01 03:40:22
Also in: linux-clk, linux-devicetree, lkml
Subsystem: arm/actions semi architecture, common clk framework, the rest · Maintainers: Andreas Färber, Manivannan Sadhasivam, Michael Turquette, Stephen Boyd, Linus Torvalds

Since the clock and reset management units are sharing the same memory
map, convert the Owl common clock driver to support System Controller so
that the reset driver can reuse the same memory region.

Signed-off-by: Manivannan Sadhasivam <redacted>
---
 drivers/clk/actions/owl-common.c | 20 +++-----------------
 1 file changed, 3 insertions(+), 17 deletions(-)
diff --git a/drivers/clk/actions/owl-common.c b/drivers/clk/actions/owl-common.c
index 61c1071b5180..080f980b2ec4 100644
--- a/drivers/clk/actions/owl-common.c
+++ b/drivers/clk/actions/owl-common.c
@@ -8,6 +8,7 @@
 // Copyright (c) 2018 Linaro Ltd.
 // Author: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
 
+#include <linux/mfd/syscon.h>
 #include <linux/of_address.h>
 #include <linux/of_platform.h>
 #include <linux/platform_device.h>
@@ -15,14 +16,6 @@
 
 #include "owl-common.h"
 
-static const struct regmap_config owl_regmap_config = {
-	.reg_bits	= 32,
-	.reg_stride	= 4,
-	.val_bits	= 32,
-	.max_register	= 0x00cc,
-	.fast_io	= true,
-};
-
 static void owl_clk_set_regmap(const struct owl_clk_desc *desc,
 			 struct regmap *regmap)
 {
@@ -41,18 +34,11 @@ static void owl_clk_set_regmap(const struct owl_clk_desc *desc,
 int owl_clk_regmap_init(struct platform_device *pdev,
 			 const struct owl_clk_desc *desc)
 {
-	void __iomem *base;
 	struct regmap *regmap;
-	struct resource *res;
-
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	base = devm_ioremap_resource(&pdev->dev, res);
-	if (IS_ERR(base))
-		return PTR_ERR(base);
 
-	regmap = devm_regmap_init_mmio(&pdev->dev, base, &owl_regmap_config);
+	regmap = syscon_node_to_regmap(of_get_parent(pdev->dev.of_node));
 	if (IS_ERR(regmap)) {
-		pr_err("failed to init regmap\n");
+		dev_err(&pdev->dev, "failed to get regmap\n");
 		return PTR_ERR(regmap);
 	}
 
-- 
2.17.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help