CLK: Pistachio: Register external clock gates
authorAndrew Bresticker <abrestic@chromium.org>
Wed, 25 Feb 2015 03:56:07 +0000 (19:56 -0800)
committerRalf Baechle <ralf@linux-mips.org>
Tue, 31 Mar 2015 09:59:31 +0000 (11:59 +0200)
Register the clock gates for the external audio and ethernet
reference clocks provided by the top-level general control block.

Signed-off-by: Damien Horsley <Damien.Horsley@imgtec.com>
Signed-off-by: Andrew Bresticker <abrestic@chromium.org>
Cc: Mike Turquette <mturquette@linaro.org>
Cc: Stephen Boyd <sboyd@codeaurora.org>
Cc: devicetree@vger.kernel.org
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Cc: Ezequiel Garcia <ezequiel.garcia@imgtec.com>
Cc: James Hartley <james.hartley@imgtec.com>
Cc: James Hogan <james.hogan@imgtec.com>
Acked-by: Stephen Boyd <sboyd@codeaurora.org>
Patchwork: https://patchwork.linux-mips.org/patch/9321/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
drivers/clk/pistachio/clk-pistachio.c

index 3351808ea42a8ab280cbf86ed0ee26fc57b8f529..8c0fe8828f9938d8e6491e430c33154cdcda3565 100644 (file)
@@ -306,3 +306,24 @@ static void __init pistachio_cr_periph_init(struct device_node *np)
 }
 CLK_OF_DECLARE(pistachio_cr_periph, "img,pistachio-cr-periph",
               pistachio_cr_periph_init);
+
+static struct pistachio_gate pistachio_ext_gates[] __initdata = {
+       GATE(EXT_CLK_ENET_IN, "enet_clk_in_gate", "enet_clk_in", 0x58, 5),
+       GATE(EXT_CLK_AUDIO_IN, "audio_clk_in_gate", "audio_clk_in", 0x58, 8)
+};
+
+static void __init pistachio_cr_top_init(struct device_node *np)
+{
+       struct pistachio_clk_provider *p;
+
+       p = pistachio_clk_alloc_provider(np, EXT_CLK_NR_CLKS);
+       if (!p)
+               return;
+
+       pistachio_clk_register_gate(p, pistachio_ext_gates,
+                                   ARRAY_SIZE(pistachio_ext_gates));
+
+       pistachio_clk_register_provider(p);
+}
+CLK_OF_DECLARE(pistachio_cr_top, "img,pistachio-cr-top",
+              pistachio_cr_top_init);