MIPS: BCM63XX: expose the HSSPI clock
authorJonas Gorski <jogo@openwrt.org>
Sat, 30 Nov 2013 11:42:02 +0000 (12:42 +0100)
committerRalf Baechle <ralf@linux-mips.org>
Wed, 22 Jan 2014 19:18:49 +0000 (20:18 +0100)
Signed-off-by: Jonas Gorski <jogo@openwrt.org>
Signed-off-by: John Crispin <blogic@openwrt.org>
Patchwork: http://patchwork.linux-mips.org/patch/6178/

arch/mips/bcm63xx/clk.c

index 43da4ae04cc248f4a94f5e79ee2c07f434988ef6..37a621a634eece6c730fcef3b7dd8300180b8e4a 100644 (file)
@@ -225,6 +225,28 @@ static struct clk clk_spi = {
        .set    = spi_set,
 };
 
+/*
+ * HSSPI clock
+ */
+static void hsspi_set(struct clk *clk, int enable)
+{
+       u32 mask;
+
+       if (BCMCPU_IS_6328())
+               mask = CKCTL_6328_HSSPI_EN;
+       else if (BCMCPU_IS_6362())
+               mask = CKCTL_6362_HSSPI_EN;
+       else
+               return;
+
+       bcm_hwclock_set(mask, enable);
+}
+
+static struct clk clk_hsspi = {
+       .set    = hsspi_set,
+};
+
+
 /*
  * XTM clock
  */
@@ -346,6 +368,8 @@ struct clk *clk_get(struct device *dev, const char *id)
                return &clk_usbd;
        if (!strcmp(id, "spi"))
                return &clk_spi;
+       if (!strcmp(id, "hsspi"))
+               return &clk_hsspi;
        if (!strcmp(id, "xtm"))
                return &clk_xtm;
        if (!strcmp(id, "periph"))