]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
clk: meson: clk-regmap: add read-only gate ops
authorMartin Blumenstingl <martin.blumenstingl@googlemail.com>
Thu, 22 Nov 2018 21:40:15 +0000 (22:40 +0100)
committerNeil Armstrong <narmstrong@baylibre.com>
Fri, 23 Nov 2018 14:11:58 +0000 (15:11 +0100)
Some of the gate clocks are described as "just in case" bits in the
datasheet. Examples are the ABP, PERIPH, AXI and L2 DRAM clocks on
Meson8b.
The datasheet suggests that these bits are not touched. The full
explanation is:
"Set to 1 to manually disable the [...] clock when changing the mux
selection. Typically this bit is set to 0 since the clock muxes can
switch without glitches.".

This adds new read-only ops for gate clocks so we can describe these
clocks in our clock controller drivers while ensuring that we can't
accidentally modify the registers.

Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Acked-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Link: https://lkml.kernel.org/r/20181122214017.25643-3-martin.blumenstingl@googlemail.com
drivers/clk/meson/clk-regmap.c
drivers/clk/meson/clk-regmap.h

index 305ee307c003b681ccbf3fbe27ac463efbd80eb1..c515f67322a3aec05332b931279413f71c2fc51c 100644 (file)
@@ -50,6 +50,11 @@ const struct clk_ops clk_regmap_gate_ops = {
 };
 EXPORT_SYMBOL_GPL(clk_regmap_gate_ops);
 
+const struct clk_ops clk_regmap_gate_ro_ops = {
+       .is_enabled = clk_regmap_gate_is_enabled,
+};
+EXPORT_SYMBOL_GPL(clk_regmap_gate_ro_ops);
+
 static unsigned long clk_regmap_div_recalc_rate(struct clk_hw *hw,
                                                unsigned long prate)
 {
index ed2d4348dbe284a2078be67ec5307662e97b24ab..e9c5728d40eb471e53a6e7b4abe397006f23a8e8 100644 (file)
@@ -51,6 +51,7 @@ clk_get_regmap_gate_data(struct clk_regmap *clk)
 }
 
 extern const struct clk_ops clk_regmap_gate_ops;
+extern const struct clk_ops clk_regmap_gate_ro_ops;
 
 /**
  * struct clk_regmap_div_data - regmap backed adjustable divider specific data