Merge branch 'next-devicetree' of git://git.secretlab.ca/git/linux-2.6
[firefly-linux-kernel-4.4.55.git] / arch / powerpc / platforms / 512x / clock.c
index 65e2d6729c1bbe8d429e980e25d51886ff7aa051..5b243bd3eb3b699ee6a0712340c9df51db2ed948 100644 (file)
@@ -292,6 +292,15 @@ static void diu_clk_calc(struct clk *clk)
        clk->rate = rate;
 }
 
+static void viu_clk_calc(struct clk *clk)
+{
+       unsigned long rate;
+
+       rate = sys_clk.rate;
+       rate /= 2;
+       clk->rate = rate;
+}
+
 static void half_clk_calc(struct clk *clk)
 {
        clk->rate = clk->parent->rate / 2;
@@ -412,6 +421,14 @@ static struct clk diu_clk = {
        .calc = diu_clk_calc,
 };
 
+static struct clk viu_clk = {
+       .name = "viu_clk",
+       .flags = CLK_HAS_CTRL,
+       .reg = 1,
+       .bit = 18,
+       .calc = viu_clk_calc,
+};
+
 static struct clk axe_clk = {
        .name = "axe_clk",
        .flags = CLK_HAS_CTRL,
@@ -535,6 +552,7 @@ struct clk *rate_clks[] = {
        &ref_clk,
        &sys_clk,
        &diu_clk,
+       &viu_clk,
        &csb_clk,
        &e300_clk,
        &ips_clk,