From c32a73b4fce0ac2825e3d52460ea9e767edadc6b Mon Sep 17 00:00:00 2001 From: James Wylder Date: Wed, 5 Jan 2011 15:27:03 -0600 Subject: [PATCH] ARM: tegra: Add emc_clk_rate field to dc platform data If passed in, use the required emc_clk_rate passed in from the board file. If no value set use ULONG_MAX as before. Change-Id: I301f9fea8bf7297722b5e91e34c0dc7796c6095f Signed-off-by: James Wylder --- arch/arm/mach-tegra/include/mach/dc.h | 1 + drivers/video/tegra/dc/dc.c | 15 ++++++++------- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/arch/arm/mach-tegra/include/mach/dc.h b/arch/arm/mach-tegra/include/mach/dc.h index 77a9f15bc0bf..254b732097ef 100644 --- a/arch/arm/mach-tegra/include/mach/dc.h +++ b/arch/arm/mach-tegra/include/mach/dc.h @@ -154,6 +154,7 @@ struct tegra_fb_data { struct tegra_dc_platform_data { unsigned long flags; + unsigned long emc_clk_rate; struct tegra_dc_out *default_out; struct tegra_fb_data *fb; }; diff --git a/drivers/video/tegra/dc/dc.c b/drivers/video/tegra/dc/dc.c index 946d3da7dc2c..2819a93d8442 100644 --- a/drivers/video/tegra/dc/dc.c +++ b/drivers/video/tegra/dc/dc.c @@ -1041,6 +1041,7 @@ static int tegra_dc_probe(struct nvhost_device *ndev) void __iomem *base; int irq; int i; + unsigned long emc_clk_rate; if (!ndev->dev.platform_data) { dev_err(&ndev->dev, "no platform data\n"); @@ -1097,13 +1098,6 @@ static int tegra_dc_probe(struct nvhost_device *ndev) goto err_put_clk; } - /* - * The emc is a shared clock, it will be set to the highest - * requested rate from any user. Set the rate to ULONG_MAX to - * always request the max rate whenever this request is enabled - */ - clk_set_rate(emc_clk, ULONG_MAX); - dc->clk = clk; dc->emc_clk = emc_clk; dc->base_res = base_res; @@ -1112,6 +1106,13 @@ static int tegra_dc_probe(struct nvhost_device *ndev) dc->ndev = ndev; dc->pdata = ndev->dev.platform_data; + /* + * The emc is a shared clock, it will be set based on + * the requirements for each user on the bus. + */ + emc_clk_rate = dc->pdata->emc_clk_rate; + clk_set_rate(emc_clk, emc_clk_rate ? emc_clk_rate : ULONG_MAX); + if (dc->pdata->flags & TEGRA_DC_FLAG_ENABLED) dc->enabled = true; -- 2.34.1