mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-03-18 21:21:37 +00:00
ipu_common: Add ldb_clk for use in parenting the pixel clock
Add ldb_clk for use in parenting the pixel clock. Signed-off-by: Eric Nelson <eric.nelson@boundarydevices.com> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
This commit is contained in:
parent
9fbdb1aac5
commit
cf65d478ab
2 changed files with 12 additions and 3 deletions
|
@ -219,8 +219,15 @@ static struct clk ipu_clk = {
|
||||||
.usecount = 0,
|
.usecount = 0,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static struct clk ldb_clk = {
|
||||||
|
.name = "ldb_clk",
|
||||||
|
.rate = 65000000,
|
||||||
|
.usecount = 0,
|
||||||
|
};
|
||||||
|
|
||||||
/* Globals */
|
/* Globals */
|
||||||
struct clk *g_ipu_clk;
|
struct clk *g_ipu_clk;
|
||||||
|
struct clk *g_ldb_clk;
|
||||||
unsigned char g_ipu_clk_enabled;
|
unsigned char g_ipu_clk_enabled;
|
||||||
struct clk *g_di_clk[2];
|
struct clk *g_di_clk[2];
|
||||||
struct clk *g_pixel_clk[2];
|
struct clk *g_pixel_clk[2];
|
||||||
|
@ -343,7 +350,7 @@ static int ipu_pixel_clk_set_parent(struct clk *clk, struct clk *parent)
|
||||||
|
|
||||||
if (parent == g_ipu_clk)
|
if (parent == g_ipu_clk)
|
||||||
di_gen &= ~DI_GEN_DI_CLK_EXT;
|
di_gen &= ~DI_GEN_DI_CLK_EXT;
|
||||||
else if (!IS_ERR(g_di_clk[clk->id]) && parent == g_di_clk[clk->id])
|
else if (!IS_ERR(g_di_clk[clk->id]) && parent == g_ldb_clk)
|
||||||
di_gen |= DI_GEN_DI_CLK_EXT;
|
di_gen |= DI_GEN_DI_CLK_EXT;
|
||||||
else
|
else
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
@ -429,7 +436,8 @@ int ipu_probe(void)
|
||||||
|
|
||||||
g_ipu_clk = &ipu_clk;
|
g_ipu_clk = &ipu_clk;
|
||||||
debug("ipu_clk = %u\n", clk_get_rate(g_ipu_clk));
|
debug("ipu_clk = %u\n", clk_get_rate(g_ipu_clk));
|
||||||
|
g_ldb_clk = &ldb_clk;
|
||||||
|
debug("ldb_clk = %u\n", clk_get_rate(g_ldb_clk));
|
||||||
ipu_reset();
|
ipu_reset();
|
||||||
|
|
||||||
clk_set_parent(g_pixel_clk[0], g_ipu_clk);
|
clk_set_parent(g_pixel_clk[0], g_ipu_clk);
|
||||||
|
|
|
@ -64,6 +64,7 @@ static int dmfc_size_28, dmfc_size_29, dmfc_size_24, dmfc_size_27, dmfc_size_23;
|
||||||
int g_di1_tvout;
|
int g_di1_tvout;
|
||||||
|
|
||||||
extern struct clk *g_ipu_clk;
|
extern struct clk *g_ipu_clk;
|
||||||
|
extern struct clk *g_ldb_clk;
|
||||||
extern struct clk *g_di_clk[2];
|
extern struct clk *g_di_clk[2];
|
||||||
extern struct clk *g_pixel_clk[2];
|
extern struct clk *g_pixel_clk[2];
|
||||||
|
|
||||||
|
@ -941,7 +942,7 @@ int32_t ipu_init_sync_panel(int disp, uint32_t pixel_clk,
|
||||||
udelay(10000);
|
udelay(10000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
clk_set_parent(g_pixel_clk[disp], g_di_clk[disp]);
|
clk_set_parent(g_pixel_clk[disp], g_ldb_clk);
|
||||||
} else {
|
} else {
|
||||||
if (clk_get_usecount(g_pixel_clk[disp]) != 0)
|
if (clk_get_usecount(g_pixel_clk[disp]) != 0)
|
||||||
clk_set_parent(g_pixel_clk[disp], g_ipu_clk);
|
clk_set_parent(g_pixel_clk[disp], g_ipu_clk);
|
||||||
|
|
Loading…
Add table
Reference in a new issue