Thread (5 messages) 5 messages, 2 authors, 2015-08-17

[PATCH v4 RESEND 1/3] clk: Add regmap support

From: Michael Turquette <hidden>
Date: 2015-08-17 23:22:55
Also in: linux-clk, linux-mediatek, lkml

Quoting Matthias Brugger (2015-07-31 08:14:17)
quoted hunk ↗ jump to hunk
diff --git a/drivers/clk/clk-io.c b/drivers/clk/clk-io.c
new file mode 100644
index 0000000..9630ef5
--- /dev/null
+++ b/drivers/clk/clk-io.c
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2015 Matthias Brugger <matthias.bgg@gmail.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ */
+
+#include <linux/clk-provider.h>
+
+void clk_io_writel(struct clk_hw *hw, void __iomem *reg, struct regmap *regmap,
+                       u32 offset, u32 val)
+{
+       if (__clk_get_flags(hw->clk) & CLK_USE_REGMAP)
+               regmap_write(regmap, offset, val);
+       else
+               clk_writel(val, reg);
+}
So we have clk_writel, which already wraps direct io accesses depending
on arch/platform, and then this patch adds regmap support, and both of
those are wrapped in clk_io_writel? :-/

I agree that we should merge some unified regmap support into the clock
framework for the basic clocks, but I do not think that this is the
right way to do it. This patch simply adds more code to already crowded
basic clock types.

Replacing the basic clock types by separating policy and machine-driver
code into separate, modular pieces is a high priority on my todo list.
I'd like to do that first and then revisit regmap clocks instead of
merging this series as-is.

Regards,
Mike
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help