summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorLiu Ying <Ying.Liu@freescale.com>2015-03-26 18:21:41 +0800
committerguoyin.chen <guoyin.chen@freescale.com>2015-05-08 17:24:18 +0800
commite483093a5b63ef1017bae7a66a90dd23def2f9b3 (patch)
treedb985a3004766a53fe12479ba4de09f0ce531be1 /drivers
parent8f9afbf036aa6447d9e7ca331e9468d97c68691a (diff)
MLK-10475-8 video: mxc: ldb: Add i.MX6qp LDB support
i.MX6qp contains ldb clock tree fixup. This patch checks if we have the fixup or not according to the compatible string and separates the clock tree handling logics. Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/video/mxc/ldb.c52
1 files changed, 41 insertions, 11 deletions
diff --git a/drivers/video/mxc/ldb.c b/drivers/video/mxc/ldb.c
index 4739df7fcca1..ca533446e7e2 100644
--- a/drivers/video/mxc/ldb.c
+++ b/drivers/video/mxc/ldb.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2012-2014 Freescale Semiconductor, Inc. All Rights Reserved.
+ * Copyright (C) 2012-2015 Freescale Semiconductor, Inc. All Rights Reserved.
*/
/*
@@ -74,6 +74,7 @@ struct ldb_info {
bool split_cap;
bool dual_cap;
bool ext_bgref_cap;
+ bool clk_fixup;
int ctrl_reg;
int bus_mux_num;
const struct bus_mux *buses;
@@ -103,6 +104,7 @@ struct ldb_data {
u32 ctrl;
bool spl_mode;
bool dual_mode;
+ bool clk_fixup;
struct clk *di_clk[4];
struct clk *ldb_di_clk[2];
struct clk *div_3_5_clk[2];
@@ -162,6 +164,17 @@ static const struct ldb_info imx6q_ldb_info = {
.split_cap = true,
.dual_cap = true,
.ext_bgref_cap = false,
+ .clk_fixup = false,
+ .ctrl_reg = IOMUXC_GPR2,
+ .bus_mux_num = ARRAY_SIZE(imx6q_ldb_buses),
+ .buses = imx6q_ldb_buses,
+};
+
+static const struct ldb_info imx6qp_ldb_info = {
+ .split_cap = true,
+ .dual_cap = true,
+ .ext_bgref_cap = false,
+ .clk_fixup = true,
.ctrl_reg = IOMUXC_GPR2,
.bus_mux_num = ARRAY_SIZE(imx6q_ldb_buses),
.buses = imx6q_ldb_buses,
@@ -213,6 +226,7 @@ static const struct ldb_info imx6dl_ldb_info = {
.split_cap = true,
.dual_cap = true,
.ext_bgref_cap = false,
+ .clk_fixup = false,
.ctrl_reg = IOMUXC_GPR2,
.bus_mux_num = ARRAY_SIZE(imx6dl_ldb_buses),
.buses = imx6dl_ldb_buses,
@@ -242,6 +256,7 @@ static const struct ldb_info imx6sx_ldb_info = {
.split_cap = false,
.dual_cap = false,
.ext_bgref_cap = false,
+ .clk_fixup = false,
.ctrl_reg = IOMUXC_GPR6,
.bus_mux_num = ARRAY_SIZE(imx6sx_ldb_buses),
.buses = imx6sx_ldb_buses,
@@ -271,12 +286,14 @@ static const struct ldb_info imx53_ldb_info = {
.split_cap = true,
.dual_cap = false,
.ext_bgref_cap = true,
+ .clk_fixup = false,
.ctrl_reg = IOMUXC_GPR2,
.bus_mux_num = ARRAY_SIZE(imx53_ldb_buses),
.buses = imx53_ldb_buses,
};
static const struct of_device_id ldb_dt_ids[] = {
+ { .compatible = "fsl,imx6qp-ldb", .data = &imx6qp_ldb_info, },
{ .compatible = "fsl,imx6q-ldb", .data = &imx6q_ldb_info, },
{ .compatible = "fsl,imx6dl-ldb", .data = &imx6dl_ldb_info, },
{ .compatible = "fsl,imx6sx-ldb", .data = &imx6sx_ldb_info, },
@@ -420,16 +437,28 @@ static int ldb_setup(struct mxc_dispdrv_handle *mddh,
return ret;
}
- /*
- * ldb_di_sel_parent(plls) -> ldb_di_sel ->
- *
- * -> div_3_5[chno] ->
- * -> | |-> div_sel[chno] ->
- * -> div_7[chno] ->
- *
- * -> ldb_di[chno] -> di[id]
- */
- clk_set_parent(ldb->di_clk[id], ldb->ldb_di_clk[chno]);
+
+ if (ldb->clk_fixup) {
+ /*
+ * ldb_di_sel_parent(plls) -> ldb_di_sel -> ldb_di[chno] ->
+ *
+ * -> div_3_5[chno] ->
+ * -> | |-> div_sel[chno] -> di[id]
+ * -> div_7[chno] ->
+ */
+ clk_set_parent(ldb->di_clk[id], ldb->div_sel_clk[chno]);
+ } else {
+ /*
+ * ldb_di_sel_parent(plls) -> ldb_di_sel ->
+ *
+ * -> div_3_5[chno] ->
+ * -> | |-> div_sel[chno] ->
+ * -> div_7[chno] ->
+ *
+ * -> ldb_di[chno] -> di[id]
+ */
+ clk_set_parent(ldb->di_clk[id], ldb->ldb_di_clk[chno]);
+ }
ldb_di_parent = ldb->spl_mode ? ldb->div_3_5_clk[chno] :
ldb->div_7_clk[chno];
clk_set_parent(ldb->div_sel_clk[chno], ldb_di_parent);
@@ -694,6 +723,7 @@ static int ldb_probe(struct platform_device *pdev)
ldb->bus_mux_num = ldb_info->bus_mux_num;
ldb->buses = ldb_info->buses;
ldb->ctrl_reg = ldb_info->ctrl_reg;
+ ldb->clk_fixup = ldb_info->clk_fixup;
ldb->primary_chno = -1;
ext_ref = of_property_read_bool(np, "ext-ref");