Skip to content

Commit 9e2089c

Browse files
vdsaoglikely
authored andcommitted
powerpc/512x: add clock structure for Video-IN (VIU) unit
Allows using clk_get()/clk_enable()/clk_disable() for VIU clock in the v4l2 video driver. Signed-off-by: Hongjun Chen <[email protected]> Signed-off-by: Anatolij Gustschin <[email protected]> Signed-off-by: Grant Likely <[email protected]>
1 parent 12fb0eb commit 9e2089c

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

arch/powerpc/platforms/512x/clock.c

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,15 @@ static void diu_clk_calc(struct clk *clk)
292292
clk->rate = rate;
293293
}
294294

295+
static void viu_clk_calc(struct clk *clk)
296+
{
297+
unsigned long rate;
298+
299+
rate = sys_clk.rate;
300+
rate /= 2;
301+
clk->rate = rate;
302+
}
303+
295304
static void half_clk_calc(struct clk *clk)
296305
{
297306
clk->rate = clk->parent->rate / 2;
@@ -412,6 +421,14 @@ static struct clk diu_clk = {
412421
.calc = diu_clk_calc,
413422
};
414423

424+
static struct clk viu_clk = {
425+
.name = "viu_clk",
426+
.flags = CLK_HAS_CTRL,
427+
.reg = 1,
428+
.bit = 18,
429+
.calc = viu_clk_calc,
430+
};
431+
415432
static struct clk axe_clk = {
416433
.name = "axe_clk",
417434
.flags = CLK_HAS_CTRL,
@@ -535,6 +552,7 @@ struct clk *rate_clks[] = {
535552
&ref_clk,
536553
&sys_clk,
537554
&diu_clk,
555+
&viu_clk,
538556
&csb_clk,
539557
&e300_clk,
540558
&ips_clk,

0 commit comments

Comments
 (0)