ARM: tegra: Add emc_clk_rate field to dc platform data
authorJames Wylder <james.wylder@motorola.com>
Wed, 5 Jan 2011 21:27:03 +0000 (15:27 -0600)
committerTodd Poynor <toddpoynor@google.com>
Fri, 7 Jan 2011 01:50:15 +0000 (17:50 -0800)
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 <james.wylder@motorola.com>
arch/arm/mach-tegra/include/mach/dc.h
drivers/video/tegra/dc/dc.c

index 77a9f15bc0bf696d72a53b6a1e07ae795c38da81..254b732097ef6a5060324f4162d3a809f016423c 100644 (file)
@@ -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;
 };
index 946d3da7dc2c54601f019af6dfc6118f09a55809..2819a93d844212800911821135a8475bd158f109 100644 (file)
@@ -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;