[PATCH 12/14] video: i.MX IPUv3 ldb: implement i.MX53 support
Sascha Hauer
s.hauer at pengutronix.de
Wed May 7 01:04:42 PDT 2014
Configure the clock path correctly for i.MX53.
Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
drivers/video/imx-ipu-v3/imx-ldb.c | 31 ++++++++++++++++++++++++++++++-
1 file changed, 30 insertions(+), 1 deletion(-)
diff --git a/drivers/video/imx-ipu-v3/imx-ldb.c b/drivers/video/imx-ipu-v3/imx-ldb.c
index bbdbe40..70429eb 100644
--- a/drivers/video/imx-ipu-v3/imx-ldb.c
+++ b/drivers/video/imx-ipu-v3/imx-ldb.c
@@ -190,7 +190,36 @@ static int imx6q_ldb_prepare(struct imx_ldb_channel *imx_ldb_ch, int di)
static int imx53_ldb_prepare(struct imx_ldb_channel *imx_ldb_ch, int di)
{
- return -ENOSYS;
+ struct clk *diclk, *ldbclk;
+ struct imx_ldb *ldb = imx_ldb_ch->ldb;
+ int ret, dino;
+ char *clkname;
+
+ dino = di & 0x1;
+
+ clkname = asprintf("ipu_di%d_sel", dino);
+ diclk = clk_lookup(clkname);
+ free(clkname);
+ if (IS_ERR(diclk)) {
+ dev_err(ldb->dev, "failed to get di clk: %s\n", strerror(PTR_ERR(diclk)));
+ return PTR_ERR(diclk);
+ }
+
+ clkname = asprintf("ldb_di%d_div", imx_ldb_ch->chno);
+ ldbclk = clk_lookup(clkname);
+ free(clkname);
+ if (IS_ERR(ldbclk)) {
+ dev_err(ldb->dev, "failed to get ldb clk: %s\n", strerror(PTR_ERR(ldbclk)));
+ return PTR_ERR(ldbclk);
+ }
+
+ ret = clk_set_parent(diclk, ldbclk);
+ if (ret) {
+ dev_err(ldb->dev, "failed to set display clock parent: %s\n", strerror(-ret));
+ return ret;
+ }
+
+ return 0;
}
static struct imx_ldb_data imx_ldb_data_imx6q = {
--
2.0.0.rc0
More information about the barebox
mailing list