rk31xx lvds: add power domain control for lvds

Signed-off-by: hjc <hjc@rock-chips.com>
This commit is contained in:
hjc
2015-03-19 17:02:30 +08:00
parent def6cbfb21
commit 397b328291
3 changed files with 14 additions and 3 deletions

View File

@@ -753,8 +753,8 @@
rockchip,grf = <&grf>;
reg = <0x0 0xff968000 0x0 0x4000>, <0x0 0xff9600a0 0x0 0x20>;
reg-names = "mipi_lvds_phy", "mipi_lvds_ctl";
clocks = <&clk_gates22 10>, <&clk_gates17 3>;
clock-names = "pclk_lvds", "pclk_lvds_ctl";
clocks = <&clk_gates22 10>, <&clk_gates17 3>, <&pd_lvds>;
clock-names = "pclk_lvds", "pclk_lvds_ctl", "pd_lvds";
status = "disabled";
};

View File

@@ -58,7 +58,13 @@ static int rk31xx_lvds_clk_init(struct rk_lvds_device *lvds)
dev_err(lvds->dev, "get ctrl hclk failed\n");
return PTR_ERR(lvds->ctrl_hclk);
}
}
} else {
lvds->pd = devm_clk_get(lvds->dev, "pd_lvds");
if (IS_ERR(lvds->pd)) {
dev_err(lvds->dev, "get pd_lvds failed\n");
return PTR_ERR(lvds->pd);
}
}
return 0;
}
@@ -70,6 +76,8 @@ static int rk31xx_lvds_clk_enable(struct rk_lvds_device *lvds)
clk_prepare_enable(lvds->ctrl_pclk);
if (lvds->data->soc_type == LVDS_SOC_RK312X)
clk_prepare_enable(lvds->ctrl_hclk);
else
clk_prepare_enable(lvds->pd);
lvds->clk_on = true;
}
@@ -82,6 +90,8 @@ static int rk31xx_lvds_clk_disable(struct rk_lvds_device *lvds)
clk_disable_unprepare(lvds->pclk);
if (lvds->data->soc_type == LVDS_SOC_RK312X)
clk_disable_unprepare(lvds->ctrl_hclk);
else
clk_disable_unprepare(lvds->pd);
clk_disable_unprepare(lvds->ctrl_pclk);
lvds->clk_on = false;
}

View File

@@ -132,6 +132,7 @@ struct rk_lvds_device {
void __iomem *regbase;
void __iomem *ctrl_reg;
struct regmap *grf_lvds_base;
struct clk *pd; /*power domain*/
struct clk *pclk; /*phb clk*/
struct clk *ctrl_pclk; /* mipi ctrl pclk*/
struct clk *ctrl_hclk; /* mipi ctrl hclk*/